# Data exports
URL: https://docs.datarobot.com/en/docs/api/reference/sdk/data-exploration.html

# Data exports

### class datarobot.models.deployment.data_exports.PredictionDataExport

A prediction data export.

Added in version v3.4.

- Variables:

#### classmethod list(deployment_id, status=None, model_id=None, batch=None, offset=0, limit=100)

Retrieve a list of prediction data exports.

- Parameters:
- Returns: prediction_data_exports – A list of PredictionDataExport objects.
- Return type: list

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import PredictionDataExport
> 
> prediction_data_exports = PredictionDataExport.list(deployment_id='5c939e08962d741e34f609f0')
> ```

#### classmethod get(deployment_id, export_id)

Retrieve a single prediction data export.

- Parameters:
- Returns: prediction_data_export – A prediction data export.
- Return type: PredictionDataExport

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import PredictionDataExport
> 
> prediction_data_export = PredictionDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fbe59aaa3f847bd5acc75b'
>     )
> ```

#### classmethod create(deployment_id, start, end, model_id=None, batch_ids=None, max_wait=600)

Create a deployment prediction data export.
Waits until ready and fetches PredictionDataExport after the export finishes. This method is blocking.

- Parameters:
- Returns: prediction_data_export – A prediction data export.
- Return type: PredictionDataExport

> [!NOTE] Examples
> ```
> from datetime import datetime, timedelta
> from datarobot.models.deployment import PredictionDataExport
> 
> now=datetime.now()
> prediction_data_export = PredictionDataExport.create(
>     deployment_id='5c939e08962d741e34f609f0', start=now - timedelta(days=7), end=now
>     )
> ```

#### fetch_data()

Return data from prediction export as datarobot Dataset.

- Returns: prediction_datasets – List of datasets for a given export, most often it is just one.
- Return type: List[Dataset]

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import PredictionDataExport
> 
> prediction_data_export = PredictionDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fbe59aaa3f847bd5acc75b'
>     )
> prediction_datasets = prediction_data_export.fetch_data()
> ```

### class datarobot.models.deployment.data_exports.ActualsDataExport

An actuals data export.

Added in version v3.4.

- Variables:

#### classmethod list(deployment_id, status=None, offset=0, limit=100)

Retrieve a list of actuals data exports.

- Parameters:
- Returns: actuals_data_exports – A list of ActualsDataExport objects.
- Return type: list

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import ActualsDataExport
> 
> actuals_data_exports = ActualsDataExport.list(deployment_id='5c939e08962d741e34f609f0')
> ```

#### classmethod get(deployment_id, export_id)

Retrieve a single actuals data export.

- Parameters:
- Returns: actuals_data_export – An actuals data export.
- Return type: ActualsDataExport

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import ActualsDataExport
> 
> actuals_data_export = ActualsDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fb0a6c9bb187781cfdea36'
>     )
> ```

#### classmethod create(deployment_id, start, end, model_id=None, only_matched_predictions=None, max_wait=600)

Create a deployment actuals data export.
Waits until ready and fetches ActualsDataExport after the export finishes. This method is blocking.

- Parameters:
- Returns: actuals_data_export – An actuals data export.
- Return type: ActualsDataExport

> [!NOTE] Examples
> ```
> from datetime import datetime, timedelta
> from datarobot.models.deployment import ActualsDataExport
> 
> now=datetime.now()
> actuals_data_export = ActualsDataExport.create(
>     deployment_id='5c939e08962d741e34f609f0', start=now - timedelta(days=7), end=now
>     )
> ```

#### fetch_data()

Return data from actuals export as datarobot Dataset.

- Returns: actuals_datasets – List of datasets for a given export, most often it is just one.
- Return type: List[Dataset]

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import ActualsDataExport
> 
> actuals_data_export = ActualsDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fb0a6c9bb187781cfdea36'
>     )
> actuals_datasets = actuals_data_export.fetch_data()
> ```

### class datarobot.models.deployment.data_exports.TrainingDataExport

A training data export.

Added in version v3.4.

- Variables:

#### classmethod list(deployment_id)

Retrieve a list of successful training data exports.

- Parameters: deployment_id ( str ) – The ID of the deployment.
- Returns: training_data_exports – A list of TrainingDataExport objects.
- Return type: list

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import TrainingDataExport
> 
> training_data_exports = TrainingDataExport.list(deployment_id='5c939e08962d741e34f609f0')
> ```

#### classmethod get(deployment_id, export_id)

Retrieve a single training data export.

- Parameters:
- Returns: training_data_export – A training data export.
- Return type: TrainingDataExport

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import TrainingDataExport
> training_data_export = TrainingDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fbf2356124f1daa3acc522'
>     )
> ```

#### classmethod create(deployment_id, model_id=None, max_wait=600)

Create a single training data export.
Waits until ready and fetches TrainingDataExport after the export finishes. This method is blocking.

- Parameters:
- Return type: str
- Returns:

#### fetch_data()

Return data from training data export as datarobot Dataset.

- Returns: training_dataset – A datasets for a given export.
- Return type: Dataset

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import TrainingDataExport
> 
> training_data_export = TrainingDataExport.get(
>     deployment_id='5c939e08962d741e34f609f0', export_id='65fbf2356124f1daa3acc522'
>     )
> training_data_export = training_data_export.fetch_data()
> ```

### class datarobot.models.deployment.data_exports.DataQualityExport

A data quality export record.

Added in version v3.6.

- Variables:

#### classmethod list(deployment_id, start, end, model_id=None, prediction_pattern=None, prompt_pattern=None, actual_pattern=None, order_by=None, order_metric=None, filter_metric=None, filter_value=None, offset=0, limit=100)

Retrieve a list of data-quality export records for a given deployment.

Added in version v3.6.

- Parameters:
- Returns: data_quality_exports – A list of DataQualityExport objects.
- Return type: list

> [!NOTE] Examples
> ```
> from datarobot.models.deployment import DataQualityExport
> 
> data_quality_exports = DataQualityExport.list(
>     deployment_id='5c939e08962d741e34f609f0', start_time='2024-07-01', end_time='2024-08-01
> )
> ```

---
