Skip to content

Commit

Permalink
[Issue-571] make docs errors/warnings fixes (deepchecks#725)
Browse files Browse the repository at this point in the history
* fixes

* added suppress_warnings option to the conf.py
  • Loading branch information
yromanyshyn authored Jan 24, 2022
1 parent b1f5b51 commit 9b1b5b5
Show file tree
Hide file tree
Showing 22 changed files with 1,482 additions and 70,013 deletions.
9 changes: 5 additions & 4 deletions deepchecks/base/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,11 @@ def priority(self) -> int:
This value is primarly used to determine suite output order.
The logic is next:
- if at least one condition did not pass and is of category 'FAIL', return 1;
- if at least one condition did not pass and is of category 'WARN', return 2;
- if check result do not have assigned conditions, return 3
- if all conditions passed, return 4;
* if at least one condition did not pass and is of category 'FAIL', return 1;
* if at least one condition did not pass and is of category 'WARN', return 2;
* if check result do not have assigned conditions, return 3;
* if all conditions passed, return 4;
Returns:
int: priority of the cehck result.
Expand Down
8 changes: 4 additions & 4 deletions deepchecks/base/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class Dataset:
Args:
df (pandas.DataFrame):
A pandas DataFrame containing data relevant for the training or validating of a ML models.
label (t.Union[Hashable, pd.Series, pd.DataFrame, np.ndarray])
label (Union[Hashable, pd.Series, pd.DataFrame, np.ndarray]):
label column provided either as a string with the name of an existing column in the DataFrame or a label
object including the label data (pandas Series/DataFrame or a numpy array) that will be concatenated to the
data in the DataFrame. in case of label data the following logic is applied to set the label name:
- Series: takes the series name or 'target' if name is empty
- DataFrame: expect single column in the dataframe and use its name
- numpy: use 'target'
* Series: takes the series name or 'target' if name is empty
* DataFrame: expect single column in the dataframe and use its name
* numpy: use 'target'
features (Optional[Sequence[Hashable]]):
List of names for the feature columns in the DataFrame.
cat_features (Optional[Sequence[Hashable]]):
Expand Down
4 changes: 2 additions & 2 deletions deepchecks/checks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
DateTrainTestLeakageDuplicates,
DateTrainTestLeakageOverlap,
IdentifierLeakage,
ModelInferenceTimeCheck,
ModelInferenceTime,
DatasetsSizeComparison
)

Expand Down Expand Up @@ -89,7 +89,7 @@
'DateTrainTestLeakageDuplicates',
'DateTrainTestLeakageOverlap',
'IdentifierLeakage',
'ModelInferenceTimeCheck',
'ModelInferenceTime',
'DatasetsSizeComparison',

# overview checks
Expand Down
4 changes: 2 additions & 2 deletions deepchecks/checks/methodology/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .date_train_test_leakage_duplicates import DateTrainTestLeakageDuplicates
from .date_train_test_leakage_overlap import DateTrainTestLeakageOverlap
from .identifier_leakage import IdentifierLeakage
from .model_inference_time import ModelInferenceTimeCheck
from .model_inference_time import ModelInferenceTime
from .datasets_size_comparison import DatasetsSizeComparison


Expand All @@ -32,6 +32,6 @@
'DateTrainTestLeakageDuplicates',
'DateTrainTestLeakageOverlap',
'IdentifierLeakage',
'ModelInferenceTimeCheck',
'ModelInferenceTime',
'DatasetsSizeComparison',
]
6 changes: 3 additions & 3 deletions deepchecks/checks/methodology/model_inference_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
from deepchecks.errors import DeepchecksValueError


__all__ = ['ModelInferenceTimeCheck']
__all__ = ['ModelInferenceTime']


MI = t.TypeVar('MI', bound='ModelInferenceTimeCheck')
MI = t.TypeVar('MI', bound='ModelInferenceTime')


