Rating table

class datarobot.models.RatingTable

Interface to modify and download rating tables.

Variables:
  • id (str) – The id of the rating table.

  • project_id (str) – The id of the project this rating table belongs to.

  • rating_table_name (str) – The name of the rating table.

  • original_filename (str) – The name of the file used to create the rating table.

  • parent_model_id (str) – The model id of the model the rating table was validated against.

  • model_id (str) – The model id of the model that was created from the rating table. Can be None if a model has not been created from the rating table.

  • model_job_id (str) – The id of the job to create a model from this rating table. Can be None if a model has not been created from the rating table.

  • validation_job_id (str) – The id of the created job to validate the rating table. Can be None if the rating table has not been validated.

  • validation_error (str) – Contains a description of any errors caused during validation.

__init__(id, rating_table_name, original_filename, project_id, parent_model_id, model_id=None, model_job_id=None, validation_job_id=None, validation_error=None)
classmethod get(project_id, rating_table_id)

Retrieve a single rating table

Parameters:
  • project_id (str) – The ID of the project the rating table is associated with.

  • rating_table_id (str) – The ID of the rating table

Returns:

rating_table – The queried instance

Return type:

RatingTable

classmethod create(project_id, parent_model_id, filename, rating_table_name='Uploaded Rating Table')

Uploads and validates a new rating table CSV

Parameters:
  • project_id (str) – id of the project the rating table belongs to

  • parent_model_id (str) – id of the model for which this rating table should be validated against

  • filename (str) – The path of the CSV file containing the modified rating table.

  • rating_table_name (Optional[str]) – A human friendly name for the new rating table. The string may be truncated and a suffix may be added to maintain unique names of all rating tables.

Returns:

job – an instance of created async job

Return type:

Job

Raises:
download(filepath)

Download a csv file containing the contents of this rating table

Parameters:

filepath (str) – The path at which to save the rating table file.

Return type:

None

rename(rating_table_name)

Renames a rating table to a different name.

Parameters:

rating_table_name (str) – The new name to rename the rating table to.

Return type:

None

create_model()

Creates a new model from this rating table record. This rating table must not already be associated with a model and must be valid.

Returns:

job – an instance of created async job

Return type:

Job

Raises:
  • ClientError – Raised if creating model from a RatingTable that failed validation

  • JobAlreadyRequested – Raised if creating model from a RatingTable that is already associated with a RatingTableModel