Deepchecks
zenml.integrations.deepchecks
Deepchecks integration for ZenML.
The Deepchecks integration provides a way to validate your data in your pipelines. It includes a way to detect data anomalies and define checks to ensure quality of data.
The integration includes custom materializers to store and visualize Deepchecks
SuiteResults
.
Attributes
DEEPCHECKS = 'deepchecks'
module-attribute
DEEPCHECKS_DATA_VALIDATOR_FLAVOR = 'deepchecks'
module-attribute
PANDAS = 'pandas'
module-attribute
Classes
DeepchecksIntegration
Bases: Integration
Definition of Deepchecks integration for ZenML.
Functions
activate() -> None
classmethod
Activate the Deepchecks integration.
Source code in src/zenml/integrations/deepchecks/__init__.py
55 56 57 58 |
|
flavors() -> List[Type[Flavor]]
classmethod
Declare the stack component flavors for the Deepchecks integration.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
List of stack component flavors for this integration. |
Source code in src/zenml/integrations/deepchecks/__init__.py
78 79 80 81 82 83 84 85 86 87 88 89 |
|
get_requirements(target_os: Optional[str] = None, python_version: Optional[str] = None) -> List[str]
classmethod
Method to get the requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
python_version
|
Optional[str]
|
The Python version to use for the requirements. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/deepchecks/__init__.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
Flavor
Class for ZenML Flavors.
Attributes
config_class: Type[StackComponentConfig]
abstractmethod
property
Returns StackComponentConfig
config class.
Returns:
Type | Description |
---|---|
Type[StackComponentConfig]
|
The config class. |
config_schema: Dict[str, Any]
property
The config schema for a flavor.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The config schema. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[StackComponent]
abstractmethod
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[StackComponent]
|
The implementation class for this flavor. |
logo_url: Optional[str]
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
Optional[str]
|
The flavor logo. |
name: str
abstractmethod
property
The flavor name.
Returns:
Type | Description |
---|---|
str
|
The flavor name. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
type: StackComponentType
abstractmethod
property
Functions
from_model(flavor_model: FlavorResponse) -> Flavor
classmethod
Loads a flavor from a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flavor_model
|
FlavorResponse
|
The model to load from. |
required |
Raises:
Type | Description |
---|---|
CustomFlavorImportError
|
If the custom flavor can't be imported. |
ImportError
|
If the flavor can't be imported. |
Returns:
Type | Description |
---|---|
Flavor
|
The loaded flavor. |
Source code in src/zenml/stack/flavor.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
generate_default_docs_url() -> str
Generate the doc urls for all inbuilt and integration flavors.
Note that this method is not going to be useful for custom flavors, which do not have any docs in the main zenml docs.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml documentation |
Source code in src/zenml/stack/flavor.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
generate_default_sdk_docs_url() -> str
Generate SDK docs url for a flavor.
Returns:
Type | Description |
---|---|
str
|
The complete url to the zenml SDK docs |
Source code in src/zenml/stack/flavor.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
to_model(integration: Optional[str] = None, is_custom: bool = True) -> FlavorRequest
Converts a flavor to a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
integration
|
Optional[str]
|
The integration to use for the model. |
None
|
is_custom
|
bool
|
Whether the flavor is a custom flavor. |
True
|
Returns:
Type | Description |
---|---|
FlavorRequest
|
The model. |
Source code in src/zenml/stack/flavor.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
Integration
Base class for integration in ZenML.
Functions
activate() -> None
classmethod
Abstract method to activate the integration.
Source code in src/zenml/integrations/integration.py
175 176 177 |
|
check_installation() -> bool
classmethod
Method to check whether the required packages are installed.
Returns:
Type | Description |
---|---|
bool
|
True if all required packages are installed, False otherwise. |
Source code in src/zenml/integrations/integration.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
flavors() -> List[Type[Flavor]]
classmethod
Abstract method to declare new stack component flavors.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
A list of new stack component flavors. |
Source code in src/zenml/integrations/integration.py
179 180 181 182 183 184 185 186 |
|
get_requirements(target_os: Optional[str] = None, python_version: Optional[str] = None) -> List[str]
classmethod
Method to get the requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
python_version
|
Optional[str]
|
The Python version to use for the requirements. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
get_uninstall_requirements(target_os: Optional[str] = None) -> List[str]
classmethod
Method to get the uninstall requirements for the integration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
plugin_flavors() -> List[Type[BasePluginFlavor]]
classmethod
Abstract method to declare new plugin flavors.
Returns:
Type | Description |
---|---|
List[Type[BasePluginFlavor]]
|
A list of new plugin flavors. |
Source code in src/zenml/integrations/integration.py
188 189 190 191 192 193 194 195 |
|
Modules
data_validators
Initialization of the Deepchecks data validator for ZenML.
Classes
DeepchecksDataValidator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseDataValidator
Deepchecks data validator stack component.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
data_validation(dataset: Union[pd.DataFrame, DataLoader[Any]], comparison_dataset: Optional[Any] = None, check_list: Optional[Sequence[str]] = None, dataset_kwargs: Dict[str, Any] = {}, check_kwargs: Dict[str, Dict[str, Any]] = {}, run_kwargs: Dict[str, Any] = {}, **kwargs: Any) -> SuiteResult
Run one or more Deepchecks data validation checks on a dataset.
Call this method to analyze and identify potential integrity problems
with a single dataset (e.g. missing values, conflicting labels, mixed
data types etc.) and dataset comparison checks (e.g. data drift
checks). Dataset comparison checks require that a second dataset be
supplied via the comparison_dataset
argument.
The check_list
argument may be used to specify a custom set of
Deepchecks data integrity checks to perform, identified by
DeepchecksDataIntegrityCheck
and DeepchecksDataDriftCheck
enum
values. If omitted:
-
if the
comparison_dataset
is omitted, a suite with all available data integrity checks will be performed on the input data. SeeDeepchecksDataIntegrityCheck
for a list of Deepchecks builtin checks that are compatible with this method. -
if the
comparison_dataset
is supplied, a suite with all available data drift checks will be performed on the input data. SeeDeepchecksDataDriftCheck
for a list of Deepchecks builtin checks that are compatible with this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Union[DataFrame, DataLoader[Any]]
|
Target dataset to be validated. |
required |
comparison_dataset
|
Optional[Any]
|
Optional second dataset to be used for data comparison checks (e.g data drift checks). |
None
|
check_list
|
Optional[Sequence[str]]
|
Optional list of ZenML Deepchecks check identifiers
specifying the data validation checks to be performed.
|
None
|
dataset_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks |
{}
|
check_kwargs
|
Dict[str, Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
{}
|
run_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
{}
|
kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks SuiteResult with the results of the validation. |
Source code in src/zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
|
model_validation(dataset: Union[pd.DataFrame, DataLoader[Any]], model: Union[ClassifierMixin, Module], comparison_dataset: Optional[Any] = None, check_list: Optional[Sequence[str]] = None, dataset_kwargs: Dict[str, Any] = {}, check_kwargs: Dict[str, Dict[str, Any]] = {}, run_kwargs: Dict[str, Any] = {}, **kwargs: Any) -> Any
Run one or more Deepchecks model validation checks.
Call this method to perform model validation checks (e.g. confusion matrix validation, performance reports, model error analyzes, etc). A second dataset is required for model performance comparison tests (i.e. tests that identify changes in a model behavior by comparing how it performs on two different datasets).
The check_list
argument may be used to specify a custom set of
Deepchecks model validation checks to perform, identified by
DeepchecksModelValidationCheck
and DeepchecksModelDriftCheck
enum
values. If omitted:
* if the `comparison_dataset` is omitted, a suite with all available
model validation checks will be performed on the input data. See
`DeepchecksModelValidationCheck` for a list of Deepchecks builtin
checks that are compatible with this method.
* if the `comparison_dataset` is supplied, a suite with all
available model comparison checks will be performed on the input
data. See `DeepchecksModelValidationCheck` for a list of Deepchecks
builtin checks that are compatible with this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Union[DataFrame, DataLoader[Any]]
|
Target dataset to be validated. |
required |
model
|
Union[ClassifierMixin, Module]
|
Target model to be validated. |
required |
comparison_dataset
|
Optional[Any]
|
Optional second dataset to be used for model comparison checks. |
None
|
check_list
|
Optional[Sequence[str]]
|
Optional list of ZenML Deepchecks check identifiers
specifying the model validation checks to be performed.
|
None
|
dataset_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the Deepchecks tabular.Dataset or vision.VisionData constructor. |
{}
|
check_kwargs
|
Dict[str, Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
{}
|
run_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
{}
|
kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Returns:
Type | Description |
---|---|
Any
|
A Deepchecks SuiteResult with the results of the validation. |
Source code in src/zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
|
Modules
deepchecks_data_validator
Implementation of the Deepchecks data validator.
DeepchecksDataValidator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseDataValidator
Deepchecks data validator stack component.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
data_validation(dataset: Union[pd.DataFrame, DataLoader[Any]], comparison_dataset: Optional[Any] = None, check_list: Optional[Sequence[str]] = None, dataset_kwargs: Dict[str, Any] = {}, check_kwargs: Dict[str, Dict[str, Any]] = {}, run_kwargs: Dict[str, Any] = {}, **kwargs: Any) -> SuiteResult
Run one or more Deepchecks data validation checks on a dataset.
Call this method to analyze and identify potential integrity problems
with a single dataset (e.g. missing values, conflicting labels, mixed
data types etc.) and dataset comparison checks (e.g. data drift
checks). Dataset comparison checks require that a second dataset be
supplied via the comparison_dataset
argument.
The check_list
argument may be used to specify a custom set of
Deepchecks data integrity checks to perform, identified by
DeepchecksDataIntegrityCheck
and DeepchecksDataDriftCheck
enum
values. If omitted:
-
if the
comparison_dataset
is omitted, a suite with all available data integrity checks will be performed on the input data. SeeDeepchecksDataIntegrityCheck
for a list of Deepchecks builtin checks that are compatible with this method. -
if the
comparison_dataset
is supplied, a suite with all available data drift checks will be performed on the input data. SeeDeepchecksDataDriftCheck
for a list of Deepchecks builtin checks that are compatible with this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Union[DataFrame, DataLoader[Any]]
|
Target dataset to be validated. |
required |
comparison_dataset
|
Optional[Any]
|
Optional second dataset to be used for data comparison checks (e.g data drift checks). |
None
|
check_list
|
Optional[Sequence[str]]
|
Optional list of ZenML Deepchecks check identifiers
specifying the data validation checks to be performed.
|
None
|
dataset_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks |
{}
|
check_kwargs
|
Dict[str, Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
{}
|
run_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
{}
|
kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks SuiteResult with the results of the validation. |
Source code in src/zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
|
model_validation(dataset: Union[pd.DataFrame, DataLoader[Any]], model: Union[ClassifierMixin, Module], comparison_dataset: Optional[Any] = None, check_list: Optional[Sequence[str]] = None, dataset_kwargs: Dict[str, Any] = {}, check_kwargs: Dict[str, Dict[str, Any]] = {}, run_kwargs: Dict[str, Any] = {}, **kwargs: Any) -> Any
Run one or more Deepchecks model validation checks.
Call this method to perform model validation checks (e.g. confusion matrix validation, performance reports, model error analyzes, etc). A second dataset is required for model performance comparison tests (i.e. tests that identify changes in a model behavior by comparing how it performs on two different datasets).
The check_list
argument may be used to specify a custom set of
Deepchecks model validation checks to perform, identified by
DeepchecksModelValidationCheck
and DeepchecksModelDriftCheck
enum
values. If omitted:
* if the `comparison_dataset` is omitted, a suite with all available
model validation checks will be performed on the input data. See
`DeepchecksModelValidationCheck` for a list of Deepchecks builtin
checks that are compatible with this method.
* if the `comparison_dataset` is supplied, a suite with all
available model comparison checks will be performed on the input
data. See `DeepchecksModelValidationCheck` for a list of Deepchecks
builtin checks that are compatible with this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Union[DataFrame, DataLoader[Any]]
|
Target dataset to be validated. |
required |
model
|
Union[ClassifierMixin, Module]
|
Target model to be validated. |
required |
comparison_dataset
|
Optional[Any]
|
Optional second dataset to be used for model comparison checks. |
None
|
check_list
|
Optional[Sequence[str]]
|
Optional list of ZenML Deepchecks check identifiers
specifying the model validation checks to be performed.
|
None
|
dataset_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the Deepchecks tabular.Dataset or vision.VisionData constructor. |
{}
|
check_kwargs
|
Dict[str, Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
{}
|
run_kwargs
|
Dict[str, Any]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
{}
|
kwargs
|
Any
|
Additional keyword arguments (unused). |
{}
|
Returns:
Type | Description |
---|---|
Any
|
A Deepchecks SuiteResult with the results of the validation. |
Source code in src/zenml/integrations/deepchecks/data_validators/deepchecks_data_validator.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
|
flavors
Deepchecks integration flavors.
Classes
DeepchecksDataValidatorFlavor
Bases: BaseDataValidatorFlavor
Flavor of the Deepchecks data validator.
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[DeepchecksDataValidator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[DeepchecksDataValidator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
Modules
deepchecks_data_validator_flavor
Deepchecks data validator flavor.
DeepchecksDataValidatorFlavor
Bases: BaseDataValidatorFlavor
Flavor of the Deepchecks data validator.
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[DeepchecksDataValidator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[DeepchecksDataValidator]
|
The implementation class. |
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
Type | Description |
---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
Type | Description |
---|---|
Optional[str]
|
A flavor SDK docs url. |
materializers
Deepchecks materializers.
Classes
Modules
deepchecks_dataset_materializer
Implementation of Deepchecks dataset materializer.
DeepchecksDatasetMaterializer(uri: str, artifact_store: Optional[BaseArtifactStore] = None)
Bases: PandasMaterializer
Materializer to read data to and from Deepchecks dataset.
Source code in src/zenml/integrations/pandas/materializers/pandas_materializer.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
extract_metadata(dataset: Dataset) -> Dict[str, MetadataType]
Extract metadata from the given Dataset
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Dataset
|
The |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
The extracted metadata as a dictionary. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_dataset_materializer.py
68 69 70 71 72 73 74 75 76 77 |
|
load(data_type: Type[Any]) -> Dataset
Reads pandas dataframes and creates deepchecks.Dataset
from it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_type
|
Type[Any]
|
The type of the data to read. |
required |
Returns:
Type | Description |
---|---|
Dataset
|
A Deepchecks Dataset. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_dataset_materializer.py
35 36 37 38 39 40 41 42 43 44 45 |
|
save(dataset: Dataset) -> None
Serializes pandas dataframe within a Dataset
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Dataset
|
A deepchecks.Dataset object. |
required |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_dataset_materializer.py
47 48 49 50 51 52 53 |
|
save_visualizations(dataset: Dataset) -> Dict[str, VisualizationType]
Saves visualizations for the given Deepchecks dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
Dataset
|
The Deepchecks dataset to save visualizations for. |
required |
Returns:
Type | Description |
---|---|
Dict[str, VisualizationType]
|
A dictionary of visualization URIs and their types. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_dataset_materializer.py
55 56 57 58 59 60 61 62 63 64 65 66 |
|
deepchecks_results_materializer
Implementation of Deepchecks suite results materializer.
DeepchecksResultMaterializer(uri: str, artifact_store: Optional[BaseArtifactStore] = None)
Bases: BaseMaterializer
Materializer to read data to and from CheckResult and SuiteResult objects.
Source code in src/zenml/materializers/base_materializer.py
125 126 127 128 129 130 131 132 133 134 135 |
|
extract_metadata(result: Union[CheckResult, SuiteResult]) -> Dict[str, MetadataType]
Extract metadata from the given Deepchecks result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Union[CheckResult, SuiteResult]
|
The Deepchecks result to extract metadata from. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
The extracted metadata as a dictionary. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_results_materializer.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
load(data_type: Type[Any]) -> Union[CheckResult, SuiteResult]
Reads a Deepchecks check or suite result from a serialized JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_type
|
Type[Any]
|
The type of the data to read. |
required |
Returns:
Type | Description |
---|---|
Union[CheckResult, SuiteResult]
|
A Deepchecks CheckResult or SuiteResult. |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the input data type is not supported. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_results_materializer.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
save(result: Union[CheckResult, SuiteResult]) -> None
Creates a JSON serialization for a CheckResult or SuiteResult.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Union[CheckResult, SuiteResult]
|
A Deepchecks CheckResult or SuiteResult. |
required |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_results_materializer.py
69 70 71 72 73 74 75 76 77 |
|
save_visualizations(result: Union[CheckResult, SuiteResult]) -> Dict[str, VisualizationType]
Saves visualizations for the given Deepchecks result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Union[CheckResult, SuiteResult]
|
The Deepchecks result to save visualizations for. |
required |
Returns:
Type | Description |
---|---|
Dict[str, VisualizationType]
|
A dictionary of visualization URIs and their types. |
Source code in src/zenml/integrations/deepchecks/materializers/deepchecks_results_materializer.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
steps
Initialization of the Deepchecks Standard Steps.
Functions
Modules
deepchecks_data_drift
Implementation of the Deepchecks data drift validation step.
deepchecks_data_drift_check_step(reference_dataset: pd.DataFrame, target_dataset: pd.DataFrame, check_list: Optional[Sequence[DeepchecksDataDriftCheck]] = None, dataset_kwargs: Optional[Dict[str, Any]] = None, check_kwargs: Optional[Dict[str, Any]] = None, run_kwargs: Optional[Dict[str, Any]] = None) -> SuiteResult
Run data drift checks on two pandas datasets using Deepchecks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_dataset
|
DataFrame
|
Reference dataset for the data drift check. |
required |
target_dataset
|
DataFrame
|
Target dataset to be used for the data drift check. |
required |
check_list
|
Optional[Sequence[DeepchecksDataDriftCheck]]
|
Optional list of DeepchecksDataDriftCheck identifiers specifying the subset of Deepchecks data drift checks to be performed. If not supplied, the entire set of data drift checks will be performed. |
None
|
dataset_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks |
None
|
check_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
None
|
run_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
None
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks suite result with the validation results. |
Source code in src/zenml/integrations/deepchecks/steps/deepchecks_data_drift.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
deepchecks_data_integrity
Implementation of the Deepchecks data integrity validation step.
deepchecks_data_integrity_check_step(dataset: pd.DataFrame, check_list: Optional[Sequence[DeepchecksDataIntegrityCheck]] = None, dataset_kwargs: Optional[Dict[str, Any]] = None, check_kwargs: Optional[Dict[str, Any]] = None, run_kwargs: Optional[Dict[str, Any]] = None) -> SuiteResult
Run data integrity checks on a pandas dataset using Deepchecks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
DataFrame
|
a Pandas DataFrame to validate |
required |
check_list
|
Optional[Sequence[DeepchecksDataIntegrityCheck]]
|
Optional list of DeepchecksDataIntegrityCheck identifiers specifying the subset of Deepchecks data integrity checks to be performed. If not supplied, the entire set of data integrity checks will be performed. |
None
|
dataset_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks |
None
|
check_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
None
|
run_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
None
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks suite result with the validation results. |
Source code in src/zenml/integrations/deepchecks/steps/deepchecks_data_integrity.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
deepchecks_model_drift
Implementation of the Deepchecks model drift validation step.
deepchecks_model_drift_check_step(reference_dataset: pd.DataFrame, target_dataset: pd.DataFrame, model: ClassifierMixin, check_list: Optional[Sequence[DeepchecksModelDriftCheck]] = None, dataset_kwargs: Optional[Dict[str, Any]] = None, check_kwargs: Optional[Dict[str, Any]] = None, run_kwargs: Optional[Dict[str, Any]] = None) -> SuiteResult
Run model drift checks on two pandas DataFrames and an sklearn model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_dataset
|
DataFrame
|
Reference dataset for the model drift check. |
required |
target_dataset
|
DataFrame
|
Target dataset to be used for the model drift check. |
required |
model
|
ClassifierMixin
|
a scikit-learn model to validate |
required |
check_list
|
Optional[Sequence[DeepchecksModelDriftCheck]]
|
Optional list of DeepchecksDataIntegrityCheck identifiers specifying the subset of Deepchecks data integrity checks to be performed. If not supplied, the entire set of data integrity checks will be performed. |
None
|
dataset_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks |
None
|
check_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
None
|
run_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
None
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks suite result with the validation results. |
Source code in src/zenml/integrations/deepchecks/steps/deepchecks_model_drift.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
deepchecks_model_validation
Implementation of the Deepchecks model validation validation step.
deepchecks_model_validation_check_step(dataset: pd.DataFrame, model: ClassifierMixin, check_list: Optional[Sequence[DeepchecksModelValidationCheck]] = None, dataset_kwargs: Optional[Dict[str, Any]] = None, check_kwargs: Optional[Dict[str, Any]] = None, run_kwargs: Optional[Dict[str, Any]] = None) -> SuiteResult
Run model validation checks on a pandas DataFrame and an sklearn model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset
|
DataFrame
|
a Pandas DataFrame to use for the validation |
required |
model
|
ClassifierMixin
|
a scikit-learn model to validate |
required |
check_list
|
Optional[Sequence[DeepchecksModelValidationCheck]]
|
Optional list of DeepchecksModelValidationCheck identifiers specifying the subset of Deepchecks model validation checks to be performed. If not supplied, the entire set of model validation checks will be performed. |
None
|
dataset_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks |
None
|
check_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the Deepchecks check object constructors. Arguments are grouped for each check and indexed using the full check class name or check enum value as dictionary keys. |
None
|
run_kwargs
|
Optional[Dict[str, Any]]
|
Additional keyword arguments to be passed to the
Deepchecks Suite |
None
|
Returns:
Type | Description |
---|---|
SuiteResult
|
A Deepchecks suite result with the validation results. |
Source code in src/zenml/integrations/deepchecks/steps/deepchecks_model_validation.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
validation_checks
Definition of the Deepchecks validation check types.
Classes
DeepchecksDataDriftCheck
Bases: DeepchecksValidationCheck
Categories of Deepchecks data drift checks.
This list reflects the set of train-test validation checks provided by Deepchecks:
All these checks inherit from deepchecks.tabular.TrainTestCheck
or
deepchecks.vision.TrainTestCheck
and require two datasets as input.
DeepchecksDataIntegrityCheck
Bases: DeepchecksValidationCheck
Categories of Deepchecks data integrity checks.
This list reflects the set of data integrity checks provided by Deepchecks:
All these checks inherit from deepchecks.tabular.SingleDatasetCheck
or
deepchecks.vision.SingleDatasetCheck
and require a single dataset as input.
DeepchecksModelDriftCheck
Bases: DeepchecksValidationCheck
Categories of Deepchecks model drift checks.
This list includes a subset of the model evaluation checks provided by Deepchecks that require two datasets and a mandatory model as input:
All these checks inherit from deepchecks.tabular.TrainTestCheck
or
deepchecks.vision.TrainTestCheck
and require two datasets and a mandatory
model as input.
DeepchecksModelValidationCheck
Bases: DeepchecksValidationCheck
Categories of Deepchecks model validation checks.
This list includes a subset of the model evaluation checks provided by Deepchecks that require a single dataset and a mandatory model as input:
All these checks inherit from deepchecks.tabular.SingleDatasetCheck
or
`deepchecks.vision.SingleDatasetCheck and require a dataset and a mandatory
model as input.
DeepchecksValidationCheck
Bases: StrEnum
Base class for all Deepchecks categories of validation checks.
This base class defines some conventions used for all enum values used to identify the various validation checks that can be performed with Deepchecks:
- enum values represent fully formed class paths pointing to Deepchecks BaseCheck subclasses
- all tabular data checks are located under the
deepchecks.tabular.checks
module sub-tree - all computer vision data checks are located under the
deepchecks.vision.checks
module sub-tree
check_class: Type[BaseCheck]
property
Convert the enum value to a valid Deepchecks check class.
Returns:
Type | Description |
---|---|
Type[BaseCheck]
|
The Deepchecks check class associated with the enum value. |
get_check_class(check_name: str) -> Type[BaseCheck]
classmethod
Get the Deepchecks check class associated with an enum value or a custom check name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
check_name
|
str
|
Identifies a builtin Deepchecks check. The identifier
must be formatted as |
required |
Returns:
Type | Description |
---|---|
Type[BaseCheck]
|
The Deepchecks check class associated with this enum value. |
Raises:
Type | Description |
---|---|
ValueError
|
If the check name could not be converted to a valid Deepchecks check class. This can happen for example if the enum values fall out of sync with the Deepchecks code base or if a custom check name is supplied that cannot be resolved to a valid Deepchecks BaseCheck class. |
Source code in src/zenml/integrations/deepchecks/validation_checks.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
is_tabular_check(check_name: str) -> bool
classmethod
Check if a validation check is applicable to tabular data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
check_name
|
str
|
Identifies a builtin Deepchecks check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the check is applicable to tabular data, otherwise False. |
Source code in src/zenml/integrations/deepchecks/validation_checks.py
72 73 74 75 76 77 78 79 80 81 82 83 |
|
is_vision_check(check_name: str) -> bool
classmethod
Check if a validation check is applicable to computer vision data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
check_name
|
str
|
Identifies a builtin Deepchecks check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the check is applicable to compute vision data, otherwise |
bool
|
False. |
Source code in src/zenml/integrations/deepchecks/validation_checks.py
85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
validate_check_name(check_name: str) -> None
classmethod
Validate a Deepchecks check identifier.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
check_name
|
str
|
Identifies a builtin Deepchecks check. The identifier
must be formatted as |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the check identifier does not follow the convention used by ZenML to identify Deepchecks builtin checks. |
Source code in src/zenml/integrations/deepchecks/validation_checks.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|