Context#
- class Context[source]#
Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.
- Parameters
- train_datasetUnion[TextData, None] , default: None
TextData object, representing data an estimator was fitted on
- test_datasetUnion[TextData, None] , default: None
TextData object, representing data an estimator predicts on
- with_displaybool , default: True
flag that determines if checks will calculate display (redundant in some checks).
- train_predUnion[TTextPred, None] , default: None
predictions on train dataset
- test_predUnion[TTextPred, None] , default: None
predictions on test dataset
- train_probaUnion[TTextProba, None] , default: None
probabilities on train dataset
- test_probaUnion[TTextProba, None] , default: None
probabilities on test dataset
- model_classesOptional[List] , default: None
list of classes known to the model
- random_state: int, default 42
A seed to set for pseudo-random functions , primarily sampling.
- __init__(train_dataset: Optional[TextData] = None, test_dataset: Optional[TextData] = None, with_display: bool = True, train_pred: Optional[Union[Sequence[int], Sequence[str], Sequence[Sequence[int]], Sequence[Sequence[str]]]] = None, test_pred: Optional[Union[Sequence[int], Sequence[str], Sequence[Sequence[int]], Sequence[Sequence[str]]]] = None, train_proba: Optional[Sequence[Sequence[float]]] = None, test_proba: Optional[Sequence[Sequence[float]]] = None, model_classes: Optional[List] = None, random_state: int = 42)[source]#
- __new__(*args, **kwargs)#
Attributes
Return common for train and test datasets properties. |
|
Return model if exists, otherwise raise error. |
|
Return ordered list of possible label classes for classification tasks. |
|
Return the name of the model. |
|
Return the observed classes in both train and test. |
|
Return task type if model & train_dataset & label exists. |
|
Return test if exists, otherwise raise error. |
|
Return train if exists, otherwise raise error. |
|
Return the with_display flag. |
Methods
|
Assert task_type matching given types. |
|
Run final processing on a check result which includes validation, conditions processing and sampling footnote. |
|
Return the relevant Dataset by given kind. |
|
Return initialized & validated scorers if provided or default scorers otherwise. |
|
Return initialized & validated scorer if provided or a default scorer otherwise. |
Return whether there is test_dataset dataset defined. |
|
|
Infer the task type. |
Return whether the task is multi-label classification. |
|
|
Raise an exception if it is a multi-label classification task. |
Raise an exception if it is a token classification task. |