agentsclimarketplace

Ml antipattern validator

Skill ComeOnOliver/skillshub/skills/aiskillstore/marketplace/doyajin174/ml-antipattern-validator

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill ml-antipattern-validator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Prevents 30+ critical AI/ML mistakes including data leakage, evaluation errors, training pitfalls, and deployment issues. Use when working with ML training, testing, model evaluation, or deployment.

SKILL.md

4.6 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

ML Antipattern Validator

Overview

AI/ML κ°œλ°œμ—μ„œ 30+ μ•ˆν‹°νŒ¨ν„΄μ„ κ°μ§€ν•˜κ³  λ°©μ§€ν•˜λŠ” μŠ€ν‚¬μž…λ‹ˆλ‹€.

Key Principle: Honest evaluation > Impressive metrics.

When to Activate

Automatic Triggers:

  • ML training code (train*.py, model training)
  • Dataset preparation or splitting
  • Model evaluation or testing
  • Production deployment planning

Manual Triggers:

  • @validate-ml - Full validation
  • @check-leakage - Data leakage detection
  • @verify-eval - Evaluation methodology

Pre-Implementation Checklist

βœ… Requirements:
β–‘ Problem clearly defined with success metrics
β–‘ Train/test split strategy defined
β–‘ Evaluation methodology matches business objective

βœ… Data Integrity:
β–‘ No temporal leakage (future β†’ past)
β–‘ No target leakage (answer in features)
β–‘ No preprocessing leakage (fit on all data)
β–‘ No group leakage (related samples split)

βœ… Evaluation Setup:
β–‘ Test set completely held out
β–‘ Metrics aligned with business objective
β–‘ Baseline models defined

Critical Antipatterns

Category 1: Data Leakage 🚨

1.1 Target Leakage

❌ WRONG: Using "refund_issued" to predict "purchase_fraud"
βœ… CORRECT: Only use features available at purchase time

1.2 Temporal Leakage

❌ WRONG: train = df[df['date'] > '2024-06-01']  # Future data
βœ… CORRECT: train = df[df['date'] < '2024-06-01']  # Past for training

1.3 Preprocessing Leakage

❌ WRONG: X_scaled = scaler.fit_transform(X); train_test_split(X_scaled)
βœ… CORRECT: Split first, then scaler.fit(X_train)

1.4 Group Leakage

❌ WRONG: train_test_split(df)  # Same user in both sets
βœ… CORRECT: GroupShuffleSplit(groups=df['user_id'])

1.5 Data Augmentation Leakage

❌ WRONG: augment(X) β†’ train_test_split()
βœ… CORRECT: train_test_split() β†’ augment(X_train)

Category 2: Evaluation Mistakes ⚠️

2.1 Testing on Training Data

❌ WRONG: evaluate(model, training_data)
βœ… CORRECT: evaluate(model, unseen_test_data)

2.2 Metric Misalignment

Business Objective β†’ Appropriate Metric:
- Ranking β†’ NDCG, MRR, MAP
- Imbalanced β†’ F1, Precision@K, AUC-PR
- Balanced β†’ Accuracy, AUC-ROC

2.3 Accuracy Paradox

❌ WRONG: 99% accuracy on 99:1 imbalanced data
βœ… CORRECT: Check per-class metrics with classification_report()

2.4 Invalid Time Series CV

❌ WRONG: cross_val_score(model, X, y, cv=5)  # Shuffles time!
βœ… CORRECT: TimeSeriesSplit(n_splits=5)

2.5 Hyperparameter Tuning on Test Set

❌ WRONG: grid_search(model, X_test, y_test)
βœ… CORRECT: train/validation/test three-way split

Category 3: Training Pitfalls πŸ”§

3.1 Batch Norm Inference Error

❌ WRONG: predictions = model(X_test)  # Still in train mode
βœ… CORRECT: model.eval(); with torch.no_grad(): predictions = model(X_test)

3.2 Early Stopping Overfitting

❌ WRONG: EarlyStopping(patience=50)
βœ… CORRECT: EarlyStopping(patience=5, min_delta=0.001, restore_best_weights=True)

3.3 Learning Rate Warmup

βœ… CORRECT: get_linear_schedule_with_warmup(num_warmup_steps=1000)

3.4 Class Imbalance

❌ WRONG: CrossEntropyLoss()  # Biased toward majority
βœ… CORRECT: CrossEntropyLoss(weight=class_weights)

Detection Patterns

Leakage Detection

# Check feature-target correlation
correlation = df[features].corrwith(df['target'])
if (correlation.abs() > 0.95).any():
    raise DataLeakageError("Suspiciously high correlation")

# Check temporal ordering
if train['date'].min() > test['date'].max():
    raise TemporalLeakageError("Training on future, testing on past")

# Check group overlap
if train_groups & test_groups:
    raise GroupLeakageError("Overlapping groups")

Mode Check

if model.training:
    raise InferenceModeError("Model in training mode during evaluation")

Validation Checklist

Before deployment:

  • No data leakage detected
  • Test set never seen during training
  • Metrics aligned with business objective
  • model.eval() called for inference
  • Class imbalance handled
  • Covariate shift monitoring planned

References

상세 μ˜ˆμ‹œ 및 μ‹œλ‚˜λ¦¬μ˜€λŠ” references/REFERENCE.md μ°Έμ‘°.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.