Prerequisites
Before using this skill, ensure you have:
- Python environment with AutoML libraries (Auto-sklearn, TPOT, H2O AutoML, or PyCaret)
- Training dataset in accessible format (CSV, Parquet, or database)
- Understanding of problem type (classification, regression, time-series)
- Sufficient computational resources for automated search
- Knowledge of evaluation metrics appropriate for task
- Target variable and feature columns clearly defined
Instructions
Step 1: Define Pipeline Requirements
Specify the machine learning task and constraints:
- Identify problem type (binary/multi-class classification, regression, etc.)
- Define evaluation metrics (accuracy, F1, RMSE, etc.)
- Set time and resource budgets for AutoML search
- Specify feature types and preprocessing needs
- Determine model interpretability requirements
Step 2: Prepare Data Infrastructure
Set up data access and preprocessing:
- Load training data using Read tool
- Perform initial data quality assessment
- Configure train/validation/test split strategy
- Define feature engineering transformations
- Set up data validation checks
Step 3: Configure AutoML Pipeline
Build the automated pipeline configuration:
- Select AutoML framework based on requirements
- Define search space for algorithms (random forest, XGBoost, neural networks, etc.)
- Configure feature preprocessing steps (scaling, encoding, imputation)
- Set hyperparameter tuning strategy (Bayesian optimization, random search, grid search)
- Establish early stopping criteria and timeout limits
Step 4: Execute Pipeline Training
Run the automated training process:
- Initialize AutoML pipeline with configuration
- Execute automated feature engineering
- Perform model selection across algorithm families
- Conduct hyperparameter optimization for top models
- Evaluate models using cross-validation
Step 5: Analyze and Export Results
Evaluate pipeline performance and prepare for deployment:
- Compare model performances across metrics
- Extract best model and configuration
- Generate feature importance analysis
- Create model performance visualizations
- Export trained pipeline for deployment
Output
The skill generates comprehensive AutoML pipeline artifacts:
Pipeline Configuration Files
# {baseDir}/automl_config.py
{
"task_type": "classification",
"time_budget": 3600,
"algorithms": ["rf", "xgboost", "catboost"],
"preprocessing": ["scaling", "encoding"],
"tuning_strategy": "bayesian",
"cv_folds": 5
}
Pipeline Code
- Complete Python implementation of AutoML pipeline
- Data loading and preprocessing functions
- Feature engineering transformations
- Model training and evaluation logic
- Hyperparameter search configuration
Model Performance Report
- Best model architecture and hyperparameters
- Cross-validation scores with confidence intervals
- Feature importance rankings
- Confusion matrix or residual plots
- ROC curves and precision-recall curves (for classification)
Training Artifacts
- Serialized best model file (pickle, joblib, or ONNX)
- Feature preprocessing pipeline
- Training history and search logs
- Model performance metrics on test set
- Documentation for model deployment
Deployment Package
- Prediction API code for serving model
- Input validation and preprocessing scripts
- Model loading and inference functions
- Example usage documentation
- Requirements file with dependencies
Error Handling
Common issues and solutions:
Insufficient Training Time
- Error: AutoML search terminated before finding good model
- Solution: Increase time budget, reduce search space, or use faster algorithms
Memory Exhaustion
- Error: Out of memory during pipeline training
- Solution: Reduce dataset size through sampling, use incremental learning, or simplify feature engineering
Poor Model Performance
- Error: Best model accuracy below acceptable threshold
- Solution: Collect more data, engineer better features, expand algorithm search space, or adjust evaluation metrics
Feature Engineering Failures
- Error: Automated feature transformations produce invalid values
- Solution: Add data validation checks, handle missing values explicitly, restrict transformation types
Model Convergence Issues
- Error: Optimization fails to converge for certain algorithms
- Solution: Adjust hyperparameter ranges, increase iteration limits, or exclude problematic algorithms
Resources
AutoML Frameworks
- Auto-sklearn: Automated scikit-learn pipeline construction with metalearning
- TPOT: Genetic programming for pipeline optimization
- H2O AutoML: Scalable AutoML with ensemble methods
- PyCaret: Low-code ML library with automated workflows
Feature Engineering
- Automated feature selection techniques
- Categorical encoding strategies (one-hot, target, ordinal)
- Numerical transformation methods (scaling, binning, polynomial features)
- Time-series feature extraction
Hyperparameter Optimization
- Bayesian optimization with Gaussian processes
- Random search and grid search strategies
- Hyperband and successive halving algorithms
- Multi-objective optimization for multiple metrics
Evaluation Strategies
- Cross-validation techniques (k-fold, stratified, time-series)
- Evaluation metrics selection guide
- Model ensembling and stacking approaches
- Bias-variance tradeoff analysis
Best Practices
- Start with baseline models before AutoML
- Balance automation with domain knowledge
- Monitor resource consumption during search
- Validate model performance on holdout data
- Document pipeline decisions for reproducibility
1---2name: building-automl-pipelines3version: 1.0.04description: |5 Build automated machine learning pipelines with feature engineering, model selection, and hyperparameter tuning.6 Use when automating ML workflows from data preparation through model deployment.7 Trigger with phrases like "build automl pipeline", "automate ml workflow", or "create automated training pipeline".8allowed-tools: Read, Write, Edit, Grep, Glob, Bash(python:*)9license: MIT10---1112## Prerequisites1314Before using this skill, ensure you have:15- Python environment with AutoML libraries (Auto-sklearn, TPOT, H2O AutoML, or PyCaret)16- Training dataset in accessible format (CSV, Parquet, or database)17- Understanding of problem type (classification, regression, time-series)18- Sufficient computational resources for automated search19- Knowledge of evaluation metrics appropriate for task20- Target variable and feature columns clearly defined2122## Instructions2324### Step 1: Define Pipeline Requirements25Specify the machine learning task and constraints:261. Identify problem type (binary/multi-class classification, regression, etc.)272. Define evaluation metrics (accuracy, F1, RMSE, etc.)283. Set time and resource budgets for AutoML search294. Specify feature types and preprocessing needs305. Determine model interpretability requirements3132### Step 2: Prepare Data Infrastructure33Set up data access and preprocessing:341. Load training data using Read tool352. Perform initial data quality assessment363. Configure train/validation/test split strategy374. Define feature engineering transformations385. Set up data validation checks3940### Step 3: Configure AutoML Pipeline41Build the automated pipeline configuration:42- Select AutoML framework based on requirements43- Define search space for algorithms (random forest, XGBoost, neural networks, etc.)44- Configure feature preprocessing steps (scaling, encoding, imputation)45- Set hyperparameter tuning strategy (Bayesian optimization, random search, grid search)46- Establish early stopping criteria and timeout limits4748### Step 4: Execute Pipeline Training49Run the automated training process:501. Initialize AutoML pipeline with configuration512. Execute automated feature engineering523. Perform model selection across algorithm families534. Conduct hyperparameter optimization for top models545. Evaluate models using cross-validation5556### Step 5: Analyze and Export Results57Evaluate pipeline performance and prepare for deployment:58- Compare model performances across metrics59- Extract best model and configuration60- Generate feature importance analysis61- Create model performance visualizations62- Export trained pipeline for deployment6364## Output6566The skill generates comprehensive AutoML pipeline artifacts:6768### Pipeline Configuration Files69```python70# {baseDir}/automl_config.py71{72 "task_type": "classification",73 "time_budget": 3600,74 "algorithms": ["rf", "xgboost", "catboost"],75 "preprocessing": ["scaling", "encoding"],76 "tuning_strategy": "bayesian",77 "cv_folds": 578}79```8081### Pipeline Code82- Complete Python implementation of AutoML pipeline83- Data loading and preprocessing functions84- Feature engineering transformations85- Model training and evaluation logic86- Hyperparameter search configuration8788### Model Performance Report89- Best model architecture and hyperparameters90- Cross-validation scores with confidence intervals91- Feature importance rankings92- Confusion matrix or residual plots93- ROC curves and precision-recall curves (for classification)9495### Training Artifacts96- Serialized best model file (pickle, joblib, or ONNX)97- Feature preprocessing pipeline98- Training history and search logs99- Model performance metrics on test set100- Documentation for model deployment101102### Deployment Package103- Prediction API code for serving model104- Input validation and preprocessing scripts105- Model loading and inference functions106- Example usage documentation107- Requirements file with dependencies108109## Error Handling110111Common issues and solutions:112113**Insufficient Training Time**114- Error: AutoML search terminated before finding good model115- Solution: Increase time budget, reduce search space, or use faster algorithms116117**Memory Exhaustion**118- Error: Out of memory during pipeline training119- Solution: Reduce dataset size through sampling, use incremental learning, or simplify feature engineering120121**Poor Model Performance**122- Error: Best model accuracy below acceptable threshold123- Solution: Collect more data, engineer better features, expand algorithm search space, or adjust evaluation metrics124125**Feature Engineering Failures**126- Error: Automated feature transformations produce invalid values127- Solution: Add data validation checks, handle missing values explicitly, restrict transformation types128129**Model Convergence Issues**130- Error: Optimization fails to converge for certain algorithms131- Solution: Adjust hyperparameter ranges, increase iteration limits, or exclude problematic algorithms132133## Resources134135### AutoML Frameworks136- **Auto-sklearn**: Automated scikit-learn pipeline construction with metalearning137- **TPOT**: Genetic programming for pipeline optimization138- **H2O AutoML**: Scalable AutoML with ensemble methods139- **PyCaret**: Low-code ML library with automated workflows140141### Feature Engineering142- Automated feature selection techniques143- Categorical encoding strategies (one-hot, target, ordinal)144- Numerical transformation methods (scaling, binning, polynomial features)145- Time-series feature extraction146147### Hyperparameter Optimization148- Bayesian optimization with Gaussian processes149- Random search and grid search strategies150- Hyperband and successive halving algorithms151- Multi-objective optimization for multiple metrics152153### Evaluation Strategies154- Cross-validation techniques (k-fold, stratified, time-series)155- Evaluation metrics selection guide156- Model ensembling and stacking approaches157- Bias-variance tradeoff analysis158159### Best Practices160- Start with baseline models before AutoML161- Balance automation with domain knowledge162- Monitor resource consumption during search163- Validate model performance on holdout data164- Document pipeline decisions for reproducibility