Skip to content

Commit

Permalink
Renaming MLChecks to deepchecks (deepchecks#133)
Browse files Browse the repository at this point in the history
* Renaming MLChecks to deepchecks

* linting

* linting
  • Loading branch information
Itay Gabbay authored Nov 15, 2021
1 parent 1d39905 commit acad8c8
Show file tree
Hide file tree
Showing 136 changed files with 1,526 additions and 1,615 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing Guidelines

## Pull Request Checklist
- Read the [contributing guidelines](https://github.com/deepchecks/MLChecks/blob/master/CONTRIBUTING.md).
- Check if your changes are consistent with the [guidelines](https://github.com/deepchecks/MLChecks/blob/master/CONTRIBUTING.md#general-guidelines-and-philosophy-for-contribution).
- Changes are consistent with the [coding style](https://github.com/deepchecks/MLChecks/blob/master/CONTRIBUTING.md#coding-style)
- Run the [unit tests](https://github.com/deepchecks/MLChecks/blob/master/CONTRIBUTING.md#running-unit-tests).
- Read the [contributing guidelines](https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md).
- Check if your changes are consistent with the [guidelines](https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md#general-guidelines-and-philosophy-for-contribution).
- Changes are consistent with the [coding style](https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md#coding-style)
- Run the [unit tests](https://github.com/deepchecks/deepchecks/blob/master/CONTRIBUTING.md#running-unit-tests).



Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
================================
MLChecks licensing terms
Deepchecks licensing terms
================================

MLChecks is licensed under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
Deepchecks is licensed under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
as published by the Free Software Foundation;

--------------------------------
Expand Down
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

# MLChecks
# Deepchecks

![pyVersions](https://img.shields.io/pypi/pyversions/mlchecks)
![pkgVersion](https://img.shields.io/pypi/v/mlchecks)
![build](https://github.com/deepchecks/mlchecks/actions/workflows/build.yml/badge.svg)
![coverage](https://deepchecks-public.s3.eu-west-1.amazonaws.com/mlchecks/coverage.svg)
![pylint](https://deepchecks-public.s3.eu-west-1.amazonaws.com/mlchecks/pylint.svg)
![pyVersions](https://img.shields.io/pypi/pyversions/deepchecks)
![pkgVersion](https://img.shields.io/pypi/v/deepchecks)
![build](https://github.com/deepchecks/deepchecks/actions/workflows/build.yml/badge.svg)
![coverage](https://deepchecks-public.s3.eu-west-1.amazonaws.com/deepchecks/coverage.svg)
![pylint](https://deepchecks-public.s3.eu-west-1.amazonaws.com/deepchecks/pylint.svg)

MLChecks is a Python package, for quickly and efficiently validating many aspects of your trained machine learning models. These include model performance related issues, machine learning methodology best-practices, model and data integrity.
Deepchecks is a Python package, for quickly and efficiently validating many aspects of your trained machine learning models. These include model performance related issues, machine learning methodology best-practices, model and data integrity.

## Key Concepts

#### Check
Each check enables you to inspect a specific aspect of your data and models. They are the basic building block of the MLChecks package, covering all kinds of common issues, such as:
Each check enables you to inspect a specific aspect of your data and models. They are the basic building block of the deepchecks package, covering all kinds of common issues, such as:

- PerformanceOverfit

Expand All @@ -28,22 +28,22 @@ Each check enables you to inspect a specific aspect of your data and models. The
Each check displays a visual result and returns a custom result value that can be used to validate the expected check results by setting conditions upon them.

#### Suite
An ordered collection of checks. [Here](./mlchecks/suites) you can find the existing suites and a code example for how to add your own custom suite. You can edit the preconfigured suites or build a suite of your own with a collection of checks and result conditions.
An ordered collection of checks. [Here](deepchecks/suites) you can find the existing suites and a code example for how to add your own custom suite. You can edit the preconfigured suites or build a suite of your own with a collection of checks and result conditions.


## Installation

#### Using pip with package wheel file
From the directory in which you have the wheel file, run:
```bash
pip3 install MLChecks-latest.whl #--user
pip3 install deepchecks-latest.whl #--user
```

#### From source
First clone the repository and then install the package from inside the repository's directory:
```bash
git clone https://github.com/deepchecks/MLChecks.git
cd MLChecks
git clone https://github.com/deepchecks/deepchecks.git
cd deepchecks
python setup.py install # --user
```

Expand All @@ -64,8 +64,9 @@ Additionally, many of the checks and some of the suites need only a subset of th

### Running a Check
For running a specific check on your dataframe, all you need to do is:

```python
from mlchecks.checks import *
from deepchecks.checks import *
import pandas as pd

df_to_check = pd.read_csv('data_to_validate.csv')
Expand Down Expand Up @@ -124,19 +125,20 @@ df_train = iris_df[:train_len]
df_val = iris_df[train_len:]
```
To run an existing suite all you need to do is import the suite and run it -

```python
from mlchecks.suites import IntegrityCheckSuite
from deepchecks.suites import IntegrityCheckSuite
IntegrityCheckSuite.run(train_dataset=df_train, validation_dataset=df_val, check_datasets_policy='both')
```
Which will result in printing the outputs of all of the checks that are in that suite.

### Example Notebooks
For full usage examples, check out:
- [**MLChecks Quick Start Notebook**](./notebooks/examples/models/Iris%20Dataset%20CheckSuite%20Example.ipynb) - for a simple example notebook for working with checks and suites.
- [**deepchecks Quick Start Notebook**](./notebooks/examples/models/Iris%20Dataset%20CheckSuite%20Example.ipynb) - for a simple example notebook for working with checks and suites.
- [**Example Checks Output Notebooks**](./notebooks) - to see all of the existing checks and their usage examples.

## Communication
- Join our [Slack Community](https://join.slack.com/t/mlcheckscommunity/shared_invite/zt-y28sjt1v-PBT50S3uoyWui_Deg5L_jg) to connect with the maintainers and follow users and interesting discussions
- Post a [Github Issue](https://github.com/deepchecks/MLChecks/issues) to suggest improvements, open an issue, or share feedback.
- Post a [Github Issue](https://github.com/deepchecks/deepchecks/issues) to suggest improvements, open an issue, or share feedback.

[comment]: <> "- Send us an [email](mailto:info@mlchecks.com) at info@mlchecks.com"
[comment]: <> "- Send us an [email](mailto:info@deepchecks.com) at info@deepchecks.com"
2 changes: 1 addition & 1 deletion mlchecks/__init__.py → deepchecks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Top module for MLChecks library."""
"""Top module for deepchecks library."""
from .base import *
import matplotlib
import matplotlib.pyplot as plt
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion mlchecks/base/__init__.py → deepchecks/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Module for base classes.
Import objects to be available in parent mlchecks module.
Import objects to be available in parent deepchecks module.
"""
from .dataset import *
from .check import *
Expand Down
14 changes: 7 additions & 7 deletions mlchecks/base/check.py → deepchecks/base/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from IPython.core.display import display_html
from matplotlib import pyplot as plt

from mlchecks.string_utils import split_camel_case
from mlchecks.utils import MLChecksValueError
from deepchecks.string_utils import split_camel_case
from deepchecks.utils import DeepchecksValueError


class Condition:
Expand All @@ -25,10 +25,10 @@ class Condition:

def __init__(self, name: str, function: Callable, params: Dict):
if not isinstance(function, Callable):
raise MLChecksValueError(f'Condition must be a function `(Any) -> Union[ConditionResult, bool]`, '
raise DeepchecksValueError(f'Condition must be a function `(Any) -> Union[ConditionResult, bool]`, '
f'but got: {type(function).__name__}')
if not isinstance(name, str):
raise MLChecksValueError(f'Condition name must be of type str but got: {type(name).__name__}')
raise DeepchecksValueError(f'Condition name must be of type str but got: {type(name).__name__}')
self.name = name
self.function = function
self.params = params
Expand Down Expand Up @@ -133,7 +133,7 @@ def __init__(self, value, header: str = None, check=None, display: Any = None):

for item in self.display:
if not isinstance(item, (str, pd.DataFrame, Callable)):
raise MLChecksValueError(f'Can\'t display item of type: {type(item)}')
raise DeepchecksValueError(f'Can\'t display item of type: {type(item)}')

def _ipython_display_(self):
if self.header:
Expand Down Expand Up @@ -210,7 +210,7 @@ def conditions_decision(self, result: CheckResult) -> List[ConditionResult]:
if isinstance(output, bool):
output = ConditionResult(output)
elif not isinstance(output, ConditionResult):
raise MLChecksValueError(f'Invalid return type from condition {condition.name}, got: {type(output)}')
raise DeepchecksValueError(f'Invalid return type from condition {condition.name}, got: {type(output)}')
output.set_name(condition.name)
results.append(output)
return results
Expand Down Expand Up @@ -267,7 +267,7 @@ def remove_condition(self, index: int):
index (int): index of condtion to remove
"""
if index not in self._conditions:
raise MLChecksValueError(f'Index {index} of conditions does not exists')
raise DeepchecksValueError(f'Index {index} of conditions does not exists')
self._conditions.pop(index)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pandas as pd

from mlchecks.utils import MLChecksValueError
from deepchecks.utils import DeepchecksValueError


__all__ = ['validate_columns_exist', 'filter_columns_with_validation']
Expand All @@ -17,21 +17,21 @@ def validate_columns_exist(df: pd.DataFrame, columns: Union[None, str, List[str]
columns (Union[None, str, List[str]]): Column names to check
Raise:
MLChecksValueError: In case one of columns given don't exists raise error
DeepchecksValueError: In case one of columns given don't exists raise error
"""
if columns is None:
raise MLChecksValueError('Got empty columns')
raise DeepchecksValueError('Got empty columns')
if isinstance(columns, str):
columns = [columns]
elif isinstance(columns, List):
if any((not isinstance(s, str) for s in columns)):
raise MLChecksValueError(f'Columns must be of type str: {", ".join(columns)}')
raise DeepchecksValueError(f'Columns must be of type str: {", ".join(columns)}')
else:
raise MLChecksValueError(f'Columns must be of types `str` or `List[str]`, but got {type(columns).__name__}')
raise DeepchecksValueError(f'Columns must be of types `str` or `List[str]`, but got {type(columns).__name__}')
# Check columns exists
non_exists = set(columns) - set(df.columns)
if non_exists:
raise MLChecksValueError(f'Given columns do not exist in dataset: {", ".join(non_exists)}')
raise DeepchecksValueError(f'Given columns do not exist in dataset: {", ".join(non_exists)}')


def filter_columns_with_validation(df: pd.DataFrame, columns: Union[str, List[str], None] = None,
Expand All @@ -43,10 +43,11 @@ def filter_columns_with_validation(df: pd.DataFrame, columns: Union[str, List[st
columns (Union[str, List[str], None]): Column names to keep.
ignore_columns (Union[str, List[str], None]): Column names to drop.
Raise:
MLChecksValueError: In case one of columns given don't exists raise error
DeepchecksValueError: In case one of columns given don't exists raise error
"""
if columns and ignore_columns:
raise MLChecksValueError('Cannot receive both parameters "columns" and "ignore", only one must be used at most')
raise DeepchecksValueError('Cannot receive both parameters "columns" and "ignore", '
'only one must be used at most')
elif columns:
validate_columns_exist(df, columns)
return df[columns]
Expand Down
Loading

0 comments on commit acad8c8

Please sign in to comment.