Operation

class fedot.core.operations.operation.Operation(operation_type, **kwargs)[source]

Bases: object

Base class for operations in nodes. Operations could be machine learning (or statistical) models or data operations

Parameters

operation_type (str) – name of the operation

fit(params, data)[source]

This method is used for defining and running of the evaluation strategy to train the operation with the data provided

Parameters
  • params (Optional[Union[fedot.core.operations.operation_parameters.OperationParameters, dict]]) – hyperparameters for operation

  • data (InputData) – data used for operation training

Returns

trained operation and prediction on train data

Return type

tuple

predict(fitted_operation, data, params=None, output_mode='default')[source]

This method is used for defining and running of the evaluation strategy to predict with the data provided

Parameters
  • fitted_operation – trained operation object

  • data (InputData) – data used for prediction

  • params (Optional[Union[fedot.core.operations.operation_parameters.OperationParameters, dict]]) – hyperparameters for operation

  • output_mode (str) – string with information about output of operation,

  • example (for) –

  • labels (is the operation predict probabilities or class) –

predict_for_fit(fitted_operation, data, params=None, output_mode='default')[source]

This method is used for defining and running of the evaluation strategy to predict with the data provided during fit stage

Parameters
  • fitted_operation – trained operation object

  • data (InputData) – data used for prediction

  • params (Optional[fedot.core.operations.operation_parameters.OperationParameters]) – hyperparameters for operation

  • output_mode (str) – string with information about output of operation, for example, is the operation predict probabilities or class labels

abstract static assign_tabular_column_types(output_data, output_mode)[source]

Assign types for columns based on task and output_mode (for classification)

For example, pipeline for solving time series forecasting task contains lagged and ridge operations. ts_type -> lagged -> tabular type

So, there is a need to assign column types to new data

Parameters
  • output_data (OutputData) –

  • output_mode (str) –

Return type

OutputData

to_json()[source]

Serializes object and ignores unrelevant fields.

Return type

Dict[str, Any]

fedot.core.operations.operation._eval_strategy_for_task(operation_type, current_task_type, operations_repo)[source]

The function returns the strategy for the selected operation and task type. And if it is necessary, found acceptable strategy for operation

Parameters
  • operation_type (str) – name of operation, for example, 'ridge'

  • current_task_type (TaskTypesEnum) – task to solve

  • operations_repo (OperationTypesRepository) – repository with operations

Returns

EvaluationStrategy class for this operation

Return type

EvaluationStrategy

Model

class fedot.core.operations.model.Model(operation_type)[source]

Bases: fedot.core.operations.operation.Operation

Class with fit/predict methods defining the evaluation strategy for the task

Parameters

operation_type (str) – name of the model

static assign_tabular_column_types(output_data, output_mode)[source]

Assign types for tabular data obtained from model predictions.

By default, all types of model predictions for tabular data can be clearly defined

Parameters
  • output_data (OutputData) –

  • output_mode (str) –

Return type

OutputData

Data operation

class fedot.core.operations.data_operation.DataOperation(operation_type)[source]

Bases: fedot.core.operations.operation.Operation

Class with fit/predict methods defining the evaluation strategy for the task

Parameters

operation_type (str) – name of the data operation

static assign_tabular_column_types(output_data, output_mode)[source]

Assign new column types if it necessary. By default, all data operations must define column types at lower levels (EvalStrategies and Implementations). In some cases the previously defined data types are passed.

Parameters
  • output_data (OutputData) –

  • output_mode (str) –

Return type

OutputData