home / skills / dkyazzentwatwa / chatgpt-skills / classification-helper

classification-helper skill

/classification-helper

This skill helps you train and evaluate classification models with automatic model selection, hyperparameter tuning, and comprehensive metrics.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill classification-helper

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
869 B
---
name: classification-helper
description: Quick classifier training with automatic model selection, hyperparameter tuning, and comprehensive evaluation metrics.
---

# Classification Helper

Train and evaluate classification models with automatic model selection.

## Features

- **Auto Model Selection**: Compare multiple classifiers
- **Hyperparameter Tuning**: Grid/random search
- **Evaluation Metrics**: Accuracy, precision, recall, F1, ROC-AUC
- **Cross-Validation**: K-fold validation
- **Confusion Matrix**: Detailed error analysis
- **Feature Importance**: Top predictive features
- **Model Export**: Save trained models

## CLI Usage

```bash
python classification_helper.py --data train.csv --target class --test test.csv --output model.pkl
```

## Dependencies

- scikit-learn>=1.3.0
- pandas>=2.0.0
- numpy>=1.24.0
- matplotlib>=3.7.0
- seaborn>=0.12.0

Overview

This skill provides a streamlined workflow to train, tune, and evaluate classification models with minimal setup. It automatically compares multiple candidate algorithms, runs hyperparameter searches, and produces comprehensive evaluation reports. The tool also supports k-fold cross-validation, confusion matrices, feature importance summaries, and model export for deployment.

How this skill works

You supply a labeled dataset and target column; the skill runs predefined candidate classifiers and ranks them by performance. It performs grid or random hyperparameter tuning and k-fold cross-validation to reduce overfitting. The output includes accuracy, precision, recall, F1, ROC-AUC, a confusion matrix, top predictive features, and a serialized model file for reuse.

When to use it

  • You need a fast, reproducible baseline for a new classification problem.
  • You want automated model selection without hand-crafting many experiments.
  • You need consistent cross-validated metrics for reporting or model comparison.
  • You want feature importance and error analysis to inform data decisions.
  • You need to export a trained model for production or further testing.

Best practices

  • Prepare and clean data in advance: handle missing values, encode categoricals, and scale features as needed.
  • Set a sensible search space for hyperparameters to balance compute cost and performance.
  • Use stratified k-fold when classes are imbalanced to get reliable validation scores.
  • Inspect confusion matrices and per-class metrics, not just overall accuracy.
  • Save preprocessing pipeline with the model to ensure consistent inference in production.

Example use cases

  • Quickly compare logistic regression, random forest, and gradient boosting on a new binary classification task.
  • Tune hyperparameters of candidate models using grid or random search with k-fold validation for robust selection.
  • Generate a validation report with ROC-AUC, F1, and confusion matrix to support model review meetings.
  • Identify top predictive features to guide feature engineering or reduce dimensionality.
  • Export the final pipeline and model artifact (e.g., model.pkl) for deployment in an inference service.

FAQ

What input formats are supported?

Use CSV files or pandas DataFrames; specify the target column and optional test split files.

Can I add custom classifiers or preprocessors?

Yes. Plug in additional scikit-learn compatible estimators or preprocessing steps into the workflow before running selection.

How does it handle imbalanced classes?

Use stratified k-fold validation and class-weighted estimators or sampling techniques. The tool reports per-class metrics to help evaluate imbalance.