Context#
- class Context[source]#
Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.
- Parameters
- train: Union[Dataset, pd.DataFrame] , default: None
Dataset or DataFrame object, representing data an estimator was fitted on
- test: Union[Dataset, pd.DataFrame] , default: None
Dataset or DataFrame object, representing data an estimator predicts on
- model: BasicModel , 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>
- y_pred_train: np.ndarray , default: None
Array of the model prediction over the train dataset.
- y_pred_test: np.ndarray , default: None
Array of the model prediction over the test dataset.
- y_proba_train: np.ndarray , default: None
Array of the model prediction probabilities over the train dataset.
- y_proba_test: np.ndarray , default: None
Array of the model prediction probabilities over the test dataset.
- __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, y_pred_train: Optional[ndarray] = None, y_pred_test: Optional[ndarray] = None, y_proba_train: Optional[ndarray] = None, y_proba_test: Optional[ndarray] = 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. |