Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

superwise-drift-detection-skill

БесплатноБез исполняемых скриптовНе проверен

Detects feature drift in tabular ML models using Superwise Compare Distribution policies (Jensen-Shannon divergence for categorical string columns). Handles…

mark-stadtmuellerот mark-stadtmueller1 062 установки в других каталогах

Об этом скилле

Superwise Drift Detection Skill

When the user wants to set up drift detection for their model, guide them through the steps below in order. Complete each step before moving to the next.

What You Need From the User

Ask the user to provide the following before starting:

  1. Superwise credentials — SUPERWISE_CLIENT_ID and SUPERWISE_SECRET_TOKEN (found in their Superwise account under Settings → API Keys)
  2. Training CSV — the CSV file their model was trained on (feature columns only; a row_id column will be added automatically)
  3. Model name — a short label with no spaces (e.g. my_churn_model); used to name datasets in Superwise
  4. Inference endpoint — one of two options:
    • Option A: They already have a running model endpoint. Ask for the URL. It must return JSON shaped as {"records": [{...}, ...]} where each record contains the same columns as the training CSV.
    • Option B: They need to deploy one. Any small web service works if a GET returns {"records": [...]} built from their model's recent inputs and predictions. This package does not ship one. For local testing, bind it to 127.0.0.1 only and set INFERENCE_ENDPOINT_URL=http://localhost:5001/predict and INFERENCE_ENDPOINT_ALLOW_PRIVATE=true.

Step 1 — Install dependencies

pip install --require-hashes -r requirements.txt

Dependencies are pinned with hashes. requirements.in lists the top-level pins; regenerate with uv pip compile requirements.in --generate-hashes -o requirements.txt.

Create a .env file in the skill root directory with the following contents, filling in the values the user provided:

SUPERWISE_CLIENT_ID=<from user>
SUPERWISE_SECRET_TOKEN=<from user>
MODEL_NAME=<model name>
INFERENCE_ENDPOINT_URL=<from user's answer to question 4>
# Only for local development (allows http and localhost/private hosts):
# INFERENCE_ENDPOINT_ALLOW_PRIVATE=true
SUPERWISE_AUTO_TRIGGER=true
SUPERWISE_TRAINING_DATASET_ID=
SUPERWISE_TRAINING_DATASET_NAME=
SUPERWISE_TRAINING_CUBE_NAME=
SUPERWISE_INFERENCE_DATASET_ID=
SUPERWISE_INFERENCE_DATASET_NAME=
SUPERWISE_INFERENCE_CUBE_NAME=
SUPERWISE_DRIFT_POLICY_ID=
# Additional per-column policies — add one line per column printed by setup_drift_policy.py:
# SUPERWISE_DRIFT_POLICY_ID_<column>=<policy ID>
SCHEDULE_HOUR_UTC=6
SCHEDULE_MINUTE_UTC=0
PORT=5000

The dataset and policy ID fields will be filled in after Steps 2 and 3.

Step 2 — Create Superwise datasets and upload training data

python setup_dataset.py \
    --training-csv path/to/training.csv \
    --model-name their_model_name

This creates a training dataset and an inference dataset in Superwise, uploads the training CSV row by row, and prints the dataset IDs and cube names.

Copy the printed values into .env:

SUPERWISE_TRAINING_DATASET_ID=<printed value>
SUPERWISE_TRAINING_DATASET_NAME=<printed value>
SUPERWISE_TRAINING_CUBE_NAME=<printed value>
SUPERWISE_INFERENCE_DATASET_ID=<printed value>
SUPERWISE_INFERENCE_DATASET_NAME=<printed value>
SUPERWISE_INFERENCE_CUBE_NAME=<printed value>

Note: training CSV column names must use only letters, numbers, and underscores, and must start with a letter. Warn the user if any column names violate this.

Step 3 — Create drift policies

python setup_drift_policy.py \
    --training-csv path/to/training.csv \
    --policy-name their_model_drift

This creates one Jensen-Shannon divergence policy per categorical (string) column in the training CSV, comparing the training dataset against the inference dataset. Other columns are skipped with a warning:

  • Numeric columns: a known Superwise platform limitation (wasserstein distance for numeric columns is not yet supported).
  • Boolean columns: not monitored as-is. To include them, store them as strings ("true"/"false") in both the training CSV and the inference records, then re-run this script. Tell the user which Boolean columns were skipped so they don't assume those features are covered.

Copy the primary printed policy ID into .env:

SUPERWISE_DRIFT_POLICY_ID=<primary policy ID>
SUPERWISE_DRIFT_POLICY_ID_<column2>=<policy ID>
SUPERWISE_DRIFT_POLICY_ID_<column3>=<policy ID>
# ... one line per additional column policy printed by setup_drift_policy.py

Copy all printed policy lines (not just the first) — _check_drift() will trigger and check every SUPERWISE_DRIFT_POLICY_ID* env var automatically.

If the user wants to monitor only specific columns, add --columns col1 col2 col3.

Step 4 — Run an end-to-end drift check

python -c "
import os; os.chdir('.')
from dotenv import load_dotenv; load_dotenv()
from skill import run
result = run()
print(result)
"

This will:

  1. Fetch inference records from INFERENCE_ENDPOINT_URL
  2. Ingest them into the Superwise inference dataset
  3. Trigger all configured drift policy evaluations
  4. Poll until each evaluation completes
  5. Print and
Полный SKILL.md на ClawHub

Установить superwise-drift-detection-skill в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(pip install --require-hashes -r requirements.txt)
Bash(python setup_dataset.py:*)
Bash(python setup_drift_policy.py:*)
Bash(python -c:*)
Bash(python scheduler.py)

FAQ

Что делает скилл superwise-drift-detection-skill?

Detects feature drift in tabular ML models using Superwise Compare Distribution policies (Jensen-Shannon divergence for categorical string columns). Handles everything: Superwise dataset creation, training data upload, drift policy setup, inference ingestion, and a plain-text drift summary for OpenClaw to relay. Also covers replacing the training baseline in Superwise after the user retrains their model (the skill never trains models itself), and an optional scheduler service (scheduler.py) that runs the check daily and exposes a token-protected POST /run-check endpoint for manual runs. Use when: user says "set up drift detection", "detect model drift", "monitor my model for drift", "check if my model is drifting", or "add drift detection to my model".

Как установить скилл superwise-drift-detection-skill?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл superwise-drift-detection-skill запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить superwise-drift-detection-skill с