scikit-learn
What it does
This tool helps you build machine learning models in Python. It's useful for predicting outcomes, grouping similar data, or simplifying complex information.
When to use it
- ✓When you want to predict if a customer will buy a product.
- ✓When you want to group your customers by buying habits.
- ✓When you want to prepare your data so an AI model can use it.
Skill link
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/scikit-learn/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“How can I use scikit-learn to predict which customers will churn?”
5 new skills a week. 1 minute to read.
How it works
The tool uses machine learning algorithms to find patterns in your data. You provide example data, and it learns to make predictions or find similarities.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Scikit-learn
Overview
This skill provides comprehensive guidance for machine learning tasks using scikit-learn, the industry-standard Python library for classical machine learning. Use this skill for classification, regression, clustering, dimensionality reduction, preprocessing, model evaluation, and building production-ready ML pipelines.
Installation
Targets scikit-learn 1.9.1, verified with Python 3.13. The release requires Python 3.11+; use its published wheels for your interpreter/platform. See the 1.9 release notes. The bundled scripts and regression tests are executable examples. Reference snippets using caller-provided X, y, columns, or placeholders are illustrative adaptations, not complete standalone programs.
Install the PyPI package scikit-learn (not the deprecated sklearn package on PyPI). Import in code as sklearn.
# Install scikit-learn using uv
uv pip install "scikit-learn==1.9.1"
# Optional: plotting utilities and bundled script dependencies
uv pip install "scikit-learn[plots]==1.9.1" matplotlib pandas
# Commonly used with
uv pip install pandas numpy
Check your version:
import sklearn
print(sklearn.__version__)
When to Use This Skill
Use the scikit-learn skill when:
- Building classification or regression models
- Performing clustering or dimensionality reduction
- Preprocessing and transforming data for machine learning
- Evaluating model performance with cross-validation
- Tuning hyperparameters with grid or random search
- Creating ML pipelines for production workflows
- Comparing different algorithms for a task
- Working with both structured (tabular) and text data
- Need interpretable, classical machine learning approaches
Quick Start
Classification Example
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
# Split data
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, stratify=y, random_state=42
)
# Preprocess
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train_scaled, y_train)
# Evaluate
y_pred = model.predict(X_test_scaled)
print(classification_report(y_test, y_pred))
Complete Pipeline with Mixed Data
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.impute import SimpleImputer
from sklearn.ensemble import GradientBoostingClassifier
# Define feature types
numeric_features = ['age', 'income']
categorical_features = ['gender', 'occupation']
# Create preprocessing pipelines
numeric_transformer = Pipeline([
('imputer', SimpleImputer(strategy='median')),
('scaler', StandardScaler())
])
categorical_transformer = Pipeline([
('imputer', SimpleImputer(strategy='most_frequent')),
('onehot', OneHotEncoder(handle_unknown='ignore'))
])
# Combine transformers
preprocessor = ColumnTransformer([
('num', numeric_transformer, numeric_features),
('cat', categorical_transformer, categorical_features)
])
# Full pipeline
model = Pipeline([
('preprocessor', preprocessor),
('classifier', GradientBoostingClassifier(random_state=42))
])
# Fit and predict
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
Core Capabilities
Five capability areas are documented in references/core_capabilities.md, with per-topic detail in references/supervised_learning.md, references/unsupervised_learning.md, references/model_evaluation.md, references/preprocessing.md, and references/pipelines_and_composition.md:
- Supervised learning — classification and regression estimator families.
- Unsupervised learning — clustering, decomposition, and manifold learning.
- Model evaluation and selection — metrics, cross-validation, and hyperparameter search.
- Data preprocessing — scaling, encoding, imputation, and feature selection.
…
FAQ
Do I need to install anything?
Yes, you need to install the 'scikit-learn' library in your Python environment. The text explains how to do this using the 'uv pip install scikit-learn' command.
What are 'classification' and 'regression'?
'Classification' is predicting a category (e.g., 'yes' or 'no'). 'Regression' is predicting a number (e.g., the price of a house).
What is 'preprocessing'?
It's the step of organizing and cleaning your data before using it to train an AI model. This includes things like scaling numbers or transforming text into something the model can understand.
Details
Original description by the author
Supports machine learning in Python with scikit-learn. Applies when working with supervised learning (classification, regression), unsupervised learning (clustering, dimensionality reduction), model evaluation, hyperparameter tuning, preprocessing, or building ML pipelines. Provides comprehensive reference documentation for algorithms, preprocessing techniques, pipelines, and best practices.
Popularity
- GitHub stars
- 51k
- Ranking position
- #3568
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
13c-metabolic-flux
51kEstimates metabolic fluxes using carbon-13 isotope tracing data. It is useful for analyzing cellular metabolism and biochemical pathways.
adaptyv
51kDesigns protein characterization experiments using the Adaptyv API. It helps estimate costs, submit sequences, and monitor lab results.
aeon
51kPerforms machine learning tasks on time series data. It is useful for classifying, forecasting, detecting anomalies, and finding patterns in sequential data.
alphagenome
51kLooks up precomputed genomic effects for genetic variants. It provides scores and explanations to understand the impact of variants on the genome.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.