ml-classical-ml
Use when the user asks to train a gradient boosting model on tabular data, XGBoost, LightGBM, CatBoost, scikit-learn pipelines, random forest, SVM…
от j4flmao★ 47 звёзд на GitHub
Установить ml-classical-ml в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
ML Classical ML
Purpose
Build supervised and unsupervised machine learning pipelines with scikit-learn, XGBoost, LightGBM, and CatBoost. Select models by problem type, tune hyperparameters systematically, validate with appropriate cross-validation, and handle class imbalance.
Agent Protocol
Trigger
Exact user phrases: "scikit-learn", "XGBoost", "LightGBM", "CatBoost", "regression", "classification", "clustering", "ensemble", "random forest", "gradient boosting", "SVM", "PCA", "feature importance", "cross-validation", "imbalanced data", "SMOTE", "hyperparameter tuning".
Input Context
Before activating, verify:
- Problem type (regression, binary classification, multiclass, clustering)
- Dataset size (rows, features, sparsity)
- Target distribution (balanced, imbalanced ratio)
- Feature types (numeric, categorical, text, datetime)
- Performance requirements (latency, throughput, memory)
- Interpretability needs (must explain predictions vs black-box OK)
- Existing baseline or prior experiments
Output Artifact
ML pipeline with model selection, hyperparameter configuration, cross-validation strategy, and training code as Python.
Response Format
# Pipeline definition (preprocessing + model)
# Training and validation code
# Hyperparameter search configuration
# Model hyperparameters
# Cross-validation config
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- Problem type identified and metric selected (RMSE, AUC, F1, NDCG)
- Model selected with rationale (linear, tree-based, ensemble)
- Scikit-learn Pipeline with ColumnTransformer for preprocessing
- Cross-validation strategy chosen (K-Fold, Stratified, Group, TimeSeries)
- Hyperparameter search configured (GridSearch, RandomizedSearch, Optuna)
- Imbalanced data handling applied if needed (SMOTE, class_weight, sampling)
- Feature importance analysis completed
- Final model evaluated on held-out test set
Max Response Length
300 lines of code and configuration.
Workflow
Step 1: Problem Type and Metric Selection
Regression: MSE/RMSE, MAE, R-squared, MAPE. Binary classification: AUC-ROC, F1, log loss, precision@k, recall. Multiclass: macro/micro/weighted F1. Ranking: NDCG, MAP.
from sklearn.metrics import (
mean_squared_error, mean_absolute_error, r2_score,
roc_auc_score, f1_score, log_loss,
precision_recall_curve, average_precision_score,
classification_report
)
Step 2: Model Selection
Linear: LogisticRegression, LinearRegression, Ridge — interpretable, fast. Tree: DecisionTree, RandomForest — non-linear, robust. Gradient Boosting: XGBoost (fast, defaults), LightGBM (fastest, large data), CatBoost (categorical native). SVM: high-dimensional spaces.
# Model selection guide
regression:
linear: LinearRegression, Ridge, Lasso, ElasticNet
tree: RandomForestRegressor, GradientBoostingRegressor
boosting: XGBRegressor, LGBMRegressor, CatBoostRegressor
classification:
linear: LogisticRegression, LinearSVC
tree: RandomForestClassifier, ExtraTreesClassifier
boosting: XGBClassifier, LGBMClassifier, CatBoostClassifier
svm: SVC, NuSVC
Step 3: Preprocessing Pipeline
scikit-learn Pipeline chains transforms. ColumnTransformer applies different transforms by column type. Numeric: StandardScaler, MinMaxScaler, RobustScaler, PowerTransformer. Categorical: OneHotEncoder, OrdinalEncoder. Missing: SimpleImputer, KNNImputer.
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler, OneHotEncoder, OrdinalEncoder
from sklearn.impute import SimpleImputer
from sklearn.ensemble import RandomForestClassifier
numeric_features = ["age", "income", "score"]
categorical_features = ["region", "tier"]
ordinal_features = ["education"]
preprocessor = ColumnTransformer(transformers=[
("num", Pipeline([
("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
]), numeric_features),
("cat", Pipeline([
("imputer", SimpleImputer(strategy="constant", fill_value="MISSING")),
("encoder", OneHotEncoder(handle_unknown="ignore", sparse_output=False)),
]), categorical_features),
("ord", Pipeline([
("encoder", OrdinalEncoder(categories="HS", "BS", "MS", "PhD")),
]), ordinal_features),
])
pipeline = Pipeline([
("preprocessor", preprocessor),
("classifier", RandomForestClassifier(n_estimators=200, random_state=42)),
])
Step 4: Cross-Validation
K-Fold: default for i.i.d. data. StratifiedKFold: classification with imbalanced classes. GroupKFold: no leakage across groups. TimeSeriesSplit: temporal data. Repeated K-Fold: lower variance estimate.
from sklearn.model_selection import (
KFold, StratifiedKFold, GroupKFold,
TimeSeriesSplit, Repeat
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/classical-ml-advanced.md
- references/classical-ml-feature-engineering.md
- references/classical-ml-fundamentals.md
- references/classical-ml-model-selection.md
- references/imbalanced-learn.md
- references/interpretable-ml.md
- references/supervised-learning.md
- references/unsupervised-pipeline.md
FAQ
Что делает скилл ml-classical-ml?
Use when the user asks to train a gradient boosting model on tabular data, XGBoost, LightGBM, CatBoost, scikit-learn pipelines, random forest, SVM, clustering, PCA or cross-validation. Produces a leakage-safe sklearn pipeline, model choice and tuning starting points. Not for neural networks (use ml-deep-learning) or search frameworks (use ml-hyperparameter-tuning).
Как установить скилл ml-classical-ml?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ml-classical-ml запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate 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…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…