Node

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

Bases: object

Dataclass. PipelineNode metadata

Parameters

metric (Optional[float]) – quality score

Return type

None

metric: Optional[float] = None
class fedot.core.pipelines.node.PipelineNode(operation_type=None, nodes_from=None, node_data=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 (Optional[Union[str, Operation]]) – operation defined in the operation repository

  • nodes_from (Optional[List[PipelineNode]]) – parent nodes where data comes from

  • node_data (Optional[dict]) – dict with InputData for fit and predict stage

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

property is_primary
_process_content_init(passed_content)[source]

Updating content in the node

Parameters

passed_content (dict) –

Return type

Operation

static _process_direct_init(operation_type)[source]

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

Parameters

operation_type (Optional[Union[str, Operation]]) – 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: 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)[source]

Runs training process in the node

Parameters

input_data (InputData) – data used for operation training

Returns

values predicted on the provided input_data

Return type

OutputData

predict(input_data, output_mode='default')[source]

Runs prediction process in the node

Parameters
  • input_data (InputData) – data used for prediction

  • output_mode (str) – 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()[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, parent_operation)[source]

Processes all the parent nodes via the current operation using input_data

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

  • parent_operation (str) – 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__()[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, input_data, parent_operation)[source]

Combines predictions from the parent_nodes

Parameters
  • parent_nodes (List[PipelineNode]) – list of parent nodes, from which predictions will be combined

  • input_data (Optional[InputData]) – input data from pipeline abstraction (source input data)

  • parent_operation (str) – 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