scikit-learn

Build scikit-learn pipelines with preprocessing, cross-validation, and hyperparameter tuning.

783|65|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill scikit-learn-leonchaox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scikit-learn
Source: https://github.com/LeonChaoX/qinyan-academic-skills/tree/main/skills/09-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%B8%8E%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/scikit-learn
Command: npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill scikit-learn-leonchaox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, matplotlib, sklearn, warnings, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It helps you build reliable machine learning models in Python by providing scikit-learn workflows for training, preprocessing, tuning, and evaluation—without missing key best practices like avoiding data leakage.

Core Features & Use Cases

  • End-to-end ML pipelines: Use Pipeline and ColumnTransformer to combine preprocessing and models safely for both numeric and categorical features.
  • Supervised learning + evaluation: Train and compare classifiers/regressors, then evaluate with cross-validation, common metrics, and hyperparameter search.
  • Unsupervised learning + analysis: Run clustering and dimensionality reduction (e.g., K-Means, DBSCAN, PCA) with practical quality metrics and visualization support.
  • Real-world use case: Train a tabular classifier by imputing missing values, scaling numeric features, one-hot encoding categoricals, selecting the best model via cross-validation, and tuning parameters using GridSearchCV.

Quick Start

Ask the agent to generate a scikit-learn classification pipeline with preprocessing (imputation, scaling, one-hot encoding), 5-fold cross-validation, and GridSearchCV hyperparameter tuning for the best model.

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 with preprocessing and cross-validation?▼

To build a machine learning pipeline, use scikit-learn's Pipeline and ColumnTransformer to safely combine preprocessing steps like imputation, scaling, and one-hot encoding with your model, then evaluate performance using cross-validation metrics.

What's the best way to handle mixed-type tabular data for classification?▼

Handling mixed-type tabular data requires using ColumnTransformer to apply specific preprocessing to numeric and categorical features separately, ensuring safe transformation before training classifiers within a unified scikit-learn pipeline.

How do I tune hyperparameters using GridSearchCV in scikit-learn?▼

Tune hyperparameters using GridSearchCV by defining a parameter grid and passing your pipeline and cross-validation strategy, allowing scikit-learn to automatically select the best model based on evaluation metrics.

Can I evaluate clustering models like K-Means and DBSCAN with quality metrics?▼

Evaluating clustering models like K-Means and DBSCAN involves applying practical quality metrics and visualization support to assess dimensionality reduction and grouping results for unsupervised learning workflows.

Why does my preprocessing pipeline cause data leakage during model evaluation?▼

Preprocessing pipelines cause data leakage when transformations are fitted on the entire dataset before splitting, which you prevent by composing all steps within a scikit-learn Pipeline before applying cross-validation.