scikit-learn

Builds leak-proof scikit-learn pipelines for tabular data with cross-validation.

15|2|Updated May 23, 2026
One-click install
npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill scikit-learn-vkirill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scikit-learn
Source: https://github.com/VKirill/antigravity-for-claude-code/tree/main/skills/scikit-learn
Command: npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill scikit-learn-vkirill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the problem of building dependable machine learning workflows for tabular (rows/columns) data without data leakage, while accelerating common tasks like preprocessing, cross-validation, hyperparameter search, and model evaluation.

Core Features & Use Cases

  • Estimator API workflows: fit/predict/transform/score patterns for classical ML estimators, including custom estimators and contract testing.
  • Leak-proof composition: end-to-end Pipeline and ColumnTransformer patterns that keep preprocessing inside the proper train/validation boundaries.
  • Model selection at scale: GridSearchCV, RandomizedSearchCV, and HalvingGridSearchCV over Pipelines, plus diagnostics like learning/validation curves.
  • Practical evaluation for real data: correct metric choices for imbalance (e.g., roc_auc, average_precision, balanced_accuracy) and multi-metric cross-validation.
  • Production readiness: safe model persistence guidance across joblib, skops.io, and ONNX, including versioning and trust boundaries.

Quick Start

Use scikit-learn to build and evaluate a tabular classification baseline by fitting a preprocessing-plus-model Pipeline with cross-validation and reporting the right metrics for class imbalance.

Frequently Asked Questions about scikit-learn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent data leakage when building a scikit-learn pipeline for tabular data?

To prevent data leakage in a scikit-learn pipeline, use Pipeline and ColumnTransformer to encapsulate all preprocessing steps inside the proper train and validation boundaries before applying cross-validation. This ensures transformations are fitted only on training folds, keeping test data unseen during model evaluation.

What's the best way to tune hyperparameters across a ColumnTransformer pipeline in scikit-learn?

The best way to tune hyperparameters across a ColumnTransformer pipeline is using GridSearchCV, RandomizedSearchCV, or HalvingGridSearchCV. These scikit-learn model selection tools iterate over parameter grids applied to Pipeline stages, returning the best estimator configuration validated through cross-validation.

How do I handle class imbalance when evaluating a classification model with scikit-learn?

To handle class imbalance when evaluating a classification model with scikit-learn, use stratified train/test splitting and select appropriate scoring metrics like roc_auc, average_precision, or balanced_accuracy. Multi-metric cross-validation provides a robust evaluation of model performance on imbalanced datasets.

Can I export a trained scikit-learn model to ONNX for production deployment?

Yes, you can export a trained scikit-learn model to ONNX for production deployment. The Skill provides safe model persistence guidance across multiple formats including joblib, skops.io, and ONNX, addressing versioning and trust boundaries for reliable inference outside the training environment.

Does scikit-learn support diagnostics like learning curves for model evaluation?

Yes, scikit-learn supports diagnostics like learning curves and validation curves for model evaluation. These diagnostic tools visualize training and validation performance across varying training set sizes or hyperparameter values, helping identify whether a model suffers from high bias or variance during cross-validated workflows.

When should I use HalvingGridSearchCV instead of GridSearchCV for hyperparameter tuning?

You should use HalvingGridSearchCV instead of GridSearchCV when searching a large hyperparameter space with limited resources. HalvingGridSearchCV evaluates candidates on a small subset of data initially, then allocates more resources to promising candidates, accelerating the search compared to exhaustive GridSearchCV.