:py:mod:`abacusai.model_version`
================================

.. py:module:: abacusai.model_version


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   abacusai.model_version.ModelVersion




.. py:class:: ModelVersion(client, modelVersion=None, status=None, modelId=None, modelConfig=None, modelPredictionConfig=None, trainingStartedAt=None, trainingCompletedAt=None, datasetVersions=None, featureGroupVersions=None, error=None, pendingDeploymentIds=None, failedDeploymentIds=None, cpuSize=None, memory=None, automlComplete=None, trainingFeatureGroupIds=None, deployableAlgorithms=None, bestAlgorithm=None, defaultAlgorithm=None, featureAnalysisStatus=None, dataClusterInfo=None, codeSource={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`

   A version of a model

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param modelVersion: The unique identifier of a model version.
   :type modelVersion: str
   :param status: The current status of the model.
   :type status: str
   :param modelId: A reference to the model this version belongs to.
   :type modelId: str
   :param modelConfig: The training config options used to train this model.
   :type modelConfig: dict
   :param modelPredictionConfig: The prediction config options for the model.
   :type modelPredictionConfig: dict
   :param trainingStartedAt: The start time and date of the training process.
   :type trainingStartedAt: str
   :param trainingCompletedAt: The end time and date of the training process.
   :type trainingCompletedAt: str
   :param datasetVersions: Comma separated list of Dataset version IDs used for model training.
   :type datasetVersions: list of unique string identifiers
   :param featureGroupVersions: Comma separated list of Feature Group version IDs used for model training.
   :type featureGroupVersions: list of unique string identifiers
   :param error: Relevant error if the status is FAILED.
   :type error: str
   :param pendingDeploymentIds: List of deployment IDs where deployment is pending.
   :type pendingDeploymentIds: list
   :param failedDeploymentIds: List of failed deployment IDs.
   :type failedDeploymentIds: list
   :param cpuSize: Cpu size specified for the python model training.
   :type cpuSize: str
   :param memory: Memory in GB specified for the python model training.
   :type memory: int
   :param automlComplete: If true, all algorithms have completed training
   :type automlComplete: bool
   :param trainingFeatureGroupIds: The unique identifiers of the feature group used as the inputs during training to create this ModelVersion.
   :type trainingFeatureGroupIds: list of unique string identifiers
   :param deployableAlgorithms: List of deployable algorithms
   :type deployableAlgorithms: dict
   :param bestAlgorithm: Best performing algorithm
   :type bestAlgorithm: dict
   :param defaultAlgorithm: Default algorithm that the user has selected
   :type defaultAlgorithm: dict
   :param featureAnalysisStatus: lifecycle of the feature analysis stage
   :type featureAnalysisStatus: str
   :param dataClusterInfo: Information about the models for different data clusters
   :type dataClusterInfo: dict
   :param codeSource: If a python model, information on where the source code
   :type codeSource: CodeSource

   .. py:method:: __repr__()

      Return repr(self).


   .. py:method:: to_dict()

      Get a dict representation of the parameters in this class

      :returns: The dict value representation of the class parameters
      :rtype: dict


   .. py:method:: describe_train_test_data_split_feature_group_version()

      Get the train and test data split for a trained model by model_version. Only supported for models with custom algorithms.

      :param model_version: The unique version ID of the model version
      :type model_version: str

      :returns: The feature group version containing the training data and folds information.
      :rtype: FeatureGroupVersion


   .. py:method:: set_model_objective(metric)

      Sets the best model for all model instances of the model based on the specified metric, and updates the training config to use the specified metric for any future model versions.

      :param metric: The metric to use to determine the best model
      :type metric: str


   .. py:method:: delete()

      Deletes the specified model version. Model Versions which are currently used in deployments cannot be deleted.

      :param model_version: The ID of the model version to delete.
      :type model_version: str


   .. py:method:: export_model_artifact_as_feature_group(table_name, artifact_type)

      Exports metric artifact data for a model as a feature group.

      :param table_name: The name of the feature group table to create.
      :type table_name: str
      :param artifact_type: An EvalArtifact enum of which artifact to export.
      :type artifact_type: str

      :returns: The created feature group.
      :rtype: FeatureGroup


   .. py:method:: refresh()

      Calls describe and refreshes the current object's fields

      :returns: The current object
      :rtype: ModelVersion


   .. py:method:: describe()

      Retrieves a full description of the specified model version

      :param model_version: The unique version ID of the model version
      :type model_version: str

      :returns: A model version.
      :rtype: ModelVersion


   .. py:method:: get_feature_importance_by()

      Gets the feature importance calculated by various methods for the model

      :param model_version: The version of the model.
      :type model_version: str

      :returns: The feature importances for the model.
      :rtype: FeatureImportance


   .. py:method:: get_training_data_logs()

      Retrieves the data preparation logs during model training.

      :param model_version: The unique version ID of the model version
      :type model_version: str

      :returns: A list of logs.
      :rtype: DataPrepLogs


   .. py:method:: get_training_logs(stdout = False, stderr = False)

      Returns training logs for the model.

      :param stdout: Set True to get info logs
      :type stdout: bool
      :param stderr: Set True to get error logs
      :type stderr: bool

      :returns: A function logs.
      :rtype: FunctionLogs


   .. py:method:: ignore_lofo_features(threshold = None, top_n = 0)

      :param threshold:
      :type threshold: float
      :param top_n:
      :type top_n: int


   .. py:method:: wait_for_training(timeout=None)

      A waiting call until model gets trained.

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int, optional


   .. py:method:: wait_for_full_automl(timeout=None)

      A waiting call until full AutoML cycle is completed.

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int, optional


   .. py:method:: get_status()

      Gets the status of the model version under training.

      :returns: A string describing the status of a model training (pending, complete, etc.).
      :rtype: str


   .. py:method:: get_train_test_feature_group_as_pandas()

      Get the model train test data split feature group of the model version as pandas data frame.

      :returns: A pandas dataframe for the training data with fold column.
      :rtype: pandas.Dataframe



