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

track-ml-experiments

pjt222
업데이트됨 Yesterday
17
2
17
GitHub에서 보기
메타aiautomationdesign

정보

이 스킬은 자동 로깅과 아티팩트 관리를 통해 MLflow를 자동화된 실험 추적 시스템으로 설정합니다. 이는 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/track-ml-experiments

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

문서

Track ML Experiments

See Extended Examples for complete configuration files and templates.

Set up MLflow tracking server and implement comprehensive experiment tracking with metrics, parameters, and artifacts.

Cuándo Usar

  • Starting a new machine learning project requiring experiment tracking
  • Migrating from manual experiment logs to automated tracking
  • Comparing multiple model training runs systematically
  • Sharing experiment results with team members
  • Building reproducible ML workflows with full lineage tracking
  • Integrating experiment tracking into CI/CD pipelines

Entradas

  • Requerido: Python environment with ML framework (sklearn, pytorch, tensorflow, xgboost)
  • Requerido: MLflow installation (pip install mlflow)
  • Opcional: Remote storage backend (S3, Azure Blob, GCS) for artifacts
  • Opcional: Database backend (PostgreSQL, MySQL) for metadata storage
  • Opcional: Authentication credentials for remote backends

Procedimiento

Paso 1: Initialize MLflow Tracking Server

Set up the MLflow tracking server with appropriate backend stores.

# Option 1: Local file-based tracking (development)
mkdir -p mlruns
export MLFLOW_TRACKING_URI="file:./mlruns"

# Option 2: SQLite backend with local artifacts
mlflow server \
  --backend-store-uri sqlite:///mlflow.db \
  --default-artifact-root ./mlartifacts \
# ... (see EXAMPLES.md for complete implementation)

Create a configuration file for team sharing:

# mlflow_config.py
import os

MLFLOW_TRACKING_URI = os.getenv(
    "MLFLOW_TRACKING_URI",
    "http://mlflow-server.company.com:5000"
)

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

Esperado: MLflow UI accessible at specified host:port, showing empty experiments list. Server logs confirm successful startup without errors.

En caso de fallo: Check port availability with netstat -tulpn | grep 5000, verify database connection strings, ensure S3 credentials are configured (aws configure), check firewall rules for remote access.

Paso 2: Configure Autologging for ML Frameworks

Enable framework-specific autologging to capture metrics, parameters, and models automatically.

# training_script.py
import mlflow
from mlflow_config import MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME

# Set tracking URI
mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
mlflow.set_experiment(MLFLOW_EXPERIMENT_NAME)

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

For PyTorch:

import mlflow.pytorch

