autointent.modules.base.BaseDecision#
- class autointent.modules.base.BaseDecision#
Bases:
autointent.modules.base.BaseModule
,abc.ABC
Base class for decision modules.
- abstract fit(scores, labels, tags=None)#
Fit the model.
- Parameters:
scores (numpy.typing.NDArray[Any]) – Scores to fit
labels (autointent.custom_types.ListOfGenericLabels) – Labels to fit
tags (list[autointent.schemas.Tag] | None) – Tags to fit
- Return type:
None
- abstract predict(scores)#
Predict the best score.
- Parameters:
scores (numpy.typing.NDArray[Any]) – Scores to predict
- Returns:
Predicted labels
- Return type:
autointent.custom_types.ListOfGenericLabels
- score_ho(context, metrics)#
Calculate metric on test set and return metric value.
- Parameters:
context (autointent.Context) – Context to score
- Returns:
Dictionary of computed metrics values for the test set
- Raises:
RuntimeError – If no folded scores are found
- Return type:
- score_cv(context, metrics)#
Calculate metric on test set and return metric value.
- Parameters:
context (autointent.Context) – Context to score
- Returns:
Dictionary of computed metrics values for the test set
- Raises:
RuntimeError – If no folded scores are found
- Return type:
- get_assets()#
Return useful assets that represent intermediate data into context.
- Returns:
Decision artifact containing intermediate data
- Return type:
- clear_cache()#
Clear cache.
- Return type:
None
- get_train_data(context)#
Get training data from context.
- Parameters:
context (autointent.Context) – Context containing the data
- Returns:
Tuple containing scores, labels, and tags
- Return type:
tuple[numpy.typing.NDArray[Any], autointent.custom_types.ListOfGenericLabels, list[autointent.schemas.Tag]]