Skip to content

Feature graphs

FeatureGraph shows how features depend on one another in a Spec. Use FeatureSubGraph to inspect a selected part of the graph. The Explorer visualizes these relationships.

Creating a graph validates the Spec by default. Use validate=False only if the Spec has already been validated and has not changed.

Describe feature dependencies as a graph and resolve requested outputs.

FeatureGraphNodeMeta module-attribute

FeatureGraphNodeMeta = models.OperatorNode | models.FeatureNode

FeatureGraphBase

Shared helpers for complete and subset feature graphs.

graph instance-attribute

graph: Graph

feature_nodes property

feature_nodes: tuple[FeatureNode, ...]

Return feature metadata in the graph's current iteration order.

input_names property

input_names: list[str]

Source-provided inputs required by operator in this graph.

feature_input_names property

feature_input_names: list[str]

Raw features required by operator but not produced by one.

output_names property

output_names: list[str]

Names of features exposed by this graph.

feature_output_names property

feature_output_names: list[str]

Names of features exposed by this graph.

intermediate_names property

intermediate_names: set[str]

Names of features considered intermediate for this graph.

feature_intermediate_names property

feature_intermediate_names: set[str]

Names of features considered intermediate for this graph.

feature_names property

feature_names: set[str]

Names of all features produced by graph operator.

topology

topology(item_type: str, skip_input: bool = False) -> list[list[str | FeatureGraphNodeMeta | Node]]

Return graph items grouped by dependency level.

print_graph

print_graph() -> str

Print the dependency graph and return its text representation.

render_graph

render_graph() -> str

Return a text representation of the dependency graph.

FeatureGraph

Bases: FeatureGraphBase

Global dependency graph built from all feature operator.

operators instance-attribute

operators = spec.operators

spec instance-attribute

spec = spec

graph instance-attribute

graph = self._create_graph()

subset

subset(output_names: list[str] | None = None) -> FeatureSubGraph

Create the minimal feature subgraph needed for requested outputs.

FeatureSubGraph

Bases: FeatureGraphBase

Feature dependency subset extracted from the complete feature graph.

graph instance-attribute

graph = graph