mlflow.pytorch.autolog(
    log_every_n_epoch=1,
    log_every_n_step=None,
    log_models=True,
    disable=False,
    exclusive=False,
# ... (see EXAMPLES.md for complete implementation)

Esperado: Run appears in MLflow UI with all hyperparameters, metrics (training/validation loss, accuracy), model artifacts, and input examples automatically logged.

En caso de fallo: Verify MLflow version compatibility with ML framework (mlflow.sklearn.autolog() requires MLflow ≥1.20), check if autologging is supported for your model type, disable autologging and use manual logging as fallback, inspect logs with mlflow.set_tracking_uri() for connection errors.

Paso 3: Implement Comprehensive Manual Logging

Add custom metrics, parameters, artifacts, and tags for complete experiment documentation.

# comprehensive_tracking.py
import mlflow
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path

def train_and_log_model(params, X_train, y_train, X_test, y_test):
    """
# ... (see EXAMPLES.md for complete implementation)

Esperado: MLflow UI displays rich experiment information including step-by-step metrics, visualization artifacts, model signature, input examples, and comprehensive tags for filtering and searching.

En caso de fallo: Check artifact storage permissions (aws s3 ls s3://bucket/path), verify matplotlib backend for figure logging (plt.switch_backend('Agg')), ensure JSON-serializable data types for log_dict, check disk space for local artifact storage.

Paso 4: Compare Runs and Generate Reports

Use MLflow's comparison tools to analyze multiple experiments.

# compare_runs.py
import mlflow
from mlflow.tracking import MlflowClient

client = MlflowClient()

def compare_experiments(experiment_name, metric_name="test_accuracy", top_n=5):
    """
# ... (see EXAMPLES.md for complete implementation)

Command-line comparison:

# Compare runs using MLflow CLI
mlflow runs compare --experiment-name customer-churn \
  --order-by "metrics.test_accuracy DESC" \
  --max-results 10

# Export run data to CSV
mlflow experiments csv --experiment-name customer-churn \
  --output experiments.csv

Esperado: Console output shows sorted runs with key metrics, HTML report generated with formatted comparison table, CSV file contains all run data for further analysis.

En caso de fallo: Verify experiment exists with mlflow experiments list, check metric names match exactly (case-sensitive), ensure runs have completed successfully (check run status), verify file write permissions for output files.

Paso 5: Configure Remote Artifact Storage

Set up S3/Azure/GCS backends for scalable artifact management.

# artifact_storage_config.py
import mlflow
import os

def configure_s3_backend():
    """
    Configure S3 for artifact storage.
    """
# ... (see EXAMPLES.md for complete implementation)

Docker Compose for MLflow with PostgreSQL and S3:

# docker-compose.yml
version: '3.8'

services:
  postgres:
    image: postgres:14
    environment:
      POSTGRES_DB: mlflow
# ... (see EXAMPLES.md for complete implementation)

Esperado: Artifacts upload successfully to remote storage, MLflow UI shows artifact links pointing to S3/Azure/GCS URIs, downloading artifacts from UI works correctly.

En caso de fallo: Verify cloud credentials with aws s3 ls or az storage blob list, check bucket/container permissions (need write access), ensure MLflow installed with cloud extras (pip install mlflow[extras]), test network connectivity to storage endpoints, check CORS settings for browser access.

Paso 6: Implement Experiment Lifecycle Management

Set up automated cleanup, archival, and organization policies.

# lifecycle_management.py
import mlflow
from mlflow.tracking import MlflowClient
from datetime import datetime, timedelta

client = MlflowClient()

def archive_old_experiments(days_old=90):
# ... (see EXAMPLES.md for complete implementation)

Esperado: Old experiments moved to deleted state, failed runs removed from active list, best runs tagged for easy filtering in UI, storage space reclaimed.

En caso de fallo: Check experiment permissions (must be owner to delete), verify runs are actually in FAILED status, ensure metric exists for all runs being ranked, check database connectivity for bulk operations, verify sufficient permissions for artifact deletion in remote storage.

Validación

  • MLflow tracking server accessible via web UI
  • Experiments created and runs logged successfully
  • Autologging captures framework-specific metrics automatically
  • Custom metrics, parameters, and artifacts logged correctly
  • Comparison queries return expected top runs
  • Remote artifact storage configured and functional
  • Artifacts downloadable from UI and programmatically
  • Run filtering and searching works with tags
  • HTML comparison reports generated without errors
  • Lifecycle management scripts execute successfully

Errores Comunes

  • Connection timeouts: MLflow server not accessible from training scripts - verify MLFLOW_TRACKING_URI environment variable, check firewall rules, ensure server is running
  • Artifact upload failures: S3/Azure credentials not configured or bucket doesn't exist - test cloud CLI access first, verify bucket permissions
  • Missing metrics: Autologging disabled or unsupported framework version - check MLflow version compatibility, fall back to manual logging
  • Run clutter: Too many experimental runs polluting UI - implement tagging strategy early, use lifecycle management scripts regularly
  • Large artifacts: Logging entire datasets causes storage bloat - log only samples or references, use external data versioning (DVC)
  • Inconsistent naming: Parameters logged with different names across runs - standardize naming conventions in config file
  • Database locks: SQLite doesn't support concurrent writes - use PostgreSQL/MySQL for multi-user environments
  • Autolog conflicts: Multiple autolog configurations interfere - use exclusive=True or disable conflicting autologs

Habilidades Relacionadas

  • register-ml-model - Register tracked models in MLflow Model Registry
  • version-ml-data - Version datasets using DVC for reproducible experiments
  • setup-automl-pipeline - Integrate experiment tracking into automated ML pipelines
  • deploy-ml-model-serving - Deploy best-performing tracked models to production
  • orchestrate-ml-pipeline - Combine experiment tracking with workflow orchestration

GitHub 저장소

pjt222/agent-almanac
경로: i18n/es/skills/track-ml-experiments
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기