Skip to content

Guide · Agent skill

How to use the Scikit-learn Machine Learning Guide agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains how to install and use the scikit-learn agent skill, a set of instructions and reference files that teaches an AI agent to build classical machine learning workflows in Python with the scikit-learn library. It is written for readers who have never used an agent skill. By the end you will know how to install the skill, how to ask for help in plain language, and which bundled scripts you can run yourself.

Scikit-learn Machine Learning GuideK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download the ZIP. Download the scikit-learn skill as a ZIP file from this page.
  2. 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project.
  3. 3Or upload it in the apps. In the Claude apps, open Settings, go to Capabilities, and upload the skill under Skills.
  4. 4Install the Python package. Install scikit-learn from PyPI using uv, not the deprecated sklearn package.
  5. 5Describe your task. Ask for the machine learning task in plain language and name your data file and target column.
  6. 6Run an example script. From the skill directory, run the classification or clustering script with the uv command shown above.
  7. 7Review the results. Check the cross-validation scores, metrics, and any warnings the agent reports before trusting the model.

What does the scikit-learn skill make the agent do?

Once installed, the agent follows the skill's guidance when you ask for classification, regression, clustering, dimensionality reduction, model evaluation, hyperparameter tuning, preprocessing, or ML pipelines. The skill tells the agent to fit preprocessing inside a Pipeline so it is refit for each cross-validation fold, because scaling or imputing before splitting leaks test information into training.

The skill also includes reference files covering supervised learning, unsupervised learning, model evaluation, preprocessing, and pipelines, plus two worked workflows. The agent can read these when it needs detail on a specific algorithm or metric.

  • Pick suitable classification, regression, or clustering methods for a task
  • Prepare tabular data, including mixed numeric and categorical columns
  • Tune hyperparameters with grid or random search
  • Evaluate results with cross-validation and metrics
  • Run two example scripts on local example data

How do you install the scikit-learn skill?

Download the skill as a ZIP file from this page. Then unzip it into one of two places: your personal skills folder at ~/.claude/skills/, or a project-specific .claude/skills/ folder inside the project you are working on. Use the project folder if you want the skill available only for that project.

If you use the Claude apps instead, open Settings, go to Capabilities, and upload the skill under Skills.

The skill's own instructions say to install the Python package scikit-learn from PyPI, not the deprecated sklearn package. You import it in code as sklearn. Installation itself needs network access.

  • Option A: unzip into ~/.claude/skills/ for all projects
  • Option B: unzip into a project's .claude/skills/ folder for one project
  • Option C: upload via Settings → Capabilities → Skills in the Claude apps
uv pip install "scikit-learn==1.9.1"

How do you trigger the skill with natural requests?

You do not need a special command. Describe the machine learning task in plain language and mention your data, and the agent should load the skill when the request matches its scope. The skill's description covers supervised learning, unsupervised learning, model evaluation, hyperparameter tuning, preprocessing, and building ML pipelines.

Be specific about your data and goal. Mention the file, the target column, and whether the task is classification, regression, or clustering. Say if rows are grouped or ordered in time, since the bundled classification script assumes independent rows.

  • Compare a few classifiers on this CSV with stratified cross-validation and report balanced accuracy.
  • Build a scikit-learn Pipeline that imputes and one-hot encodes my categorical columns, then tune it with GridSearchCV.
  • Cluster these customer rows and compare K-Means with DBSCAN, and show how many points DBSCAN labels as noise.
  • Explain why my scaler should be inside the cross-validation pipeline.

How do you run the bundled example scripts?

The skill includes two scripts. Run them from the skill's directory. The classification script runs a complete workflow with preprocessing, model comparison, hyperparameter tuning, and evaluation. The clustering script compares several algorithms and writes PNG plots into the working directory. Its synthetic noise is seeded, so results repeat between runs.

The commands below use uv to install the needed packages for each run. The example commands are taken from the skill's documentation.

  • Classification script: compares models with stratified cross-validation, uses balanced accuracy by default, tunes with GridSearchCV, and shows impurity feature importances with their high-cardinality bias noted.
  • Clustering script: explores cluster counts using inertia and silhouette analysis, compares K-Means, DBSCAN, Agglomerative, and Gaussian Mixture, and visualizes results with a PCA projection.
  • The clustering script reports undefined metrics for degenerate clusterings and DBSCAN noise coverage, and says that internal geometry alone does not prove scientific clusters.
