Files
zenml/venv/lib/python3.9/site-packages/mlflow/data/pyfunc_dataset_mixin.py
Christian Mantha 2ca0b9ef7c star
2026-03-02 19:10:52 -05:00

30 lines
913 B
Python

from abc import abstractmethod
from dataclasses import dataclass
from typing import Optional
from mlflow.data.evaluation_dataset import EvaluationDataset
from mlflow.models.utils import PyFuncInput, PyFuncOutput
@dataclass
class PyFuncInputsOutputs:
inputs: list[PyFuncInput]
outputs: Optional[list[PyFuncOutput]] = None
class PyFuncConvertibleDatasetMixin:
@abstractmethod
def to_pyfunc(self) -> PyFuncInputsOutputs:
"""
Converts the dataset to a collection of pyfunc inputs and outputs for model
evaluation. Required for use with mlflow.evaluate().
May not be implemented by all datasets.
"""
@abstractmethod
def to_evaluation_dataset(self, path=None, feature_names=None) -> EvaluationDataset:
"""
Converts the dataset to an EvaluationDataset for model evaluation.
May not be implemented by all datasets.
"""