scikit-learn
Machine learning library for classical supervised/unsupervised models, preprocessing, and model evaluation using NumPy/SciPy.
npx skills add majiayu000/claude-skill-registry --skill skills-skilldoai-skilldo-15 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
The skill demonstrates how to use scikit-learn for classic ML tasks: loading built-in data, splitting data into train/test sets, fitting and predicting with Logistic Regression, building pipelines with a StandardScaler, performing hyperparameter tuning via GridSearchCV, and performing nearest-neighbor queries with NearestNeighbors. It also shows how to evaluate models with accuracy and classification reports, and how to check version and environment details.
How it works
- Import essentials from sklearn (datasets, metrics, train_test_split, Pipeline, StandardScaler, LogisticRegression, GridSearchCV, NearestNeighbors).
- Show a basic train/test split workflow: load_breast_cancer, split, instantiate LogisticRegression, fit, predict, and print accuracy and classification report.
- Demonstrate a preprocessing+model pipeline: include StandardScaler in a Pipeline with LogisticRegression, fit, predict, and print accuracy.
- Demonstrate hyperparameter search: create a Pipeline with StandardScaler and LogisticRegression, define a param_grid for the estimator within the pipeline (e.g., clf__C, clf__penalty, clf__solver), wrap with GridSearchCV, fit on training data, print best_params_, evaluate on test data.
- Demonstrate a nearest-neighbor example: create NearestNeighbors, fit on data, kneighbors on a query set, and print indices and distances.
- Include guidance notes: use step__param naming for pipeline components and n_jobs=-1 for parallelization where applicable.
When to use it
Use when you need concrete, runnable patterns for: a standard supervised learning workflow, properly handling preprocessing to avoid leakage via a Pipeline, and performing simple hyperparameter optimization with GridSearchCV.
What it can touch
- sklearn (imports and classes such as datasets, metrics, train_test_split, Pipeline, StandardScaler, LogisticRegression, GridSearchCV, NearestNeighbors).
- The workflow demonstrates methods: fit, predict, kneighbors, and metrics functions accuracy_score, classification_report.
Caveats
- License line shows BSD-3-Clause for the referenced APIs; ensure project license compatibility when integrating.
- Examples rely on the built-in breast cancer dataset and may not generalize to all datasets without adaptation.
- Hyperparameter grids and model choices are examples; adjust for specific tasks and data characteristics.
## Imports ```python import sklearn from sklearn import datasets, metrics from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression from sklearn.neighbors import NearestNeighbors ``` ## Core Patterns ### Check installation + environment details ✅ Current ```python import sklearn if __name__ == "__main__": print("scikit-learn version:", sklearn.__version__) sklearn.show_versions() ``` * Use `sklearn.show_versions()` when debugging environment issues (BLAS/OpenMP, NumPy/SciPy versions, compiler info). * `sklearn.show_versions()` output starts with "System:" in scikit-learn 1.8.0+. ### Train/test split + fit/predict + metrics ✅ Current ```python from sklearn import datasets, metrics from sklearn.linear_model import LogisticRegression from sklearn.model_selection import train_test_split if __name__ == "__main__": X, y = datasets.load_breast_cancer(return_X_y=True) X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.25, random_state=0, stratify=y ) clf = LogisticRegression(max_iter=2000, solver="lbfgs") clf.fit(X_train, y_
- Imports
- Core Patterns
- Check installation + environment details ✅ Current
- Train/test split + fit/predict + metrics ✅ Current
- Pipeline with preprocessing + model ✅ Current
- Hyperparameter search with GridSearchCV ✅ Current
- Nearest-neighbor index + query ✅ Current
- Configuration
- Pitfalls
- Wrong: Mixing OS package manager installs with pip installs (Linux)
- Right: Use an isolated environment (venv) and verify with sklearn.showversions()
- Wrong: Using pip and python from different environments/interpreters
- Right: Always use python -m pip with the same interpreter you run
- Wrong: Plotting API usage without Matplotlib installed
What does the scikit-learn skill do?
Machine learning library for classical supervised/unsupervised models, preprocessing, and model evaluation using NumPy/SciPy.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill skills-skilldoai-skilldo-15 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
