Comprehensive Machine Learning plugin with 10 specialist agents: TensorFlow/Keras, PyTorch, RL, Scikit-learn, Neural Architecture, Gradient Boosting, Computer Vision, NLP Transformers, Time Series, and AutoML. Context7-verified patterns.
npm install @claudeautopm/plugin-mlComprehensive Machine Learning plugin with 10 specialist agents covering deep learning, classical ML, computer vision, NLP, time series, AutoML, and more. All patterns verified against official documentation via Context7 MCP server.
Version: 2.0.0 | Schema: 2.0 | Agents: 10 | Context7-Verified: โ
``bashInstall the plugin package
npm install @claudeautopm/plugin-ml
Context7 Integration
This plugin uses Context7 MCP server to ensure all ML patterns follow the latest official documentation:
Libraries Verified:
- TensorFlow:
/tensorflow/tensorflow (5,192 snippets, trust 7.9)
- PyTorch: /pytorch/pytorch (4,451 snippets, trust 8.4)
- Gymnasium: /farama-foundation/gymnasium (288 snippets, trust 8.1)
- Stable-Baselines3: /dlr-rm/stable-baselines3 (265 snippets, trust 8.0)
- Scikit-learn: /scikit-learn/scikit-learn (4,161 snippets, trust 8.5)All ML patterns, best practices, and code examples are verified against current official documentation to prevent outdated approaches and ensure production-ready implementations.
๐ง What's Included
$3
#### 1. tensorflow-keras-expert
TensorFlow and Keras deep learning specialist
- Model building: Sequential, Functional, Subclassing APIs
- Training optimization: Callbacks, learning rate schedules, XLA compilation
- Distributed training: MirroredStrategy, TPUStrategy
- Mixed precision: Float16 for 2-3x speedup
- Deployment: SavedModel, TensorFlow Lite for mobile/edge
- Context7 patterns: 10+ verified TensorFlow best practices
Example:
`markdown
@tensorflow-keras-expertBuild a CNN for MNIST digit classification with:
- Data augmentation
- Early stopping and checkpointing
- XLA compilation for speedup
- TensorFlow Lite export for mobile deployment
`#### 2. pytorch-expert
PyTorch deep learning specialist
- Model building: torch.nn.Module, custom architectures
- Training: torch.compile for 2x speedup, custom training loops
- Distributed: DistributedDataParallel (DDP) for multi-GPU
- Mixed precision: torch.amp for faster training
- Optimization: Learning rate schedulers, gradient clipping
- Context7 patterns: 10+ verified PyTorch best practices
Example:
`markdown
@pytorch-expertCreate a ResNet-50 model for ImageNet with:
- torch.compile optimization
- DDP training on 4 GPUs
- Mixed precision (FP16)
- Cosine annealing LR schedule
- Model checkpointing
`#### 3. reinforcement-learning-expert
Reinforcement Learning specialist
- Environments: Gymnasium API, custom environment creation
- Algorithms: PPO, SAC, TD3, DQN (via Stable-Baselines3)
- Training: Q-Learning, policy gradients, actor-critic methods
- Optimization: Reward shaping, vectorized environments
- Callbacks: Early stopping, model checkpointing
- Context7 patterns: 10+ verified RL best practices
Example:
`markdown
@reinforcement-learning-expertTrain a PPO agent for CartPole-v1 with:
- Stable-Baselines3 integration
- Evaluation callbacks
- Reward threshold stopping
- Best model saving
- Test agent visualization
`#### 4. scikit-learn-expert
Classical machine learning specialist
- Pipelines: Preprocessing and modeling without data leakage
- Model selection: GridSearchCV, RandomizedSearchCV
- Cross-validation: KFold, StratifiedKFold
- Feature engineering: Selection, scaling, encoding
- Algorithms: Classification, regression, clustering
- Context7 patterns: 5+ verified scikit-learn best practices
Example:
`markdown
@scikit-learn-expertBuild a classification pipeline for customer churn with:
- Pipeline with StandardScaler and RandomForest
- GridSearchCV for hyperparameter tuning
- 5-fold cross-validation
- Feature importance analysis
- Handle class imbalance with class_weight
`#### 5. neural-network-architect
Neural network architecture design specialist
- Architecture patterns: CNNs, ResNets, Transformers, U-Net
- Layer selection: Convolutions, normalization, activation functions
- Skip connections: Residual blocks, encoder-decoder
- Model scaling: Width, depth, resolution strategies
- Context7 patterns: Architecture best practices
Example:
`markdown
@neural-network-architectDesign a ResNet architecture for ImageNet with:
- ResNet-50 structure with bottleneck blocks
- Batch normalization and ReLU activations
- Skip connections for gradient flow
- Proper initialization strategies
`#### 6. gradient-boosting-expert
Gradient boosting specialist (XGBoost, LightGBM, CatBoost)
- Model training: Early stopping, cross-validation
- Hyperparameter tuning: GridSearchCV, Optuna
- Feature importance: Gain, cover, SHAP values
- Categorical handling: Native categorical support
- Context7 patterns: 10+ verified XGBoost patterns
Example:
`markdown
@gradient-boosting-expertBuild a XGBoost model for customer churn with:
- Categorical feature handling (no encoding needed)
- GridSearchCV hyperparameter tuning
- Early stopping on validation set
- SHAP feature importance analysis
`#### 7. computer-vision-expert
Computer vision specialist (OpenCV, YOLO, object detection)
- Image preprocessing: Resizing, normalization, augmentation
- Object detection: YOLO, Faster R-CNN with OpenCV DNN
- Segmentation: DeepLab, Mask R-CNN
- Face recognition: YuNet detection, SFace recognition
- Real-time video: Optimized processing pipelines
- Context7 patterns: OpenCV best practices
Example:
`markdown
@computer-vision-expertBuild a real-time object detection pipeline with:
- YOLO v8 with OpenCV DNN module
- GPU acceleration (CUDA backend)
- Video processing at 30 FPS
- Non-maximum suppression for duplicate removal
`#### 8. nlp-transformer-expert
NLP transformer specialist (BERT, GPT, T5)
- Fine-tuning: Text classification, NER, question answering
- Pipeline API: Quick inference with pre-trained models
- Text generation: GPT-2/GPT-3 with sampling strategies
- Inference optimization: Mixed precision, torch.compile
- Parameter-efficient fine-tuning: LoRA with PEFT
- Context7 patterns: 15+ verified Transformers patterns
Example:
`markdown
@nlp-transformer-expertFine-tune BERT for sentiment analysis with:
- HuggingFace Trainer API
- Mixed precision (FP16) training
- Early stopping and checkpointing
- LoRA for efficient fine-tuning (0.1% trainable params)
`#### 9. time-series-expert
Time series forecasting specialist
- Statistical models: Prophet, ARIMA, SARIMAX
- Deep learning: LSTM, GRU, Temporal Fusion Transformer
- Seasonality: Trend analysis, decomposition
- Anomaly detection: Prophet confidence intervals
- Multi-step forecasting: Recursive and direct strategies
- Context7 patterns: Prophet and ARIMA best practices
Example:
`markdown
@time-series-expertBuild a sales forecasting model with:
- Prophet for multiple seasonality (daily, weekly, yearly)
- Custom holiday effects (Black Friday, Christmas)
- Cross-validation for horizon evaluation
- Anomaly detection with 99% confidence intervals
`#### 10. automl-expert
Automated machine learning specialist
- Frameworks: AutoGluon, FLAML, AutoKeras, H2O AutoML
- Model selection: Automatic algorithm comparison
- Ensembling: Stacking, blending, bagging
- Hyperparameter optimization: Bayesian search
- Rapid prototyping: Get best models with minimal code
- Context7 patterns: AutoGluon and FLAML workflows
Example:
`markdown
@automl-expertBuild a classification model with AutoGluon:
- Automatic preprocessing and feature engineering
- Train 10+ model types (LightGBM, XGBoost, Neural Nets)
- Multi-layer stacking ensembles
- 1 hour time budget with best_quality preset
`๐ Quick Start
$3
`markdown
@tensorflow-keras-expertI need to build an image classifier for 10 classes:
- Use transfer learning with MobileNetV2
- Fine-tune the top layers
- Apply data augmentation
- Use callbacks for early stopping and learning rate scheduling
- Export to TensorFlow Lite for Android deployment
`$3
`markdown
@pytorch-expertCreate a sentiment analysis model:
- BERT-based architecture
- Mixed precision training (FP16)
- Distributed training on 2 GPUs with DDP
- Gradient clipping for stability
- Save best model based on validation F1 score
`$3
`markdown
@reinforcement-learning-expertTrain an RL agent to play Atari Pong:
- Use DQN algorithm from Stable-Baselines3
- Frame stacking for temporal information
- Reward clipping
- Experience replay with prioritization
- Evaluate every 10k steps
- Stop when average reward exceeds 18
`$3
`markdown
@scikit-learn-expertBuild a house price prediction model:
- Features: numeric (area, bedrooms) and categorical (location, type)
- Pipeline with imputation, scaling, and encoding
- RandomizedSearchCV for hyperparameter tuning
- Ridge regression with cross-validation
- Feature importance and SHAP analysis
`๐ Agent Capabilities
$3
Strengths:
- Production deployment (TensorFlow Serving, TFLite)
- TPU training for massive scale
- Strong mobile/edge support
- Rich ecosystem (TensorFlow Hub, TFX)
Use Cases:
- Mobile apps (TFLite)
- Large-scale training (TPUs)
- Production serving (TF Serving)
- Browser deployment (TensorFlow.js)
$3
Strengths:
- Research flexibility
- Dynamic computational graphs
- Excellent debugging
- Strong community support
Use Cases:
- Research experiments
- Custom architectures
- Academic projects
- Prototyping new models
$3
Strengths:
- Game AI and robotics
- Sequential decision making
- Multi-agent systems
- Adaptive systems
Use Cases:
- Game playing (Atari, board games)
- Robotics control
- Resource optimization
- Recommendation systems
$3
Strengths:
- Fast prototyping
- Interpretable models
- Small datasets
- Production simplicity
Use Cases:
- Tabular data
- Feature engineering
- Quick baselines
- Interpretable ML
๐งช Context7-Verified Patterns
$3
1. โ
Callbacks for checkpointing and early stopping
2. โ
XLA compilation with jit_compile=True
3. โ
Distributed training with MirroredStrategy
4. โ
Mixed precision with mixed_float16 policy
5. โ
Proper data normalization (/ 255.0)
6. โ
Learning rate schedules (ExponentialDecay, CosineAnnealing)
7. โ
TensorFlow Lite conversion for mobile
8. โ
Custom training loops with @tf.function
9. โ
Model evaluation on test set
10. โ
SavedModel format for deployment$3
1. โ
torch.compile for 2x speedup
2. โ
DistributedDataParallel (DDP) for multi-GPU
3. โ
Mixed precision with torch.amp.autocast
4. โ
Proper nn.Module structure with super().__init__
5. โ
DataLoader with num_workers and pin_memory
6. โ
Model checkpointing (state_dict, not full model)
7. โ
Gradient clipping for stability
8. โ
Learning rate schedulers (StepLR, CosineAnnealing)
9. โ
Custom loss functions with autograd
10. โ
Proper CUDA device management$3
1. โ
Gymnasium API (observation, reward, terminated, truncated, info)
2. โ
Epsilon-greedy exploration with decay
3. โ
Q-Learning with Bellman equation updates
4. โ
Custom environments with proper reset/step
5. โ
Stable-Baselines3 with callbacks
6. โ
Vectorized environments for speedup
7. โ
Reward shaping (dense vs sparse rewards)
8. โ
Early stopping on reward threshold
9. โ
Model saving and loading
10. โ
Custom training callbacks for monitoring$3
1. โ
Pipelines to prevent data leakage
2. โ
Cross-validation with pipelines
3. โ
GridSearchCV/RandomizedSearchCV for tuning
4. โ
Feature selection as pipeline step
5. โ
class_weight='balanced' for imbalanced data๐ง Configuration
$3
`bash
TensorFlow
export TF_FORCE_GPU_ALLOW_GROWTH=true
export TF_XLA_FLAGS=--tf_xla_enable_xla_devicesPyTorch
export CUDA_VISIBLE_DEVICES=0,1
export TORCH_DISTRIBUTED_DEBUG=DETAILRL
export GYM_RENDER_MODE=human
``- TensorFlow/Keras Expert Guide
- PyTorch Expert Guide
- RL Expert Guide
- Scikit-learn Expert Guide
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
MIT ยฉ ClaudeAutoPM Team