Pere Miquel Brull 34fbe5d64c
Docs - Prepare 1.7 docs and 1.8 snapshot (#20882)
* DOCS - Prepare 1.7 Release and 1.8 SNAPSHOT

* DOCS - Prepare 1.7 Release and 1.8 SNAPSHOT
2025-04-18 12:12:17 +05:30

2.1 KiB

title slug
ML Model Mixin /sdk/python/api-reference/mlmodel-mixin

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

module mlmodel_mixin

Mixin class containing Lineage specific methods

To be used by OpenMetadata class


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

class OMetaMlModelMixin

OpenMetadata API methods related to MlModel.

To be inherited by OpenMetadata


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method add_mlmodel_lineage

add_mlmodel_lineage(
    model: MlModel,
    description: Optional[str] = None
)  Dict[str, Any]

Iterates over MlModel's Feature Sources and add the lineage information. :param model: MlModel containing EntityReferences :param description: Lineage description :return: List of added lineage information


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method get_mlmodel_sklearn

get_mlmodel_sklearn(
    name: str,
    model,
    description: Optional[str] = None,
    service_name: str = 'scikit-learn'
)  CreateMlModelRequest

Get an MlModel Entity instance from a scikit-learn model.

Sklearn estimators all extend BaseEstimator. :param name: MlModel name :param model: sklearn estimator :param description: MlModel description :param service_name: Service name to use when creating sklearn service :return: OpenMetadata CreateMlModelRequest Entity