$npx -y skills add datarobot-oss/datarobot-agent-skills --skill datarobot-predictionsTools and guidance for making predictions with DataRobot deployments, including real-time predictions, batch scoring, prediction dataset generation, and prediction explanations (SHAP/XEMP). Use when making predictions, running batch scoring, generating prediction datasets, or exp
| 1 | # DataRobot Predictions Skill |
| 2 | |
| 3 | This skill provides comprehensive guidance for working with DataRobot predictions, including real-time predictions, batch scoring, and generating prediction datasets. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | **Most common use case**: Generate predictions for a deployment |
| 8 | |
| 9 | 1. **Get deployment features**: `get_deployment_features(deployment_id)` to understand required columns |
| 10 | 2. **Generate template**: `generate_prediction_data_template(deployment_id, n_rows)` to create CSV structure |
| 11 | 3. **Make predictions**: Use `deployment.predict_batch(...)` (works for both single-row “real-time” and batch scoring) |
| 12 | |
| 13 | **Example**: "Generate a prediction dataset template for deployment abc123 with 10 rows" |
| 14 | |
| 15 | **To also explain predictions**: pass `--max-explanations N` to `make_prediction.py` (or the |
| 16 | `max_explanations=N` kwarg in code). See [Prediction Explanations](#prediction-explanations) below. |
| 17 | |
| 18 | ## When to use this skill |
| 19 | |
| 20 | Use this skill when you need to: |
| 21 | - Make predictions from deployed DataRobot models |
| 22 | - Explain individual predictions from a deployment (SHAP or XEMP, per-row) |
| 23 | - Generate prediction dataset templates |
| 24 | - Validate prediction data before scoring |
| 25 | - Understand deployment feature requirements |
| 26 | - Perform batch predictions on large datasets |
| 27 | - Get sample training data to understand expected formats |
| 28 | |
| 29 | > For post-hoc explanations against a **training project / leaderboard model** (not a deployment), |
| 30 | > use the `datarobot-model-explainability` skill instead. This skill covers deployment-time |
| 31 | > explanations returned alongside scoring. |
| 32 | |
| 33 | ## Key capabilities |
| 34 | |
| 35 | ### 1. Understanding Deployment Requirements |
| 36 | |
| 37 | Before making predictions, you need to understand what features a deployment requires: |
| 38 | |
| 39 | - **Feature names and types**: Know which columns are needed (numeric, categorical, text, date) |
| 40 | - **Feature importance**: Understand which features matter most |
| 41 | - **Target information**: Know what you're predicting |
| 42 | - **Time series configuration**: If applicable, understand datetime columns and series IDs |
| 43 | |
| 44 | ### 2. Generating Prediction Datasets |
| 45 | |
| 46 | Create properly formatted prediction datasets: |
| 47 | |
| 48 | - Generate CSV templates with all required columns |
| 49 | - Include sample values appropriate for each feature type |
| 50 | - Add metadata comments explaining the model structure |
| 51 | - Ensure correct column ordering |
| 52 | |
| 53 | ### 3. Validating Prediction Data |
| 54 | |
| 55 | Validate datasets before making predictions: |
| 56 | |
| 57 | - Check for missing required features |
| 58 | - Verify data types match expected types |
| 59 | - Identify missing low-importance features (warnings) |
| 60 | - Note extra columns that will be ignored |
| 61 | |
| 62 | ### 4. Making Predictions |
| 63 | |
| 64 | Execute predictions using various methods: |
| 65 | |
| 66 | - **Real-time predictions**: Fast, synchronous predictions for individual records |
| 67 | - **Batch predictions**: Process large datasets efficiently |
| 68 | - **Time series predictions**: Handle forecasting scenarios with proper datetime handling |
| 69 | |
| 70 | ## Workflow examples |
| 71 | |
| 72 | ### Example 1: Generate prediction dataset for a new scenario |
| 73 | |
| 74 | **User request**: "I want to predict sales for next week for store_A with temperatures of 75°F each day and no promotions." |
| 75 | |
| 76 | **Agent workflow**: |
| 77 | 1. Get deployment features to understand required columns |
| 78 | 2. Generate a prediction data template with 7 rows (one week) |
| 79 | 3. Fill in the template with user's specific values: |
| 80 | - Set temperature = 75 for all rows |
| 81 | - Set promotion = 0 for all rows |
| 82 | - Set store_id = "store_A" for all rows |
| 83 | - Set dates for next 7 days |
| 84 | 4. Validate the data to ensure it's correct |
| 85 | 5. Make predictions using the validated dataset |
| 86 | |
| 87 | ### Example 2: Batch scoring a CSV file |
| 88 | |
| 89 | **User request**: "Score all records in my prediction_data.csv file using deployment abc123." |
| 90 | |
| 91 | **Agent workflow**: |
| 92 | 1. Validate the CSV file structure matches deployment requirements |
| 93 | 2. Upload the file or provide file path |
| 94 | 3. Submit batch prediction job |
| 95 | 4. Monitor job status |
| 96 | 5. Retrieve and return prediction results |
| 97 | |
| 98 | ## Using DataRobot SDK |
| 99 | |
| 100 | This skill guides you to use the DataRobot Python SDK directly. Install the SDK if needed: |
| 101 | |
| 102 | ```bash |
| 103 | pip install datarobot |
| 104 | ``` |
| 105 | |
| 106 | ### Key SDK Operations |
| 107 | |
| 108 | Use these DataRobot SDK methods to work with predictions: |
| 109 | |
| 110 | **Deployment Information**: |
| 111 | - `dr.Deployment.get(deployment_id)` - Get deployment details |
| 112 | - `deployment.get_features()` - Get required features (name/type/importance) |
| 113 | |
| 114 | **Predictions**: |
| 115 | - `deployment.predict_batch(source)` - Convenience batch prediction API (CSV path, file object, or pandas DataFrame) |
| 116 | - `dr.BatchPredictionJob.score(deployment=deployment, ...)` - Advanced batch prediction control |
| 117 | - `job.get_result_when_complete()` - Wait for batch scoring to finish and download results |
| 118 | |
| 119 | **Data Management**: |
| 120 | - `dr.Dataset.c |