Provides guidance for DataRobot model explainability: prediction explanations via SHAP values, feature impact analysis, and diagnostics like ROC curves and confusion matrices. For interpreting model decisions.
npx claudepluginhub datarobot-oss/datarobot-agent-skills --plugin datarobot-agent-skillsThis skill uses the workspace's default tool permissions.
This skill provides comprehensive guidance for understanding model decisions, analyzing prediction explanations, and interpreting model behavior using various explainability techniques.
Explains ML model predictions using SHAP, LIME, and feature importance to identify influential features and debug behavior.
Explains ML model predictions with SHAP values and plots (waterfall, beeswarm, bar, force, heatmap) for feature importance, debugging, bias analysis across tree-based, deep learning, linear, black-box models.
Computes SHAP values and generates plots (waterfall, beeswarm, bar, scatter, force, heatmap) to explain ML model predictions, feature importance, bias. Supports XGBoost, PyTorch, TensorFlow, black-box models.
Share bugs, ideas, or general feedback.
This skill provides comprehensive guidance for understanding model decisions, analyzing prediction explanations, and interpreting model behavior using various explainability techniques.
Most common use case: Get prediction explanations for a specific prediction
project_id + model_id (from a deployment’s champion model, or from training)dr.PredictionExplanations.create(project_id, model_id, dataset_id, ...)dr.PredictionExplanations.get(project_id, prediction_explanations_id) and iterate get_rows()Example: "Explain why the model predicted 0.85 for this customer record"
Use this skill when you need to:
User request: "Why did the model predict 0.85 probability for customer ID 12345?"
Agent workflow:
User request: "Generate ROC curve and confusion matrix for model xyz123"
Agent workflow:
This skill guides you to use the DataRobot Python SDK directly. Install the SDK if needed:
pip install datarobot
Use these DataRobot SDK methods for model explainability:
Prediction Explanations (SDK v3.10.0):
dr.PredictionExplanations.create(project_id, model_id, dataset_id, ...) - Compute prediction explanations on a datasetdr.PredictionExplanations.get(project_id, prediction_explanations_id) - Fetch explanations and read rowsprediction_explanations.get_rows() - Iterate explanation rowsModel Diagnostics:
model.get_roc_curve(source='validation') - Get ROC curve with AUCmodel.get_confusion_matrix() - Get confusion matrixmodel.get_lift_chart() - Get lift chart datamodel.get_feature_impact() - Get feature importanceFeature Analysis:
model.get_partial_dependence(feature_name) - Get partial dependence dataSee the Common Patterns section below for complete examples.
import datarobot as dr
import os
# Initialize client
client = dr.Client(
token=os.getenv("DATAROBOT_API_TOKEN"),
endpoint=os.getenv("DATAROBOT_ENDPOINT")
)
# Example: compute explanations for a dataset (batch)
project_id = "project_id_here"
model_id = "model_id_here"
dataset_id = "dataset_id_here" # dataset to explain
pe = dr.PredictionExplanations.create(
project_id=project_id,
model_id=model_id,
dataset_id=dataset_id,
max_explanations=5,
)
pe2 = dr.PredictionExplanations.get(project_id, pe.id)
for row in pe2.get_rows():
# row contains per-row explanation info
print(row)
import datarobot as dr
# Get model
model = dr.Model.get("xyz123")
# Get ROC curve
roc_curve = model.get_roc_curve(source='validation')
print(f"AUC Score: {roc_curve.auc:.3f}")
# Get confusion matrix (for classification models)
try:
cm = model.get_confusion_matrix(source='validation')
print(f"Precision: {cm.precision:.3f}")
print(f"Recall: {cm.recall:.3f}")
print(f"F1 Score: {cm.f1_score:.3f}")
except:
print("Confusion matrix not available for this model type")
# Get lift chart
lift_chart = model.get_lift_chart(source='validation')
print(f"Lift at 10%: {lift_chart.lift[10]:.3f}")
SHAP (SHapley Additive exPlanations) values explain the output of any machine learning model:
Example interpretation:
Common errors and solutions:
pip install datarobot
import datarobot as dr
import os
client = dr.Client(
token=os.getenv("DATAROBOT_API_TOKEN"),
endpoint=os.getenv("DATAROBOT_ENDPOINT", "https://app.datarobot.com")
)