Context#
- class Context[source]#
Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.
- Parameters
- trainUnion[Dataset, pd.DataFrame] , default: None
Dataset or DataFrame object, representing data an estimator was fitted on
- testUnion[Dataset, pd.DataFrame] , default: None
Dataset or DataFrame object, representing data an estimator predicts on
- modelBasicModel , default: None
A scikit-learn-compatible fitted estimator instance
- model_name: str , default: ‘’
The name of the model
- features_importance: pd.Series , default: None
pass manual features importance
- feature_importance_force_permutationbool , default: False
force calculation of permutation features importance
- feature_importance_timeoutint , default: 120
timeout in second for the permutation features importance calculation
- scorersMapping[str, Union[str, Callable]] , default: None
dict of scorers names to scorer sklearn_name/function
- scorers_per_classMapping[str, Union[str, Callable]] , default: None
dict of scorers for classification without averaging of the classes. See <a href= “https://scikit-learn.org/stable/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel”> scikit-learn docs</a>
- __init__(train: Optional[Union[Dataset, DataFrame]] = None, test: Optional[Union[Dataset, DataFrame]] = None, model: Optional[BasicModel] = None, model_name: str = '', features_importance: Optional[Series] = None, feature_importance_force_permutation: bool = False, feature_importance_timeout: int = 120, scorers: Optional[Mapping[str, Union[str, Callable]]] = None, scorers_per_class: Optional[Mapping[str, Union[str, Callable]]] = None)[source]#
- __new__(*args, **kwargs)#
Attributes
Return features importance, or None if not possible. |
|
Return feature importance type if feature importance is available, else None. |
|
Return & validate model if model exists, otherwise raise error. |
|
Return model name. |
|
Return task type if model & train & label exists. |
|
Return test if exists, otherwise raise error. |
|
Return train if exists, otherwise raise error. |
Methods
Assert the task_type is classification. |
|
Assert the task type is regression. |
|
|
Assert task_type matching given types. |
|
Return the relevant Dataset by given kind. |
|
Get footnote to display when the datasets are sampled. |
|
Return initialized & validated scorers in a given priority. |
|
Return initialized & validated single scorer in a given priority. |
Return whether there is test dataset defined. |