$npx -y skills add datarobot-oss/datarobot-agent-skills --skill datarobot-feature-engineeringGuidance for feature engineering, feature discovery, feature importance analysis, and understanding DataRobot's automated feature engineering capabilities. Use when working with feature engineering, feature discovery, or analyzing feature importance in DataRobot.
| 1 | # DataRobot Feature Engineering Skill |
| 2 | |
| 3 | This skill provides guidance for working with features in DataRobot, including understanding automated feature engineering, analyzing feature importance, and optimizing feature sets. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | **Most common use case**: Analyze feature importance for a model |
| 8 | |
| 9 | 1. **Get feature importance**: `get_feature_importance(model_id)` to get importance scores |
| 10 | 2. **Analyze top features**: Sort by importance and identify key drivers |
| 11 | 3. **Export feature list**: `export_feature_list(project_id)` to document features |
| 12 | |
| 13 | **Example**: "Show me the top 10 most important features for model xyz123" |
| 14 | |
| 15 | ## When to use this skill |
| 16 | |
| 17 | Use this skill when you need to: |
| 18 | - Understand what features DataRobot creates automatically |
| 19 | - Analyze feature importance for models |
| 20 | - Discover which features drive predictions |
| 21 | - Optimize feature sets for better performance |
| 22 | - Understand feature types and transformations |
| 23 | - Export feature lists and definitions |
| 24 | |
| 25 | ## Key capabilities |
| 26 | |
| 27 | ### 1. Feature Discovery |
| 28 | |
| 29 | - Understand automated feature engineering in DataRobot |
| 30 | - Review derived features and transformations |
| 31 | - Identify feature types (numeric, categorical, text, date) |
| 32 | - Explore feature relationships and interactions |
| 33 | |
| 34 | ### 2. Feature Importance Analysis |
| 35 | |
| 36 | - Get feature importance scores for models |
| 37 | - Understand which features drive predictions |
| 38 | - Compare feature importance across models |
| 39 | - Identify redundant or low-value features |
| 40 | |
| 41 | ### 3. Feature Optimization |
| 42 | |
| 43 | - Select important features for model performance |
| 44 | - Remove low-importance features to reduce complexity |
| 45 | - Understand feature impact on predictions |
| 46 | - Optimize feature sets for deployment |
| 47 | |
| 48 | ### 4. Feature Documentation |
| 49 | |
| 50 | - Export feature lists and definitions |
| 51 | - Document feature transformations |
| 52 | - Understand feature derivation logic |
| 53 | - Share feature information with stakeholders |
| 54 | |
| 55 | ## Workflow examples |
| 56 | |
| 57 | ### Example 1: Analyze feature importance |
| 58 | |
| 59 | **User request**: "Show me the top 10 most important features for model xyz123 and explain what they mean." |
| 60 | |
| 61 | **Agent workflow**: |
| 62 | 1. Get feature importance scores for the model |
| 63 | 2. Sort features by importance (descending) |
| 64 | 3. Get top 10 features with their scores |
| 65 | 4. Retrieve feature metadata and descriptions |
| 66 | 5. Explain what each feature represents and why it's important |
| 67 | 6. Provide insights on feature relationships |
| 68 | |
| 69 | ### Example 2: Optimize feature set for deployment |
| 70 | |
| 71 | **User request**: "Create a simplified feature set for deployment abc123, keeping only features with importance > 0.1." |
| 72 | |
| 73 | **Agent workflow**: |
| 74 | 1. Get feature importance for the deployed model |
| 75 | 2. Filter features by importance threshold (> 0.1) |
| 76 | 3. Verify filtered features are sufficient for predictions |
| 77 | 4. Document the optimized feature set |
| 78 | 5. Update deployment configuration if needed |
| 79 | |
| 80 | ## Using DataRobot SDK |
| 81 | |
| 82 | This skill guides you to use the DataRobot Python SDK directly. Install the SDK if needed: |
| 83 | |
| 84 | ```bash |
| 85 | pip install datarobot |
| 86 | ``` |
| 87 | |
| 88 | ### Key SDK Operations |
| 89 | |
| 90 | Use these DataRobot SDK methods for feature analysis: |
| 91 | |
| 92 | **Feature Information**: |
| 93 | - `model.get_features()` - List all features in a model |
| 94 | - `model.get_feature_impact()` - Get feature importance scores |
| 95 | - `project.get_features()` - List features in a project |
| 96 | |
| 97 | **Feature Analysis**: |
| 98 | - `feature.name` - Feature name |
| 99 | - `feature.feature_type` - Feature type (Numeric, Categorical, etc.) |
| 100 | - `feature.importance` - Feature importance score |
| 101 | |
| 102 | See the [Common Patterns](#common-patterns) section below for complete examples. |
| 103 | |
| 104 | ## Best practices |
| 105 | |
| 106 | 1. **Review automated features**: DataRobot creates many derived features automatically - review them |
| 107 | 2. **Focus on important features**: Pay attention to high-importance features for insights |
| 108 | 3. **Understand feature types**: Different feature types require different handling |
| 109 | 4. **Feature documentation**: Document important features for stakeholders |
| 110 | 5. **Feature selection**: Consider removing very low-importance features for simplicity |
| 111 | 6. **Feature stability**: Consider feature stability over time, not just importance |
| 112 | |
| 113 | ## Common patterns |
| 114 | |
| 115 | ### Pattern 1: Feature importance analysis |
| 116 | ```python |
| 117 | import datarobot as dr |
| 118 | import os |
| 119 | |
| 120 | # Initialize client |
| 121 | client = dr.Client( |
| 122 | token=os.getenv("DATAROBOT_API_TOKEN"), |
| 123 | endpoint=os.getenv("DATAROBOT_ENDPOINT") |
| 124 | ) |
| 125 | |
| 126 | # Get model and feature importance |
| 127 | model = dr.Model.get("xyz123") |
| 128 | feature_impact = model.get_feature_impact() |
| 129 | |
| 130 | # Sort by importance |
| 131 | sorted_features = sorted( |
| 132 | feature_impact, |
| 133 | key=lambda x: x.get('impactNormalized', 0), |
| 134 | reverse=True |
| 135 | ) |
| 136 | |
| 137 | # Get top 10 features |
| 138 | top_features = sorted_features[:10] |
| 139 | for feature in top_features: |
| 140 | print(f"{feature['featureName']}: {feature.get('impactNormalized', 0):.3f}") |
| 141 | ``` |
| 142 | |
| 143 | ### Pattern 2: Feature filteri |