MCP HubMCP Hub
스킬 목록으로 돌아가기

setup-automl-pipeline

pjt222
업데이트됨 2 days ago
17
2
17
GitHub에서 보기
기타aidata

정보

이 스킬은 Optuna나 Ray Tune을 활용하여 Hyperband/ASHA 같은 효율적인 탐색 알고리즘으로 하이퍼파라미터 튜닝과 모델 선택을 자동화합니다. 새로운 ML 프로젝트를 시작하거나 새 데이터로 재학습할 때 최적 구성을 신속하게 찾도록 설계되었습니다. 알고리즘을 효율적으로 비교하거나, 팀에 하이퍼파라미터에 대한 심도 있는 전문성이 부족한 경우에 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/setup-automl-pipeline

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Setup AutoML Pipeline

See Extended Examples for complete config + templates.

Automate hyperparam tune + model selection → Optuna|Ray Tune w/ efficient search.

Use When

  • New ML project → find good configs fast
  • Retrain w/ new data → re-opt hyperparams
  • Compare algos + their optimal configs
  • Limited tune time but need near-optimal
  • Team lacks deep hyperparam expertise
  • Need reproducible documented opt

In

  • Required: Train data (features + labels)
  • Required: Val data → objective eval
  • Required: Model type(s) (XGBoost, LightGBM, NN)
  • Required: Opt objective (max|min metric)
  • Required: Compute budget (time|trial count)
  • Optional: Search space constraints (min|max)
  • Optional: Prior knowledge of good ranges

Do

Step 1: Install Deps + Env

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Option 1: Optuna (simpler, good for single-machine)
pip install optuna optuna-dashboard
pip install scikit-learn xgboost lightgbm

# Option 2: Ray Tune (distributed, good for multi-machine/GPU)
pip install "ray[tune]" optuna hyperopt bayesian-optimization
pip install torch torchvision  # if optimizing neural networks

# Visualization and tracking
pip install mlflow tensorboard plotly

Project structure:

mkdir -p automl/{configs,experiments,models,results}

→ Clean env w/ pkgs installed, no conflicts.

If err: Py 3.8-3.11 (compat issues 3.12+); CUDA errs → install CPU-only first; M1|M2 → conda not pip for sklearn.

Step 2: Search Space + Objective (Optuna)

# automl/optuna_config.py
import optuna
from optuna.pruners import HyperbandPruner
from optuna.samplers import TPESampler
import xgboost as xgb
from sklearn.metrics import roc_auc_score, mean_squared_error
import numpy as np

# ... (see EXAMPLES.md for complete implementation)

→ Search space covers reasonable ranges, objective runs w/o errs, pruning stops unpromising early.

If err: trials crash → ↓search space (lower max n_estimators); verify no NaN|inf; check mem (↓batch if OOM); eval_metric matches task.

Step 3: Run Opt w/ Advanced Samplers

# automl/run_optimization.py
import optuna
from optuna.samplers import TPESampler, CmaEsSampler, NSGAIISampler
from optuna.pruners import HyperbandPruner, MedianPruner, SuccessiveHalvingPruner
import joblib
import pandas as pd
from pathlib import Path

# ... (see EXAMPLES.md for complete implementation)

→ Opt completes w/ 50-70% trials pruned, best params found, viz plots show convergence.

If err: no pruning → verify objective reports intermediate vals; no improvement → try diff sampler (TPE→CmaES); n_jobs>1 crashes → n_jobs=1 for debug.

Step 4: Ray Tune Distributed (Alternative)

Multi-GPU|node opt.

# automl/ray_tune_config.py
from ray import tune
from ray.tune.schedulers import ASHAScheduler, PopulationBasedTraining
from ray.tune.search.optuna import OptunaSearch
from ray.tune.search import ConcurrencyLimiter
import xgboost as xgb
from sklearn.metrics import roc_auc_score
import os
# ... (see EXAMPLES.md for complete implementation)

→ Trials parallel CPUs|GPUs, ASHA stops bad early, best config logged.

If err: Ray crashes → start ray.init(num_cpus=2, num_gpus=0) for debug; ↓concurrent if OOM; train fn doesn't modify shared data; use tune.report() not return.

Step 5: Track w/ MLflow

# automl/mlflow_tracking.py
import mlflow
import mlflow.xgboost
from mlflow.tracking import MlflowClient
import optuna
from pathlib import Path


# ... (see EXAMPLES.md for complete implementation)

→ All trials logged w/ params+metrics, best registered, viewable in MLflow UI.

If err: start mlflow ui --backend-store-uri file:./automl/mlruns; check write perms mlruns; reg fails → verify registry config; artifact <2GB.

Step 6: Deploy Best + Monitor

# automl/deploy_model.py
import joblib
import json
from pathlib import Path
import optuna
import xgboost as xgb


# ... (see EXAMPLES.md for complete implementation)

→ Model saved prod-ready, config documented, inference script ready.

If err: file >100MB → compress|feature select; verify loads in fresh Py session; test inference w/ sample pre-deploy.

Check

  • Optuna|Ray Tune installs no conflicts
  • Search space reasonable
  • Objective runs single trial OK
  • Opt completes 50+ trials in budget
  • Pruning stops 40-70% unpromising
  • Best params improve >5% over default
  • Viz shows convergence (history flattens)
  • MLflow logs all w/ params+metrics
  • Final model saves+loads
  • Deploy pkg has all needed files

Traps

  • Overfit to val: 1000s trials implicitly optimizes for val; use holdout test|time-split for final eval
  • Ignore feature eng: AutoML finds best hyperparams but doesn't create features; invest in eng first
  • Search space too wide: Unbounded|wide ranges waste trials on unrealistic; use domain knowledge
  • No early stopping: Training full epochs every trial wasteful; enable in objective
  • Ignore compute cost: 100 trials × 10 min = 16h; consider budget when setting n_trials
  • Categoricals not encoded: Most algos need numeric; encode pre-opt
  • Imbalanced data: Default metrics mislead; use F1, AUC, custom
  • No save intermediate: Crashes lose all; persistent storage (Optuna SQLite, MLflow) to resume

  • track-ml-experiments — MLflow tracking + versioning
  • orchestrate-ml-pipeline — Airflow|Kubeflow for prod AutoML

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/setup-automl-pipeline
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

llamaguard

기타

LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.

스킬 보기

cost-optimization

기타

이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.

스킬 보기

quantizing-models-bitsandbytes

기타

이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.

스킬 보기

dispatching-parallel-agents

기타

이 Claude Skill은 3개 이상의 독립적인 문제를 동시에 조사하고 해결하기 위해 다중 에이전트를 배치합니다. 공유 상태나 의존성 없이 해결 가능한 무관련 장애 시나리오에 맞게 설계되었습니다. 핵심 기능은 병렬 문제 해결로, 각 독립 문제 영역마다 하나의 에이전트를 할당하여 효율성을 극대화합니다.

스킬 보기