# Time series portable predictions with prediction intervals
URL: https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-port-pred-intervals.html

> Export time series models with prediction intervals in model package (.mlpkg) format.

# Time series portable predictions with prediction intervals

When you export a time series model for portable predictions, you can enable the computation of a model's time series prediction intervals (from 1 to 100) during model package generation when you download or register a time series model package.

> [!WARNING] Model package generation performance considerations
> The Compute prediction intervals option is off by default because the computation and inclusion of prediction intervals can significantly increase the amount of time required to generate a model package.

## Download a model package with prediction intervals

To run a DataRobot time series model in a remote prediction environment, you download a model package (.mlpkg file) from the [Leaderboard](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-port-pred-intervals.html#leaderboard-model-package-download) or the model's [deployment](https://docs.datarobot.com/en/docs/classic-ui/modeling/time/ts-port-pred-intervals.html#deployment-model-package-download). In both locations, you can now choose to Compute prediction intervals during model package generation. You can then run prediction jobs with a [portable prediction server (PPS)](https://docs.datarobot.com/en/docs/classic-ui/predictions/port-pred/pps/portable-pps.html) outside DataRobot.

### Leaderboard model package download

To download a model package with prediction intervals from a model on the Leaderboard, you can use the Predict > Deploy or Predict > Portable Predictions tab.

**Portable Predictions tab download:**
> [!NOTE] Availability information
> The ability to download a model package from the Portable Predictions tab depends on the MLOps configuration for your organization.

To download from the Predict > Portable Predictions tab, take the following steps:

Navigate to the model in the
Leaderboard
, then click
Predict > Portable Predictions
.
Click
Compute prediction intervals
, and then click
Download .mlpkg
.
The download appears in the downloads bar when complete.
Once the PPS download completes, use the provided code snippet to launch the Portable Prediction Server with the downloaded model package.

**Deploy tab download:**
> [!NOTE] Availability information
> The ability to download a model package from the Deploy tab requires the Enable MMM model package export preview feature flag.

To download from the Predict > Deploy tab, take the following steps:

Navigate to the model in the
Leaderboard
, then click
Predict > Deploy
.
Click
Compute prediction intervals
, and then click
Download .mlpkg
.
The download appears in the downloads bar when complete.


### Deployment model package download

To download a model package with prediction intervals from a deployment, ensure that your deployment supports model package downloads. The deployment must have a DataRobot build environment and an external prediction environment, which you can verify using the [Governance Lens](https://docs.datarobot.com/en/docs/classic-ui/mlops/governance/gov-lens.html) in the deployment inventory:

1. In the external deployment, clickPredictions > Portable Predictions.
2. ClickCompute prediction intervals, then clickDownload model package (.mlpkg). The download appears in the downloads bar when complete.
3. Once the PPS download completes, use the provided code snippet to launch the Portable Prediction Server with the downloaded model package.

## Register and deploy a model package with prediction intervals

You can also include prediction intervals in a model package when you register a time series model to the [Model Registry](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/registry/reg-create.html). When you deploy the resulting model package, you can access the Predictions > Prediction Intervals tab in the deployment.

1. On theLeaderboard, select the model to use for generating predictions. DataRobot recommends a model with theRecommended for DeploymentandPrepared for Deploymentbadges. Themodel preparationprocess runs feature impact, retrains the model on a reduced feature list, and trains on a higher sample size, followed by the entire sample (latest data for date/time partitioned projects). ImportantTheDeploytab behaves differently in environments without a dedicated prediction server, as described in the section onshared modeling workers.
2. ClickPredict > Deploy. If the Leaderboard model doesn't have thePrepare for Deploymentbadge, DataRobot recommends you clickPrepare for Deploymentto run themodel preparationprocess for that model. TipIf you've already added the model to the Model Registry, the registered model version appears in theModel Versionslist, and you can clickDeploynext to the model in and skip the rest of this process.
3. UnderDeploy model, clickRegister to deploy.
4. In theRegister new modeldialog box, provide the following model package information, enableInclude prediction intervalsto compute prediction intervals during the time series model package build process. Time series prediction intervals availabilityWhen you deploy a model package with prediction intervals, thePredictions > Prediction Intervalstab is available in the deployment. For deployed model packages built without computing intervals, the deployment'sPredictions > Prediction Intervalstab is hidden; however, older time series deployments without computed prediction intervals may display thePrediction Intervalstab if they were deployed prior to August 2022. Prediction intervals in DataRobot serverless prediction environmentsIn a DataRobot serverless prediction environment, to make predictions with time-series prediction intervals included,you mustinclude pre-computed prediction intervals when registering the model package. If you don't pre-compute prediction intervals, the deployment resulting from the registered model doesn't supportenabling prediction intervals.
5. ClickAdd to registry. The model opens on theModel Registry > Registered Modelstab.
6. While the registered model builds, clickDeployand thenconfigure the deployment settings.
7. ClickDeploy model.

## PPS prediction interval configuration

After you've enabled prediction intervals for a model package and loaded the model to a Portable Prediction Server, you can configure the prediction intervals percentile and exponential trend in the `.yaml` PPS configuration file or through the use of PPS environment variables. For more information on PPS configuration, see the [Portable Prediction Server](https://docs.datarobot.com/en/docs/classic-ui/predictions/port-pred/pps/portable-pps.html) documentation.

> [!NOTE] Note
> The environment variables below are only used if the YAML configuration isn't provided.

| YAML Variable / Environment Variable | Description | Type | Default |
| --- | --- | --- | --- |
| prediction_intervals_percentile / MLOPS_PREDICTION_INTERVALS_PERCENTILE | Sets the percentile to use when defining the prediction interval range. | integer | 80 |

---
