abacusai.batch_prediction_version
=================================

.. py:module:: abacusai.batch_prediction_version


Classes
-------

.. autoapisummary::

   abacusai.batch_prediction_version.BatchPredictionVersion


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

.. py:class:: BatchPredictionVersion(client, batchPredictionVersion=None, batchPredictionId=None, status=None, driftMonitorStatus=None, deploymentId=None, modelId=None, modelVersion=None, predictionsStartedAt=None, predictionsCompletedAt=None, databaseOutputError=None, totalPredictions=None, failedPredictions=None, databaseConnectorId=None, databaseOutputConfiguration=None, fileConnectorOutputLocation=None, fileOutputFormat=None, connectorType=None, legacyInputLocation=None, error=None, driftMonitorError=None, monitorWarnings=None, csvInputPrefix=None, csvPredictionPrefix=None, csvExplanationsPrefix=None, databaseOutputTotalWrites=None, databaseOutputFailedWrites=None, outputIncludesMetadata=None, resultInputColumns=None, modelMonitorVersion=None, algoName=None, algorithm=None, outputFeatureGroupId=None, outputFeatureGroupVersion=None, outputFeatureGroupTableName=None, batchPredictionWarnings=None, bpAcrossVersionsMonitorVersion=None, batchPredictionArgsType=None, batchInputs={}, inputFeatureGroups={}, globalPredictionArgs={}, batchPredictionArgs={})

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


   Batch Prediction Version

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param batchPredictionVersion: The unique identifier of the batch prediction version
   :type batchPredictionVersion: str
   :param batchPredictionId: The unique identifier of the batch prediction
   :type batchPredictionId: str
   :param status: The current status of the batch prediction
   :type status: str
   :param driftMonitorStatus: The status of the drift monitor for this batch prediction version
   :type driftMonitorStatus: str
   :param deploymentId: The deployment used to make the predictions
   :type deploymentId: str
   :param modelId: The model used to make the predictions
   :type modelId: str
   :param modelVersion: The model version used to make the predictions
   :type modelVersion: str
   :param predictionsStartedAt: Predictions start date and time
   :type predictionsStartedAt: str
   :param predictionsCompletedAt: Predictions completion date and time
   :type predictionsCompletedAt: str
   :param databaseOutputError: If true, there were errors reported by the database connector while writing
   :type databaseOutputError: bool
   :param totalPredictions: Number of predictions performed in this batch prediction job
   :type totalPredictions: int
   :param failedPredictions: Number of predictions that failed
   :type failedPredictions: int
   :param databaseConnectorId: The database connector to write the results to
   :type databaseConnectorId: str
   :param databaseOutputConfiguration: Contains information about where the batch predictions are written to
   :type databaseOutputConfiguration: dict
   :param fileConnectorOutputLocation: Contains information about where the batch predictions are written to
   :type fileConnectorOutputLocation: str
   :param fileOutputFormat: The format of the batch prediction output (CSV or JSON)
   :type fileOutputFormat: str
   :param connectorType: Null if writing to internal console, else FEATURE_GROUP | FILE_CONNECTOR | DATABASE_CONNECTOR
   :type connectorType: str
   :param legacyInputLocation: The location of the input data
   :type legacyInputLocation: str
   :param error: Relevant error if the status is FAILED
   :type error: str
   :param driftMonitorError: Error message for the drift monitor of this batch predcition
   :type driftMonitorError: str
   :param monitorWarnings: Relevant warning if there are issues found in drift or data integrity
   :type monitorWarnings: str
   :param csvInputPrefix: A prefix to prepend to the input columns, only applies when output format is CSV
   :type csvInputPrefix: str
   :param csvPredictionPrefix: A prefix to prepend to the prediction columns, only applies when output format is CSV
   :type csvPredictionPrefix: str
   :param csvExplanationsPrefix: A prefix to prepend to the explanation columns, only applies when output format is CSV
   :type csvExplanationsPrefix: str
   :param databaseOutputTotalWrites: The total number of rows attempted to write (may be less than total_predictions if write mode is UPSERT and multiple rows share the same ID)
   :type databaseOutputTotalWrites: int
   :param databaseOutputFailedWrites: The number of failed writes to the Database Connector
   :type databaseOutputFailedWrites: int
   :param outputIncludesMetadata: If true, output will contain columns including prediction start time, batch prediction version, and model version
   :type outputIncludesMetadata: bool
   :param resultInputColumns: If present, will limit result files or feature groups to only include columns present in this list
   :type resultInputColumns: list[str]
   :param modelMonitorVersion: The version of the model monitor
   :type modelMonitorVersion: str
   :param algoName: The name of the algorithm used to train the model
   :type algoName: str
   :param algorithm: The algorithm that is currently deployed.
   :type algorithm: str
   :param outputFeatureGroupId: The Batch Prediction output feature group ID if applicable
   :type outputFeatureGroupId: str
   :param outputFeatureGroupVersion: The Batch Prediction output feature group version if applicable
   :type outputFeatureGroupVersion: str
   :param outputFeatureGroupTableName: The Batch Prediction output feature group name if applicable
   :type outputFeatureGroupTableName: str
   :param batchPredictionWarnings: Relevant warnings if any issues are found
   :type batchPredictionWarnings: str
   :param bpAcrossVersionsMonitorVersion: The version of the batch prediction across versions monitor
   :type bpAcrossVersionsMonitorVersion: str
   :param batchPredictionArgsType: The type of the batch prediction args
   :type batchPredictionArgsType: str
   :param batchInputs: Inputs to the batch prediction
   :type batchInputs: PredictionInput
   :param inputFeatureGroups: List of prediction feature groups
   :type inputFeatureGroups: PredictionFeatureGroup
   :param globalPredictionArgs:
   :type globalPredictionArgs: BatchPredictionArgs
   :param batchPredictionArgs: Argument(s) passed to every prediction call
   :type batchPredictionArgs: BatchPredictionArgs


   .. py:attribute:: batch_prediction_version
      :value: None



   .. py:attribute:: batch_prediction_id
      :value: None



   .. py:attribute:: status
      :value: None



   .. py:attribute:: drift_monitor_status
      :value: None



   .. py:attribute:: deployment_id
      :value: None



   .. py:attribute:: model_id
      :value: None



   .. py:attribute:: model_version
      :value: None



   .. py:attribute:: predictions_started_at
      :value: None



   .. py:attribute:: predictions_completed_at
      :value: None



   .. py:attribute:: database_output_error
      :value: None



   .. py:attribute:: total_predictions
      :value: None



   .. py:attribute:: failed_predictions
      :value: None



   .. py:attribute:: database_connector_id
      :value: None



   .. py:attribute:: database_output_configuration
      :value: None



   .. py:attribute:: file_connector_output_location
      :value: None



   .. py:attribute:: file_output_format
      :value: None



   .. py:attribute:: connector_type
      :value: None



   .. py:attribute:: legacy_input_location
      :value: None



   .. py:attribute:: error
      :value: None



   .. py:attribute:: drift_monitor_error
      :value: None



   .. py:attribute:: monitor_warnings
      :value: None



   .. py:attribute:: csv_input_prefix
      :value: None



   .. py:attribute:: csv_prediction_prefix
      :value: None



   .. py:attribute:: csv_explanations_prefix
      :value: None



   .. py:attribute:: database_output_total_writes
      :value: None



   .. py:attribute:: database_output_failed_writes
      :value: None



   .. py:attribute:: output_includes_metadata
      :value: None



   .. py:attribute:: result_input_columns
      :value: None



   .. py:attribute:: model_monitor_version
      :value: None



   .. py:attribute:: algo_name
      :value: None



   .. py:attribute:: algorithm
      :value: None



   .. py:attribute:: output_feature_group_id
      :value: None



   .. py:attribute:: output_feature_group_version
      :value: None



   .. py:attribute:: output_feature_group_table_name
      :value: None



   .. py:attribute:: batch_prediction_warnings
      :value: None



   .. py:attribute:: bp_across_versions_monitor_version
      :value: None



   .. py:attribute:: batch_prediction_args_type
      :value: None



   .. py:attribute:: batch_inputs


   .. py:attribute:: input_feature_groups


   .. py:attribute:: global_prediction_args


   .. py:attribute:: batch_prediction_args


   .. py:attribute:: deprecated_keys


   .. py:method:: __repr__()


   .. 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:: download_batch_prediction_result_chunk(offset = 0, chunk_size = 10485760)

      Returns a stream containing the batch prediction results.

      :param offset: The offset to read from.
      :type offset: int
      :param chunk_size: The maximum amount of data to read.
      :type chunk_size: int



   .. py:method:: get_batch_prediction_connector_errors()

      Returns a stream containing the batch prediction database connection write errors, if any writes failed for the specified batch prediction job.

      :param batch_prediction_version: Unique string identifier of the batch prediction job to get the errors for.
      :type batch_prediction_version: str



   .. py:method:: refresh()

      Calls describe and refreshes the current object's fields

      :returns: The current object
      :rtype: BatchPredictionVersion



   .. py:method:: describe()

      Describes a Batch Prediction Version.

      :param batch_prediction_version: Unique string identifier of the Batch Prediction Version.
      :type batch_prediction_version: str

      :returns: The Batch Prediction Version.
      :rtype: BatchPredictionVersion



   .. py:method:: get_logs()

      Retrieves the batch prediction logs.

      :param batch_prediction_version: The unique version ID of the batch prediction version.
      :type batch_prediction_version: str

      :returns: The logs for the specified batch prediction version.
      :rtype: BatchPredictionVersionLogs



   .. py:method:: download_result_to_file(file)

      Downloads the batch prediction version in a local file.

      :param file: A file object opened in a binary mode e.g., file=open('/tmp/output', 'wb').
      :type file: file object



   .. py:method:: wait_for_predictions(timeout=86400)

      A waiting call until batch prediction version is ready.

      :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



   .. py:method:: wait_for_drift_monitor(timeout=86400)

      A waiting call until batch prediction drift monitor calculations are ready.

      :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



   .. py:method:: get_status(drift_monitor_status = False)

      Gets the status of the batch prediction version.

      :returns: A string describing the status of the batch prediction version, for e.g., pending, complete, etc.
      :rtype: str



   .. py:method:: load_results_as_pandas()

      Loads the output feature groups into a python pandas dataframe.

      :returns: A pandas dataframe with annotations and text_snippet columns.
      :rtype: DataFrame



