scikit-learn

Build, evaluate, and tune machine learning models in Python with scikit-learn.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/gracefullight/cnn --skill scikit-learn-gracefullight
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scikit-learn
Source: https://github.com/gracefullight/cnn/tree/main/.agents/skills/scikit-learn
Command: npx skills add https://github.com/gracefullight/cnn --skill scikit-learn-gracefullight

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scikit-learn, numpy, pandas, matplotlib, and includes scripts (resource) and references (resource) components.

What problem does it solve? It guides you through classical machine learning tasks in Python—classification, regression, clustering, and preprocessing—without having to memorize scikit-learn's extensive API or risk common mistakes like data leakage. ## Core Features & Use Cases - Supervised & Unsupervised Learning: Covers classification, regression, clustering, and dimensionality reduction algorithms with selection guidance. - Pipelines & Preprocessing: Build leak-free workflows with Pipeline, ColumnTransformer, scalers, encoders, and imputers for mixed data types. - Model Evaluation & Tuning: Cross-validation strategies, GridSearchCV/RandomizedSearchCV hyperparameter tuning, and classification, regression, and clustering metrics. - Use Case: Given a CSV with numeric and categorical columns, build a complete classification pipeline that imputes missing values, encodes categories, compares Random Forest against Gradient Boosting via cross-validation, tunes hyperparameters, and reports test metrics. ## Quick Start Use the scikit-learn skill to train and evaluate a classification model on my dataset with proper preprocessing and cross-validation.

Frequently Asked Questions about scikit-learn

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

FAQPage Schema
How do I build a machine learning pipeline in scikit-learn?▼

Use sklearn.pipeline.Pipeline to chain transformers and an estimator, and ColumnTransformer to apply different preprocessing to numeric and categorical columns. Fitting the pipeline on training data only prevents data leakage during cross-validation.

How to tune hyperparameters with GridSearchCV in scikit-learn?▼

GridSearchCV exhaustively tests all parameter combinations using cross-validation and returns the best estimator. For large search spaces, RandomizedSearchCV samples random combinations and is more efficient.

Which scikit-learn algorithms require feature scaling?▼

SVM, KNN, neural networks, PCA, regularized linear models, and K-Means require scaled features using StandardScaler or similar. Tree-based models like Random Forest and Gradient Boosting do not require scaling.

How do I handle imbalanced classification data in scikit-learn?▼

Use class_weight='balanced' on supported estimators like RandomForestClassifier, and evaluate with balanced accuracy, precision, recall, or ROC AUC instead of plain accuracy. For resampling, combine with imbalanced-learn's SMOTE.

Why does scikit-learn raise ConvergenceWarning during training?▼

ConvergenceWarning means the iterative solver did not converge within max_iter iterations. Increase max_iter or scale your features with StandardScaler, since unscaled features slow convergence for models like LogisticRegression.

When should I not use scikit-learn for machine learning?▼

scikit-learn targets classical ML on structured data and lacks GPU acceleration and deep learning support. For deep neural networks use PyTorch or TensorFlow, and for very large datasets use SGD estimators or MiniBatchKMeans.