Rating Table

class datarobot.models.RatingTable(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)

Interface to modify and download rating tables.

Attributes:
idstr

The id of the rating table.

project_idstr

The id of the project this rating table belongs to.

rating_table_namestr

The name of the rating table.

original_filenamestr

The name of the file used to create the rating table.

parent_model_idstr

The model id of the model the rating table was validated against.

model_idstr

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_idstr

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_idstr

The id of the created job to validate the rating table. Can be None if the rating table has not been validated.

validation_errorstr

Contains a description of any errors caused during validation.

classmethod get(project_id, rating_table_id)

Retrieve a single rating table

Parameters:
project_idstr

The ID of the project the rating table is associated with.

rating_table_idstr

The ID of the rating table

Returns:
rating_tableRatingTable

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_idstr

id of the project the rating table belongs to

parent_model_idstr

id of the model for which this rating table should be validated against

filenamestr

The path of the CSV file containing the modified rating table.

rating_table_namestr, optional

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: Job

an instance of created async job

Raises:
InputNotUnderstoodError

Raised if filename isn’t one of supported types.

ClientError (400)

Raised if parent_model_id is invalid.

Return type:

Job

download(filepath)

Download a csv file containing the contents of this rating table

Parameters:
filepathstr

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_namestr

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: Job

an instance of created async job

Raises:
ClientError (422)

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

Return type:

Job