class ModelInferenceTimeCheck(SingleDatasetBaseCheck):
class ModelInferenceTime(SingleDatasetBaseCheck):
"""Measure model average inference time (in seconds) per sample.
Args:
Expand Down
2 changes: 1 addition & 1 deletion deepchecks/checks/performance/model_error_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def scoring_func(dataset: Dataset):
ok_color = colors['Test']

for feature in error_fi.keys()[:self.max_features_to_show]:
if error_fi[feature] < self.min_feature_contribution:
if error_fi[feature] < self.min_feature_contribution: # pylint: disable=unsubscriptable-object
break

data = pd.concat([test_dataset.data[feature], display_error], axis=1)
Expand Down
223 changes: 111 additions & 112 deletions deepchecks/datasets/classification/breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,120 +80,119 @@ def load_data(data_format: str = 'Dataset', as_train_test: bool = True) -> \
#. fractal dimension ("coastline approximation" - 1)
Dataset Shape:
.. list-table:: Dataset Shape
:widths: 50 50
:header-rows: 1
* - Property
- Value
* - Samples Total
- 569
* - Dimensionality
- 30
* - Features
- real
* - Targets
- boolean
.. list-table:: Dataset Shape
:widths: 50 50
:header-rows: 1
* - Property
- Value
* - Samples Total
- 569
* - Dimensionality
- 30
* - Features
- real
* - Targets
- boolean
Description:
.. list-table:: Dataset Description
:widths: 50 50 50
:header-rows: 1
* - mean radius
- Feature
- mean radius
* - mean texture
- Feature
- mean texture
* - mean perimeter
- Feature
- mean perimeter
* - mean area
- Feature
- mean area
* - mean smoothness
- Feature
- mean smoothness
* - mean compactness
- Feature
- mean compactness
* - mean concavity
- Feature
- mean concavity
* - mean concave points
- Feature
- mean concave points
* - mean symmetry
- Feature
- mean symmetry
* - mean fractal dimension
- Feature
- mean fractal dimension
* - radius error
- Feature
- radius error
* - texture error
- Feature
- texture error
* - perimeter error
- Feature
- perimeter error
* - area error
- Feature
- area error
* - smoothness error
- Feature
- smoothness error
* - compactness error
- Feature
- compactness error
* - concavity error
- Feature
- concavity error
* - concave points error
- Feature
- concave points error
* - symmetry error
- Feature
- symmetry error
* - fractal dimension error
- Feature
- fractal dimension error
* - worst radius
- Feature
- worst radius
* - worst texture
- Feature
- worst texture
* - worst perimeter
- Feature
- worst perimeter
* - worst area
- Feature
- worst area
* - worst smoothness
- Feature
- worst smoothness
* - worst compactness
- Feature
- worst compactness
* - worst concavity
- Feature
- worst concavity
* - worst concave points
- Feature
- worst concave points
* - worst symmetry
- Feature
- worst symmetry
* - worst fractal dimension
- Feature
- worst fractal dimension
* - target
- Label
- The class (Benign, Malignant)
.. list-table:: Dataset Description
:widths: 50 50 50
:header-rows: 1
* - mean radius
- Feature
- mean radius
* - mean texture
- Feature
- mean texture
* - mean perimeter
- Feature
- mean perimeter
* - mean area
- Feature
- mean area
* - mean smoothness
- Feature
- mean smoothness
* - mean compactness
- Feature
- mean compactness
* - mean concavity
- Feature
- mean concavity
* - mean concave points
- Feature
- mean concave points
* - mean symmetry
- Feature
- mean symmetry
* - mean fractal dimension
- Feature
- mean fractal dimension
* - radius error
- Feature
- radius error
* - texture error
- Feature
- texture error
* - perimeter error
- Feature
- perimeter error
* - area error
- Feature
- area error
* - smoothness error
- Feature
- smoothness error
* - compactness error
- Feature
- compactness error
* - concavity error
- Feature
- concavity error
* - concave points error
- Feature
- concave points error
* - symmetry error
- Feature
- symmetry error
* - fractal dimension error
- Feature
- fractal dimension error
* - worst radius
- Feature
- worst radius
* - worst texture
- Feature
- worst texture
* - worst perimeter
- Feature
- worst perimeter
* - worst area
- Feature
- worst area
* - worst smoothness
- Feature
- worst smoothness
* - worst compactness
- Feature
- worst compactness
* - worst concavity
- Feature
- worst concavity
* - worst concave points
- Feature
- worst concave points
* - worst symmetry
- Feature
- worst symmetry
* - worst fractal dimension
- Feature
- worst fractal dimension
* - target
- Label
- The class (Benign, Malignant)
Args:
data_format (str, default 'Dataset'):
Expand Down
4 changes: 2 additions & 2 deletions deepchecks/suites/default_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ConfusionMatrixReport, RocReport, CalibrationScore, TrustScoreComparison,
RegressionErrorDistribution, RegressionSystematicError, PerformanceReport, SimpleModelComparison, BoostingOverfit,
ModelInfo, ColumnsInfo, DataDuplicates, IsSingleValue, LabelAmbiguity,
DatasetsSizeComparison, UnusedFeatures, ModelInferenceTimeCheck, ModelErrorAnalysis, TrainTestLabelDrift
DatasetsSizeComparison, UnusedFeatures, ModelInferenceTime, ModelErrorAnalysis, TrainTestLabelDrift
)
from deepchecks import Suite

Expand Down Expand Up @@ -98,7 +98,7 @@ def model_evaluation() -> Suite:
RegressionErrorDistribution().add_condition_kurtosis_not_less_than(),
BoostingOverfit().add_condition_test_score_percent_decline_not_greater_than(),
UnusedFeatures().add_condition_number_of_high_variance_unused_features_not_greater_than(),
ModelInferenceTimeCheck().add_condition_inference_time_is_not_greater_than()
ModelInferenceTime().add_condition_inference_time_is_not_greater_than()
)


Expand Down
7 changes: 4 additions & 3 deletions deepchecks/utils/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def calculate_feature_importance(
kwargs for permutation importance calculation
Returns:
pandas.Series: feature importance normalized to 0-1 indexed by feature names
str: type of feature importance calculation
(types: `permutation_importance`, `feature_importances_`, `coef_`)
Tuple[Series, str]:
first item - feature importance normalized to 0-1 indexed by feature names,
second item - type of feature importance calculation (types: `permutation_importance`,
`feature_importances_`, `coef_`)
Raises:
NotFittedError:
Expand Down
Loading

0 comments on commit 9b1b5b5

Please sign in to comment.