跳转至

ML Reference

Machine learning, model registry, and feature selection utilities.

Back to API Reference

ML public facade.

CausalSelector dataclass

Select candidate causal features from a single dataset.

fit

fit(data: DataFrame) -> CausalSelector

Fit selector scores and selected feature names.

plot

plot(filename: str | None = None) -> str

Render the fitted causal graph as a PNG image.

Requires method='pc' or method='fci' and must be called after :meth:fit. Uses causallearn.utils.GraphUtils.to_pydot to convert the discovered graph structure into a PNG file, mirroring the 1.x Graph.fit_causal() API.

to_mermaid

to_mermaid() -> str

Return a Mermaid.js graph representation of the causal structure.

to_section

to_section(title: str = 'Causal Diagram') -> dict[str, str]

Return a report section dictionary containing the causal diagram.

select

select(data: DataFrame) -> list[str]

Return selected feature names after fitting.

transform

transform(data: DataFrame) -> pd.DataFrame

Return a DataFrame containing only selected features.

fit_transform

fit_transform(data: DataFrame) -> pd.DataFrame

Fit selector and return selected feature columns.

ModelLoader

Protocol for user-defined model registries.

load

load(reference: str) -> Any

Load a model object from a user-facing reference.

ModelRegistry dataclass

Small MLflow Model Registry facade.

load

load(reference: str) -> Any

Load a pyfunc model from MLflow Model Registry.

model_uri

model_uri(reference: str) -> str

Return a MLflow models:/ URI from a user-facing model reference.