Assists with building, evaluating, and deploying machine learning models using scikit-learn. Use when performing data preprocessing, feature engineering, model selection, hyperparameter tuning, cross-validation, or building pipelines for classification, regression, and clustering tasks. Trigger words: sklearn, scikit-learn, machine learning, classification, regression, pipeline, cross-validation.
Scikit-learn is a Python machine learning library that provides a consistent API for the full ML workflow: data preprocessing (scaling, encoding, imputation), model selection (classification, regression, clustering), hyperparameter tuning (grid search, randomized search), cross-validation, and pipeline construction. It supports serialization via joblib for production deployment.
ColumnTransformer to apply different transformers to numeric and categorical columns (StandardScaler, OneHotEncoder, SimpleImputer), always within a Pipeline to prevent data leakage.HistGradientBoostingClassifier for best tabular performance, since it handles missing values natively and is faster than GradientBoosting.cross_val_score with 5-fold CV instead of single train/test splits, and use classification_report() instead of accuracy alone since accuracy is misleading on imbalanced datasets.RandomizedSearchCV when the search space exceeds 100 combinations (faster than exhaustive GridSearchCV), and use StratifiedKFold or TimeSeriesSplit as appropriate.Pipeline to ensure transformers fit only on training data, then serialize the full pipeline with joblib.dump() for deployment.permutation_importance() for model-agnostic measurement, SelectKBest for statistical filtering, or feature_importances_ from tree-based models.User request: "Create a model to predict which customers will churn"
Actions:
ColumnTransformer with StandardScaler for numeric features and OneHotEncoder for categoricalPipeline with the transformer and HistGradientBoostingClassifierRandomizedSearchCV using StratifiedKFoldclassification_report() focusing on recall for the churn classOutput: A tuned churn prediction pipeline with preprocessing, model, and evaluation metrics.
User request: "Segment customers based on purchasing behavior"
Actions:
StandardScaler in a pipelineKMeans with silhouette score analysis to determine optimal cluster countPCA for dimensionality reduction and visualizationgroupby on original features to interpret segmentsOutput: Customer segments with labeled profiles and a visual cluster map.
Pipeline to prevent data leakage by fitting transformers only on training data.ColumnTransformer for mixed data types: numeric scaling and categorical encoding in one object.HistGradientBoostingClassifier over GradientBoostingClassifier since it is faster and handles missing values natively.cross_val_score with 5-fold CV rather than a single train/test split since single splits are noisy.RandomizedSearchCV when the search space exceeds 100 combinations.classification_report() not just accuracy, which is misleading on imbalanced datasets.joblib, not just the model, since deployment needs preprocessing too.npx skills add TerminalSkills/scikit-learn下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer