Node

class fedot.core.pipelines.node.NodeMetadata(metric: Optional[float] = None)[source]

Bases: object

Dataclass. Node metadata

Parameters

metric – quality score

metric: Optional[float] = None
class fedot.core.pipelines.node.PipelineNode(operation_type: Optional[Union[str, Operation]] = None, nodes_from: Optional[List[Node]] = None, node_data: Optional[dict] = None, **kwargs)[source]

Bases: golem.core.dag.linked_graph_node.LinkedGraphNode

The class defines the interface of nodes modifying tha data flow in the Pipeline

Parameters
  • operation_type – operation defined in the operation repository

  • nodes_from – parent nodes where data comes from

  • node_datadict with InputData for fit and predict stage

  • kwargs – optional arguments (i.e. logger)

property is_primary
_process_content_init(passed_content: dict) fedot.core.operations.operation.Operation[source]

Updating content in the node

static _process_direct_init(operation_type: Optional[Union[str, fedot.core.operations.operation.Operation]]) fedot.core.operations.operation.Operation[source]

Define operation based on the direct operation_type without defining content in the node

Parameters

operation_type – node type representation

Returns

operation class object

Return type

Operation

update_params()[source]

Updates custom_params with changed parameters

property name: str

Returns str name of operation

property operation: fedot.core.operations.operation.Operation

Returns node operation object

Returns

operation object

Return type

Operation

property fitted_operation: Optional[Any]

Returns already fitted operation if exists or None instead

Returns

node fitted operation or None

unfit()[source]

Sets node_data (if exists) and fitted_operation to None

fit(input_data: fedot.core.data.data.InputData) fedot.core.data.data.OutputData[source]

Runs training process in the node

Parameters

input_data – data used for operation training

Returns

values predicted on the provided input_data

Return type

OutputData

predict(input_data: fedot.core.data.data.InputData, output_mode: str = 'default') fedot.core.data.data.OutputData[source]

Runs prediction process in the node

Parameters
  • input_data – data used for prediction

  • output_mode – desired output for operations (e.g. 'labels', 'probs', 'full_probs')

Returns

values predicted on the provided input_data

Return type

OutputData

get_data_from_node() dict[source]

Returns data if it was set to the nodes directly

Returns

dict with InputData for fit and predict stage

Return type

dict

property node_data: dict

Returns directly set node_data

Returns

dict with InputData for fit and predict stage

Return type

dict

_input_from_parents(input_data: fedot.core.data.data.InputData, parent_operation: str) fedot.core.data.data.InputData[source]

Processes all the parent nodes via the current operation using input_data

Parameters
  • input_data – input data from pipeline abstraction (source input data)

  • parent_operation – name of parent operation ('fit' or 'predict')

Returns

predictions from the secondary nodes

Return type

InputData

_nodes_from_with_fixed_order()[source]

Sorts nodes_from (if exists) by the nodes unique id

Returns

sorted nodes_from by GraphNode.descriptive_id or None

property parameters: dict

Returns node custom parameters

Returns

of custom parameters

Return type

dict

__str__() str[source]

Returns str representation of the node

Returns

string field node operation type

Return type

str

property tags: Optional[List[str]]

Returns tags of operation in the node or empty list

Returns

empty list if node is of atomized type and list of tags otherwise

Return type

Optional[List[str]]

fedot.core.pipelines.node._combine_parents(parent_nodes: List[fedot.core.pipelines.node.PipelineNode], input_data: Optional[fedot.core.data.data.InputData], parent_operation: str) Tuple[List[fedot.core.data.data.OutputData], numpy.array][source]

Combines predictions from the parent_nodes

Parameters
  • parent_nodes – list of parent nodes, from which predictions will be combined

  • input_data – input data from pipeline abstraction (source input data)

  • parent_operation – name of parent operation ('fit' or 'predict')

Returns

output data list from parent nodes, target for final pipeline prediction

Return type

Tuple[List[OutputData], np.array]

fedot.core.pipelines.node.PrimaryNode

alias of fedot.core.pipelines.node.PipelineNode

fedot.core.pipelines.node.SecondaryNode

alias of fedot.core.pipelines.node.PipelineNode