Skip to content

datarobot-oss/datarobot-agent-skills / skills/datarobot-predictions

datarobot-predictions

Verified

Tools 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 explaining individual predictions from a deployment.

FileKindSize
SKILL.mdskill md14.8 KB
scripts/generate_prediction_data_template.pyexecutablescript7.6 KB
scripts/get_deployment_features.pyexecutablescript4.2 KB
scripts/make_prediction.pyexecutablescript4.8 KB
scripts/validate_prediction_data.pyexecutablescript4.6 KB

scripts/get_deployment_features.py

View on GitHub
#!/usr/bin/env python3
# Copyright (c) 2026 DataRobot, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""
Get comprehensive information about features required by a deployment.

Usage:
    python get_deployment_features.py <deployment_id>

Outputs JSON with feature information, types, importance, and time series config.
"""

import json
import sys

import datarobot as dr


def get_deployment_features(deployment_id: str) -> dict:
    """
    Get comprehensive information about features required by a deployment.

    Args:
        deployment_id: The deployment ID

    Returns:
        Dictionary with feature information, types, importance, and time series config
    """
    # Initialize client
    dr.Client()

    deployment = dr.Deployment.get(deployment_id)
    target_name = deployment.model.get(
        "target_name"
    )  # None for unsupervised/anomaly deployments
    target_type = deployment.model["target_type"]

    # Get feature information: a list of plain dicts with keys name, feature_type,
    # importance, date_format, known_in_advance. `importance` is a model-independent
    # measure of the feature/target relationship strength (not Feature Impact).
    try:
        features = deployment.get_features()
    except dr.errors.ClientError as e:
        sys.exit(f"Deployment feature metadata unavailable ({e})")

    # Build feature list
    feature_list = []
    for feature in features:
        feature_list.append(
            {
                "feature_name": feature["name"],
                "feature_type": feature["feature_type"],
                "importance": feature["importance"],
                "date_format": feature["date_format"],
                "is_target": feature["name"] == target_name,
            }
        )

    # Get time series config if applicable. deployment.model has "project_id" only
    # for deployments of leaderboard models (absent for custom-model deployments),
    # and the backing project may since have been deleted.
    time_series_config = None
    project_id = deployment.model.get("project_id")
    try:
        use_time_series = (
            bool(project_id) and dr.Project.get(project_id).use_time_series
        )
    except dr.errors.ClientError as e:
        use_time_series = False
        print(f"Note: training project not accessible: {e}", file=sys.stderr)
    if use_time_series:
        try:
            partitioning = dr.DatetimePartitioning.get(project_id)
            # Retrained-on-actuals TS projects suffix training column names with
            # " (actual)"; prediction input uses the unsuffixed names, so map back
            # when the unsuffixed name is what the deployment's features carry.
            feature_names = {f["name"] for f in features}

            def to_input_name(name: str | None) -> str | None:
                if name and name.endswith(" (actual)") and name not in feature_names:
                    stripped = name[: -len(" (actual)")]
                    if stripped in feature_names:
                        return stripped
                return name

            time_series_config = {
                "datetime_column": to_input_name(
                    partitioning.datetime_partition_column
                ),
                "forecast_window_start": partitioning.forecast_window_start,
                "forecast_window_end": partitioning.forecast_window_end,
                "series_id_columns": [
                    to_input_name(c)
                    for c in (partitioning.multiseries_id_columns or [])
                ],
            }
        except dr.errors.ClientError as e:
            print(
                f"Note: time series info unavailable: {e}",
                file=sys.stderr,
            )

    return {
        "deployment_id": deployment_id,
        "model_type": target_type,
        "target": target_name,
        "target_type": target_type,
        "features": feature_list,
        "time_series_config": time_series_config,
    }


if __name__ == "__main__":
    if len(sys.argv) < 2:
        print(
            "Usage: python get_deployment_features.py <deployment_id>", file=sys.stderr
        )
        sys.exit(1)

    deployment_id = sys.argv[1]
    result = get_deployment_features(deployment_id)
    print(json.dumps(result, indent=2))
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall