Operation
- class fedot.core.operations.operation.Operation(operation_type: str, **kwargs)[source]
Bases:
object
Base class for operations in nodes. Operations could be machine learning (or statistical) models or data operations
- Parameters
operation_type – name of the operation
- fit(params: Optional[Union[fedot.core.operations.operation_parameters.OperationParameters, dict]], data: fedot.core.data.data.InputData)[source]
This method is used for defining and running of the evaluation strategy to train the operation with the data provided
- Parameters
params – hyperparameters for operation
data – data used for operation training
- Returns
trained operation and prediction on train data
- Return type
tuple
- predict(fitted_operation, data: fedot.core.data.data.InputData, params: Optional[Union[fedot.core.operations.operation_parameters.OperationParameters, dict]] = None, output_mode: str = '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 – data used for prediction
params – hyperparameters for operation
output_mode – string with information about output of operation,
example (for) –
labels (is the operation predict probabilities or class) –
- predict_for_fit(fitted_operation, data: fedot.core.data.data.InputData, params: Optional[fedot.core.operations.operation_parameters.OperationParameters] = None, output_mode: str = '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 – data used for prediction
params – hyperparameters for operation
output_mode – 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: fedot.core.data.data.OutputData, output_mode: str) fedot.core.data.data.OutputData [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
- fedot.core.operations.operation._eval_strategy_for_task(operation_type: str, current_task_type: fedot.core.repository.tasks.TaskTypesEnum, 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 – name of operation, for example,
'ridge'
current_task_type – task to solve
operations_repo – repository with operations
- Returns
EvaluationStrategy
class for this operation- Return type
Model
- class fedot.core.operations.model.Model(operation_type: str)[source]
Bases:
fedot.core.operations.operation.Operation
Class with
fit
/predict
methods defining the evaluation strategy for the task- Parameters
operation_type – name of the model
- static assign_tabular_column_types(output_data: fedot.core.data.data.OutputData, output_mode: str) fedot.core.data.data.OutputData [source]
Assign types for tabular data obtained from model predictions.
By default, all types of model predictions for tabular data can be clearly defined
Data operation
- class fedot.core.operations.data_operation.DataOperation(operation_type: str)[source]
Bases:
fedot.core.operations.operation.Operation
Class with
fit
/predict
methods defining the evaluation strategy for the task- Parameters
operation_type – name of the data operation
- static assign_tabular_column_types(output_data: fedot.core.data.data.OutputData, output_mode: str) fedot.core.data.data.OutputData [source]
Assign new column types if it necessary. By default, all data operations must define column types at lower levels (
EvalStrategies
andImplementations
). In some cases the previously defined data types are passed.