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-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:
- Superwise credentials —
SUPERWISE_CLIENT_IDandSUPERWISE_SECRET_TOKEN(found in their Superwise account under Settings → API Keys) - Training CSV — the CSV file their model was trained on (feature columns only;
a
row_idcolumn will be added automatically) - Model name — a short label with no spaces (e.g.
my_churn_model); used to name datasets in Superwise - 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 to127.0.0.1only and setINFERENCE_ENDPOINT_URL=http://localhost:5001/predictandINFERENCE_ENDPOINT_ALLOW_PRIVATE=true.
- Option A: They already have a running model endpoint. Ask for the URL.
It must return JSON shaped as
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:
- Fetch inference records from
INFERENCE_ENDPOINT_URL - Ingest them into the Superwise inference dataset
- Trigger all configured drift policy evaluations
- Poll until each evaluation completes
- Print and
Установить 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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic