whylogs.experimental.constraints_generation
#
Submodules#
whylogs.experimental.constraints_generation.condition_counts
whylogs.experimental.constraints_generation.count_metrics
whylogs.experimental.constraints_generation.distribution_metrics
whylogs.experimental.constraints_generation.frequent_items
whylogs.experimental.constraints_generation.multi_metrics
whylogs.experimental.constraints_generation.types_metrics
Package Contents#
Classes#
Helper class that provides a standard way to create an ABC using |
Functions#
Generates constraints for the condition count metrics of a column. |
|
Generates constraints for the count metrics of a column. |
|
Generates constraints for the count metrics of a column. |
|
Generates constraints for the types metrics of a column. |
|
Generates constraints from a reference profile view. |
- class whylogs.experimental.constraints_generation.MetricConstraint#
- condition: Callable[[whylogs.core.metrics.metrics.Metric], bool]#
- metric_selector: MetricsSelector#
- validate(dataset_profile: whylogs.core.view.dataset_profile_view.DatasetProfileView) bool #
- Parameters
dataset_profile (whylogs.core.view.dataset_profile_view.DatasetProfileView) –
- Return type
- validate_profile(dataset_profile: whylogs.core.view.dataset_profile_view.DatasetProfileView) Tuple[bool, Optional[Dict[str, Any]]] #
- Parameters
dataset_profile (whylogs.core.view.dataset_profile_view.DatasetProfileView) –
- Return type
- class whylogs.experimental.constraints_generation.DatasetProfileView(*, columns: Dict[str, whylogs.core.view.column_profile_view.ColumnProfileView], dataset_timestamp: Optional[datetime.datetime], creation_timestamp: Optional[datetime.datetime], metrics: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, str]] = None)#
Bases:
whylogs.api.writer.writer.Writable
Helper class that provides a standard way to create an ABC using inheritance.
- Parameters
columns (Dict[str, whylogs.core.view.column_profile_view.ColumnProfileView]) –
dataset_timestamp (Optional[datetime.datetime]) –
creation_timestamp (Optional[datetime.datetime]) –
metrics (Optional[Dict[str, Any]]) –
- property dataset_timestamp: Optional[datetime.datetime]#
- Return type
Optional[datetime.datetime]
- property creation_timestamp: Optional[datetime.datetime]#
- Return type
Optional[datetime.datetime]
- property model_performance_metrics: Any#
- Return type
Any
- merge(other: DatasetProfileView) DatasetProfileView #
- Parameters
other (DatasetProfileView) –
- Return type
- get_column(col_name: str) Optional[whylogs.core.view.column_profile_view.ColumnProfileView] #
- Parameters
col_name (str) –
- Return type
Optional[whylogs.core.view.column_profile_view.ColumnProfileView]
- get_columns(col_names: Optional[List[str]] = None) Dict[str, whylogs.core.view.column_profile_view.ColumnProfileView] #
- Parameters
col_names (Optional[List[str]]) –
- Return type
Dict[str, whylogs.core.view.column_profile_view.ColumnProfileView]
- classmethod zero() DatasetProfileView #
- Return type
- classmethod deserialize(data: bytes) DatasetProfileView #
- Parameters
data (bytes) –
- Return type
- classmethod read(path: str) DatasetProfileView #
- Parameters
path (str) –
- Return type
- to_pandas(column_metric: Optional[str] = None, cfg: Optional[whylogs.core.configs.SummaryConfig] = None) whylogs.core.stubs.pd.DataFrame #
- Parameters
column_metric (Optional[str]) –
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
whylogs.core.stubs.pd.DataFrame
- whylogs.experimental.constraints_generation.generate_column_condition_count_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
Generates constraints for the condition count metrics of a column. :param column_name: Name of the column :type column_name: str :param column_profile: Profile of the column :type column_profile: ColumnProfileView
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_column_count_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
Generates constraints for the count metrics of a column. :param column_name: Name of the column :type column_name: str :param column_profile: Profile of the column :type column_profile: ColumnProfileView
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_column_distribution_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
Generates constraints for the count metrics of a column. :param column_name: Name of the column :type column_name: str :param column_profile: Profile of the column :type column_profile: ColumnProfileView
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_column_frequent_items_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_column_multi_metrics_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_column_types_constraints(column_name: str, column_profile: whylogs.core.view.column_profile_view.ColumnProfileView) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
Generates constraints for the types metrics of a column. :param column_name: Name of the column :type column_name: str :param column_profile: Profile of the column :type column_profile: ColumnProfileView
- Parameters
column_name (str) –
column_profile (whylogs.core.view.column_profile_view.ColumnProfileView) –
- Return type
List[whylogs.core.constraints.metric_constraints.MetricConstraint]
- whylogs.experimental.constraints_generation.generate_constraints_from_reference_profile(reference_profile_view: whylogs.core.view.dataset_profile_view.DatasetProfileView, included_columns: Optional[List[str]] = None, excluded_columns: Optional[List[str]] = None) List[whylogs.core.constraints.metric_constraints.MetricConstraint] #
Generates constraints from a reference profile view.
- Parameters
reference_profile_view (DatasetProfileView) – Reference profile view
included_columns (Optional[List[str]], optional) – List of columns to include, by default None
excluded_columns (Optional[List[str]], optional) – List of columns to exclude, by default None
- Returns
List of generated constraints
- Return type
List[MetricConstraint]