> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# ML Model Mixin

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/mlmodel_mixin.py#L0")

# module `mlmodel_mixin`

Mixin class containing Lineage specific methods

To be used by OpenMetadata class

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/mlmodel_mixin.py#L49")

## class `OMetaMlModelMixin`

OpenMetadata API methods related to MlModel.

To be inherited by OpenMetadata

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/mlmodel_mixin.py#L58")

### method `add_mlmodel_lineage`

```python theme={null}
add_mlmodel_lineage(
    model: MlModel,
    description: Optional[str] = None
) → Dict[str, Any]
```

Iterates over MlModel's Feature Sources and add the lineage information.

**Args:**

`model`: MlModel containing EntityReferences

`description`: Lineage description

**Returns:**

List of added lineage information

***

[<img src="https://img.shields.io/badge/-source-cccccc?style=flat-square" />](https://github.com/open-metadata/OpenMetadata/tree/main/ingestion/src/metadata/ingestion/ometa/mixins/mlmodel_mixin.py#L97")

### method `get_mlmodel_sklearn`

```python theme={null}
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.

**Args:**

`name`: MlModel name

`model`: sklearn estimator

`description`: MlModel description

`service_name`: Service name to use when creating sklearn service

**Returns:**

OpenMetadata CreateMlModelRequest Entity

***
