Prediction Environment
- class datarobot.models.PredictionEnvironment(id, name, platform, description=None, permissions=None, is_deleted=None, supported_model_formats=None, import_meta=None, management_meta=None, health=None, is_managed_by_management_agent=None, plugin=None, datastore_id=None, credential_id=None)
A prediction environment entity.
Added in version v3.3.0.
- Attributes:
- id: str
The ID of the prediction environment.
- name: str
The name of the prediction environment.
- description: str, optional
The description of the prediction environment.
- platform: str, optional
Indicates which platform is in use (AWS, GCP, DataRobot, etc.).
- permissions: list, optional
A set of permissions for the prediction environment.
- is_deleted: boolean, optional
The flag that shows if this prediction environment deleted.
- supported_model_formats: list[PredictionEnvironmentModelFormats], optional
The list of supported model formats.
- is_managed_by_management_agentboolean, optional
Determines if the prediction environment should be managed by the management agent. False by default.
- datastore_idstr, optional
The ID of the data store connection configuration. Only applicable for external prediction environments managed by DataRobot.
- credential_idstr, optional
The ID of the credential associated with the data connection. Only applicable for external prediction environments managed by DataRobot.
- classmethod list()
Returns list of available external prediction environments.
- Returns:
- prediction_environmentslist of PredictionEnvironment instances
contains a list of available prediction environments.
- Return type:
List
[PredictionEnvironment
]
Examples
>>> import datarobot as dr >>> prediction_environments = dr.PredictionEnvironment.list() >>> prediction_environments [ PredictionEnvironment('5e429d6ecf8a5f36c5693e03', 'demo_pe', 'aws', 'env for demo testing'), PredictionEnvironment('5e42cc4dcf8a5f3256865840', 'azure_pe', 'azure', 'env for azure demo testing'), ]
- classmethod get(pe_id)
Gets the PredictionEnvironment by id.
- Parameters:
- pe_idstr
the identifier of the PredictionEnvironment.
- Returns:
- prediction_environmentPredictionEnvironment
the requested prediction environment object.
- Return type:
Examples
>>> import datarobot as dr >>> pe = dr.PredictionEnvironment.get('5a8ac9ab07a57a1231be501f') >>> pe PredictionEnvironment('5a8ac9ab07a57a1231be501f', 'my_predict_env', 'aws', 'demo env'),
- delete()
Deletes the prediction environment.
- Return type:
None
Examples
>>> import datarobot as dr >>> pe = dr.PredictionEnvironment.get('5a8ac9ab07a57a1231be501f') >>> pe.delete()
- classmethod create(name, platform, description=None, plugin=None, supported_model_formats=None, is_managed_by_management_agent=False, datastore=None, credential=None)
Create a prediction environment.
- Parameters:
- namestr
The name of the prediction environment.
- descriptionstr, optional
The description of the prediction environment.
- platformstr
Indicates which platform is in use (AWS, GCP, DataRobot, etc.).
- pluginstr
Optional. The plugin name to use.
- supported_model_formatslist[PredictionEnvironmentModelFormats], optional
The list of supported model formats. When not provided, the default value is inferred based on platform, (DataRobot platform: DataRobot, Custom Models; All other platforms: DataRobot, Custom Models, External Models).
- is_managed_by_management_agentboolean, optional
Determines if this prediction environment should be managed by the management agent. default: False
- datastoreDataStore|str, optional]
The datastore object or ID of the data store connection configuration. Only applicable for external Prediction Environments managed by DataRobot.
- credentialCredential|str, optional]
The credential object or ID of the credential associated with the data connection. Only applicable for external Prediction Environments managed by DataRobot.
- Returns:
- prediction_environmentPredictionEnvironment
the prediction environment was created
- Raises:
- datarobot.errors.ClientError
If the server responded with 4xx status.
- datarobot.errors.ServerError
If the server responded with 5xx status.
- Return type:
Examples
>>> import datarobot as dr >>> pe = dr.PredictionEnvironment.create( ... name='my_predict_env', ... platform=PredictionEnvironmentPlatform.AWS, ... description='demo prediction env', ... ) >>> pe PredictionEnvironment('5e429d6ecf8a5f36c5693e99', 'my_predict_env', 'aws', 'demo prediction env'),