uv run --no-project --with scikit-learn==1.9.1 --with pandas --with matplotlib python scripts/classification_pipeline.py uv run --no-project --with scikit-learn==1.9.1 --with pandas --with matplotlib python scripts/clustering_analysis.py

What do you need before you start?

You need Python 3.11 or newer. scikit-learn depends on NumPy, SciPy, and joblib, which install automatically. The bundled scripts also need pandas and matplotlib. The skill recommends uv for running the example commands, and the commands above use it.

The skill runs local scripts and does not use the network while running. Network access is only needed when you install packages.

  • Python 3.11 or newer
  • scikit-learn (PyPI package name scikit-learn), with NumPy, SciPy, and joblib as dependencies
  • pandas and matplotlib for the bundled scripts
  • uv, recommended for running the example commands

What should you know about safety?

The skill runs scripts, so read them before running them on your machine. The skill's metadata lists Bash among its allowed tools. It does not use the network at runtime.

The skill gives no privacy guidance. If your data is sensitive or personal, review how the data is handled before sending it to an agent or running the workflow on it. The bundled scripts use local example data and need no credentials.

Do not treat the bundled classification script as ready for production on grouped or time-ordered data. It assumes independent rows, and its splits can leak information in that case. Adapt both scripts for that kind of data.

  • Scripts run on your machine, so review them first
  • No network use at runtime; installation needs network access
  • No privacy guidance is included, so review sensitive data yourself
  • Adapt the splits for grouped or time-ordered data

What tips help you get better results?

Give the agent the real shape of your data and your goal. The skill is strongest on structured tabular data. For deep learning or large language model work, use a different tool, since that is outside scikit-learn's scope.

Ask the agent to check its own leakage risks. Ask it to put preprocessing inside a Pipeline and to use stratified splits for classification. Check the version you installed with sklearn.__version__ if results differ from the examples.

  • Start with a baseline model, then compare a few algorithms
  • Ask for cross-validation rather than a single train-test score
  • Use the reference files when you want detail on one algorithm or metric
  • Keep random_state fixed when you want repeatable results
import sklearn print(sklearn.__version__)

What people use it for

  • Comparing several classifiers on a structured customer or survey dataset with stratified cross-validation
  • Building a preprocessing and model Pipeline with imputation, scaling, and one-hot encoding for mixed columns
  • Tuning hyperparameters with GridSearchCV to find better settings for a model
  • Exploring cluster counts and comparing K-Means, DBSCAN, Agglomerative, and Gaussian Mixture on the same rows
  • Learning how train-test splitting, leakage, and metrics work by running the bundled scripts

Frequently asked questions

Is the scikit-learn agent skill free?

The skill's directory listing shows the MIT licence for the repository. The SKILL.md file itself lists a BSD-3-Clause licence, so check the LICENSE file in the source repository before reuse. The scikit-learn library it depends on is installed from PyPI.

What are the requirements for the scikit-learn skill?

You need Python 3.11 or newer and the scikit-learn package from PyPI. The bundled scripts also need pandas and matplotlib, and the skill recommends uv for running the example commands.

Where do I install an agent skill?

Unzip the downloaded ZIP into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload it under Settings, Capabilities, Skills.

Does the skill need internet access?

Installation needs network access to download packages. The skill does not use the network when its scripts run, and the bundled examples use local datasets without credentials.

Can the skill handle deep learning or LLM work?

No. The skill covers classical machine learning with scikit-learn. Deep learning and large language model work are outside its scope, so use a dedicated framework for those tasks.

Why does the classification script warn about leakage?

The bundled classification script assumes independent rows with enough observations per class for stratified cross-validation. For grouped or time-ordered data, its splits can leak information, so the splits must be adapted before you use it for a real model.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are learning practical machine learning on tabular data, need a correct scikit-learn Pipeline with cross-validation, or want to compare several algorithms on a structured dataset. Pick something else for deep learning or LLM work, for production models on grouped or time-ordered data without adapting the scripts, or for sensitive personal data without a separate privacy review.

Download the skill