autointent.modules.abc.DecisionModule#
- class autointent.modules.abc.DecisionModule#
Bases:
autointent.modules.abc.Module
,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 (list[autointent.custom_types.LabelType]) – 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
- Return type:
numpy.typing.NDArray[Any]
- score(context, split, metric_fn)#
Calculate metric on test set and return metric value.
- Parameters:
context (autointent.Context) – Context to score
split (Literal['validation', 'test']) – Target split
metric_fn (autointent.metrics.DecisionMetricFn) – Metric function
- Returns:
Score
- Return type:
- get_assets()#
Return useful assets that represent intermediate data into context.
- clear_cache()#
Clear cache.
- Return type:
None