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

setup-automl-pipeline

pjt222
업데이트됨 Yesterday
1 조회
17
2
17
GitHub에서 보기
디자인aiautomationdesigndata

정보

이 스킬은 Optuna나 Ray Tune을 사용하여 하이퍼파라미터 최적화를 자동화하며, Hyperband와 ASHA 같은 조기 종료 전략을 구현합니다. 개발자가 프로젝트를 시작하거나 모델을 재학습할 때, 혹은 알고리즘을 비교할 때 최소한의 수동 조정으로 최적의 모델 구성을 빠르게 찾을 수 있도록 돕습니다. 검색 공간을 효율적으로 정의하고 튜닝 과정을 자동화하는 데 사용하세요.

빠른 설치

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 configuration files and templates.

Automate hyperparameter tuning and model selection using Optuna or Ray Tune with efficient search strategies.

Cuándo Usar

  • Starting new ML project and need to quickly find good model configurations
  • Retraining existing model with new data and want to re-optimize hyperparameters
  • Comparing multiple algorithms and their optimal configurations
  • Limited time for manual tuning but need near-optimal performance
  • Team lacks deep expertise in specific algorithm hyperparameters
  • Need reproducible and documented optimization process

Entradas

  • Requerido: Training dataset with features and labels
  • Requerido: Validation dataset for objective evaluation
  • Requerido: Model type(s) to optimize (e.g., XGBoost, LightGBM, neural network)
  • Requerido: Optimization objective (metric to maximize/minimize)
  • Requerido: Compute budget (time or number of trials)
  • Opcional: Search space constraints (min/max values for hyperparameters)
  • Opcional: Prior knowledge of good hyperparameter ranges

Procedimiento

Paso 1: Install Dependencies and Set Up Environment

Install Optuna or Ray Tune with appropriate backends.

# 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

Create project structure:

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

Esperado: Clean environment with required packages installed, no dependency conflicts.

En caso de fallo: Use Python 3.8-3.11 (compatibility issues with 3.12+), if CUDA errors occur install CPU-only versions first, on M1/M2 Mac use conda instead of pip for scikit-learn.

Paso 2: Define Search Space and Objective (Optuna)

Create configuration for hyperparameter search.

# 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)

Esperado: Search space covers reasonable hyperparameter ranges, objective function runs without errors, pruning stops unpromising trials early.

En caso de fallo: If trials crash, reduce search space (e.g., lower max n_estimators), verify data has no NaN/inf values, check memory usage (reduce batch size if OOM), ensure eval_metric matches task type.

Paso 3: Run Optimization with Advanced Samplers

Execute hyperparameter search with efficient sampling strategies.

# 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)

Esperado: Optimization completes with 50-70% of trials pruned early, best parameters found, visualization plots generated showing convergence.

En caso de fallo: If no pruning happens, verify objective reports intermediate values correctly, if optimization doesn't improve try different sampler (TPE → CmaES), if crashes with n_jobs>1 use n_jobs=1 for debugging.

Paso 4: Set Up Ray Tune for Distributed Optimization (Alternative)

Use Ray Tune for multi-GPU or multi-node optimization.

# 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)

Esperado: Ray Tune runs trials in parallel across CPUs/GPUs, ASHA scheduler stops bad trials early, best configuration found and logged.

En caso de fallo: If Ray crashes, start with ray.init(num_cpus=2, num_gpus=0) for debugging, reduce concurrent trials if OOM, check that train function doesn't modify shared data, use tune.report() not return for metrics.

Paso 5: Track Experiments with MLflow

Integrate with MLflow for experiment tracking and model registry.

# 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)

Esperado: All trials logged to MLflow with parameters and metrics, best model registered in MLflow registry, experiments viewable in MLflow UI.

En caso de fallo: Start MLflow UI with mlflow ui --backend-store-uri file:./automl/mlruns, check write permissions to mlruns directory, if registration fails verify model registry is configured, ensure model artifact size < 2GB.

Paso 6: Deploy Best Model and Monitor Performance

Save optimized model and set up monitoring.

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


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

Esperado: Model saved in production-ready format, configuration documented, inference script created for deployment.

En caso de fallo: If model file too large (>100MB), consider model compression or feature selection, verify model loads correctly in fresh Python session, test inference script with sample data before deployment.

Validación

  • Optuna/Ray Tune installs without dependency conflicts
  • Search space includes reasonable hyperparameter ranges
  • Objective function runs successfully for single trial
  • Optimization completes 50+ trials within time budget
  • Pruning stops 40-70% of unpromising trials early
  • Best parameters improve over default configuration by >5%
  • Visualizations show convergence (optimization history flattens)
  • MLflow logs all trials with parameters and metrics
  • Final model saved and loads correctly
  • Deployment package includes all necessary files

Errores Comunes

  • Overfitting to validation set: Running 1000s of trials implicitly optimizes for validation set; use holdout test set or time-based split for final evaluation
  • Ignoring feature engineering: AutoML finds best hyperparameters but doesn't create features; invest in feature engineering first
  • Search space too wide: Unbounded or very wide ranges waste trials on unrealistic values; use domain knowledge to constrain
  • Not using early stopping: Training full epochs for every trial is wasteful; enable early stopping in objective function
  • Ignoring compute costs: 100 trials × 10 minutes = 16 hours; consider compute budget when setting n_trials
  • Categorical features not encoded: Most algorithms need numeric features; encode categoricals before optimization
  • Imbalanced data: Default metrics may mislead with class imbalance; use F1, AUC, or custom metrics
  • Not saving intermediate results: Crashes lose all progress; use persistent storage (Optuna SQLite, MLflow) to resume

Habilidades Relacionadas

  • track-ml-experiments - MLflow experiment tracking and versioning
  • orchestrate-ml-pipeline - Airflow/Kubeflow for production AutoML pipelines

GitHub 저장소

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

연관 스킬

executing-plans

디자인

executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.

스킬 보기

requesting-code-review

디자인

이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.

스킬 보기

connect-mcp-server

디자인

이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.

스킬 보기

web-cli-teleport

디자인

이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.

스킬 보기