TaskManager

class falcon.abstract.TaskManager(task: str, data: Any, pipeline: Optional[Type[Pipeline]] = None, pipeline_options: Optional[Dict] = None, extra_pipeline_options: Optional[Dict] = None, features: Optional[Any] = None, target: Optional[Any] = None)

Base class for all Task Managers.

__init__(task: str, data: Any, pipeline: Optional[Type[Pipeline]] = None, pipeline_options: Optional[Dict] = None, extra_pipeline_options: Optional[Dict] = None, features: Optional[Any] = None, target: Optional[Any] = None)
Parameters
  • task (str) – current task

  • data (Any) – data to be used for training

  • pipeline (Optional[Type[Pipeline]], optional) – pipeline class to be used, by default None

  • pipeline_options (Optional[Dict], optional) – arguments to be passed to pipeline instead of default ones, by default None

  • extra_pipeline_options (Optional[Dict], optional) – arguments to be passed to pipeline in addition to default ones, by default None

  • features (Any, optional) – featrues to be used for training, by default None

  • target (Any, optional) – targets to be used for training, by default None

_create_pipeline(pipeline: Optional[Type[Pipeline]], options: Optional[Dict]) None

Initializes the pipeline.

Parameters
  • pipeline (Optional[Type[Pipeline]]) – pipeline class

  • options (Optional[Dict]) – pipeline options

abstract _prepare_data(data: Any) Any

Initial data preparation (e.g. reading from file). Warning: initial data preparation (e.g. reading, cleaning) and data preprocessing (e.g. scaling, encoding) are two distinct steps. The later one is performed inside the pipeline.

Parameters

data (Any) – training data

Returns

prepared data

Return type

Any

abstract property default_pipeline: Type[Pipeline]

Default pipeline class. Can be chosen dynamically.

abstract property default_pipeline_options: Dict

Default pipeline options. Can be chosen dynamically.

abstract evaluate(test_data: Any) Any

Evaluates the performance of a trained pipeline.

Parameters

test_data (Any) – data to be used for evaluation

Returns

evaluation metric or None

Return type

Any

abstract performance_summary(test_data: Any) Any

Prints the performance summary of the trained pipeline.

Parameters

test_data (Any) – test set, optional

Returns

relevant metrics or None

Return type

Any

predict(X: Any) Any

Calls predict methods of the pipeline.

Parameters

X (Any) – features

Returns

predictions

Return type

Any

save_model(filename: Optional[str] = None, **kwargs: Any) ModelProto

Serializes and saves the model.

Parameters

filename (Optional[str], optional) – filename for the model file, by default None. If filename is not specified, the model is not saved on disk and only returned as bytes object

Returns

ONNX ModelProto of the model

Return type

ModelProto

abstract train(**kwargs: Any) TaskManager

Trains the underlying pipeline.

Returns

self

Return type

TaskManager