class_docstr: Represents a TensorFlow dataset for use with MLflow Tracking.
class_docstr_tok: ["Represents","a","TensorFlow","dataset","for","use","with","MLflow","Tracking","."]
docstr: Converts the dataset to an EvaluationDataset for model evaluation. Only supported if the
  dataset is a Tensor. Required for use with mlflow.evaluate().
docstr_tok: ["Converts","the","dataset","to","an","EvaluationDataset","for","model","evaluation",".","Only","supported","if","the","dataset","is","a","Tensor",".","Required","for","use","with","mlflow.evaluate","(",")","."]
code: def to_evaluation_dataset(
      self, path=None, feature_names=None
  ) -> EvaluationDataset:
      """
      Converts the dataset to an EvaluationDataset for model evaluation. Only supported if the
      dataset is a Tensor. Required for use with mlflow.evaluate().
      """
      import tensorflow as tf
  
      # check that data and targets are Tensors
      if not tf.is_tensor(self._features):
          raise MlflowException(
              "Data must be a Tensor to convert to an EvaluationDataset."
          )
      if self._targets is not None and not tf.is_tensor(self._targets):
          raise MlflowException(
              "Targets must be a Tensor to convert to an EvaluationDataset."
          )
      return EvaluationDataset(
          data=self._features.numpy(),
          targets=self._targets.numpy()
          if self._targets is not None
          else None,
          path=path,
          feature_names=feature_names,
      )
  
imports: import json
  import logging
  from functools import cached_property
  from typing import Any, Dict, Optional, Tuple, Union
  import numpy
  from mlflow.data.dataset import Dataset
  from mlflow.data.dataset_source import DatasetSource
  from mlflow.data.digest_utils import compute_tensor_digest, compute_tensorflow_dataset_digest
  from mlflow.data.pyfunc_dataset_mixin import PyFuncConvertibleDatasetMixin, PyFuncInputsOutputs
  from mlflow.data.schema import TensorDatasetSchema
  from mlflow.exceptions import MlflowException
  from mlflow.models.evaluation.base import EvaluationDataset
  from mlflow.protos.databricks_pb2 import INTERNAL_ERROR, INVALID_PARAMETER_VALUE
  from mlflow.types.schema import Schema
  from mlflow.types.utils import _infer_schema
  from mlflow.utils.annotations import experimental
label_desc: Use image node_id 13 for calling the TensorFlowDataset obj's underlying member method code with example usage: obj.to_evaluation_dataset(path, feature_names) and returns: EvaluationDataset