
Machine Learning
- 34 installs
- 4 repo stars
- Updated January 5, 2026
- pluginagentmarketplace/custom-plugin-ai-data-scientist
machine-learning is a Claude Code skill for ai & agent building.
About
machine-learning is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- machine-learning
- AI & Agent Building
- AI-coding skill
Machine Learning by the numbers
- 34 all-time installs (skills.sh)
- Ranked #8,855 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-ai-data-scientist --skill machine-learningAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 34 |
|---|---|
| repo stars | ★ 4 |
| Last updated | January 5, 2026 |
| Repository | pluginagentmarketplace/custom-plugin-ai-data-scientist ↗ |
How do I helps with ai & agent building tasks.?
Helps with ai & agent building tasks.
Who is it for?
Best when you're working on ai & agent building and need structured help with machine learning.
Skip if: Teams with no ai & agent building needs, or anyone wanting a generic chat assistant without this specific workflow.
When should I use this skill?
When you need to helps with ai & agent building tasks., or when machine-learning is a claude code skill for ai & agent building.
What you get
Structured output aligned to machine-learning: machine-learning, AI & Agent Building.
Files
Machine Learning with Scikit-Learn
Build, train, and evaluate ML models for classification, regression, and clustering.
Quick Start
Classification
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
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, random_state=42
)
# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
# Predict
predictions = model.predict(X_test)
probabilities = model.predict_proba(X_test)
# Evaluate
print(classification_report(y_test, predictions))Regression
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_absolute_error, r2_score
model = GradientBoostingRegressor(n_estimators=100)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(f"MAE: {mean_absolute_error(y_test, predictions):.2f}")
print(f"R²: {r2_score(y_test, predictions):.3f}")Clustering
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
# Find optimal k (elbow method)
inertias = []
for k in range(1, 11):
km = KMeans(n_clusters=k, random_state=42)
km.fit(X)
inertias.append(km.inertia_)
plt.plot(range(1, 11), inertias, marker='o')
plt.xlabel('Number of clusters')
plt.ylabel('Inertia')
plt.show()
# Train with optimal k
kmeans = KMeans(n_clusters=5, random_state=42)
clusters = kmeans.fit_predict(X)Model Selection Guide
Classification:
- Logistic Regression: Linear, interpretable, baseline
- Random Forest: Non-linear, feature importance, robust
- XGBoost: Best performance, handles missing data
- SVM: Small datasets, kernel trick
Regression:
- Linear Regression: Linear relationships, interpretable
- Ridge/Lasso: Regularization, feature selection
- Random Forest: Non-linear, robust to outliers
- XGBoost: Best performance, often wins competitions
Clustering:
- K-Means: Fast, spherical clusters
- DBSCAN: Arbitrary shapes, handles noise
- Hierarchical: Dendrogram, no k selection
Evaluation Metrics
Classification:
from sklearn.metrics import (
accuracy_score, precision_score, recall_score,
f1_score, roc_auc_score, confusion_matrix
)
accuracy = accuracy_score(y_true, y_pred)
precision = precision_score(y_true, y_pred, average='weighted')
recall = recall_score(y_true, y_pred, average='weighted')
f1 = f1_score(y_true, y_pred, average='weighted')
roc_auc = roc_auc_score(y_true, y_pred_proba, multi_class='ovr')Regression:
from sklearn.metrics import (
mean_absolute_error, mean_squared_error, r2_score
)
mae = mean_absolute_error(y_true, y_pred)
mse = mean_squared_error(y_true, y_pred)
rmse = np.sqrt(mse)
r2 = r2_score(y_true, y_pred)Cross-Validation
from sklearn.model_selection import cross_val_score
scores = cross_val_score(model, X, y, cv=5, scoring='f1_weighted')
print(f"CV F1: {scores.mean():.3f} (+/- {scores.std() * 2:.3f})")Hyperparameter Tuning
from sklearn.model_selection import GridSearchCV
param_grid = {
'n_estimators': [100, 200, 300],
'max_depth': [5, 10, 15],
'min_samples_split': [2, 5, 10]
}
grid_search = GridSearchCV(
RandomForestClassifier(),
param_grid,
cv=5,
scoring='f1_weighted',
n_jobs=-1
)
grid_search.fit(X_train, y_train)
print(f"Best params: {grid_search.best_params_}")
print(f"Best score: {grid_search.best_score_:.3f}")
# Use best model
best_model = grid_search.best_estimator_Feature Engineering
from sklearn.preprocessing import StandardScaler, LabelEncoder
# Scaling
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)
# Encoding
encoder = LabelEncoder()
y_encoded = encoder.fit_transform(y)
# Polynomial features
from sklearn.preprocessing import PolynomialFeatures
poly = PolynomialFeatures(degree=2)
X_poly = poly.fit_transform(X)Pipeline
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
pipeline = Pipeline([
('scaler', StandardScaler()),
('classifier', RandomForestClassifier(n_estimators=100))
])
pipeline.fit(X_train, y_train)
predictions = pipeline.predict(X_test)Best Practices
1. Always split data before preprocessing 2. Use cross-validation for reliable estimates 3. Scale features for distance-based models 4. Handle class imbalance (SMOTE, class weights) 5. Check for overfitting (train vs test performance) 6. Save models with joblib or pickle
# Machine Learning Model Configuration Template
# Use this template for consistent ML project configurations
model:
name: "random_forest_classifier"
type: "classification" # classification, regression, clustering
random_state: 42
data:
test_size: 0.2
validation_size: 0.1
shuffle: true
stratify: true
hyperparameters:
n_estimators: 100
max_depth: null
min_samples_split: 2
min_samples_leaf: 1
max_features: "sqrt"
training:
cross_validation:
enabled: true
folds: 5
scoring: "accuracy" # accuracy, f1, roc_auc, precision, recall
early_stopping:
enabled: false
patience: 10
evaluation:
metrics:
- accuracy
- precision
- recall
- f1_score
- roc_auc
- confusion_matrix
plots:
- roc_curve
- confusion_matrix
- feature_importance
- learning_curve
output:
model_path: "models/"
metrics_path: "results/"
save_format: "joblib" # joblib, pickle, onnx
Machine Learning Assets
Configuration templates and reusable assets for ML projects.
Contents
| File | Type | Purpose |
|---|---|---|
model_config.yaml | YAML | Model configuration template |
Usage
import yaml
with open('model_config.yaml') as f:
config = yaml.safe_load(f)
model_params = config['hyperparameters']Machine Learning Guide
Comprehensive guide for building ML models with scikit-learn.
Model Selection Flowchart
Is it supervised learning?
├── Yes → Is the target categorical?
│ ├── Yes → Classification
│ │ ├── Binary → LogisticRegression, RandomForestClassifier, XGBoost
│ │ └── Multi-class → RandomForestClassifier, GradientBoosting, Neural Networks
│ └── No → Regression
│ └── LinearRegression, RandomForestRegressor, XGBRegressor
└── No → Unsupervised Learning
├── Clustering → KMeans, DBSCAN, Hierarchical
└── Dimensionality Reduction → PCA, t-SNE, UMAPBest Practices
1. Data Preparation
- Always split data before any preprocessing
- Use stratified splits for imbalanced datasets
- Scale features for distance-based algorithms
2. Feature Engineering
- Handle missing values appropriately
- Create meaningful features from domain knowledge
- Remove highly correlated features
3. Model Training
- Use cross-validation for reliable estimates
- Start simple, add complexity as needed
- Monitor for overfitting
4. Evaluation
- Use appropriate metrics for your problem
- Consider business context, not just accuracy
- Validate on held-out test set
Common Pitfalls
1. Data Leakage: Preprocessing before splitting 2. Overfitting: High train, low test performance 3. Wrong Metric: Using accuracy on imbalanced data 4. Ignoring Features: Not understanding feature importance
Machine Learning References
Documentation and guides for ML skill.
Contents
| Document | Description |
|---|---|
GUIDE.md | Comprehensive ML guide |
Quick Links
- Main SKILL.md
- Plugin README
Machine Learning Scripts
Executable scripts for ML model training and evaluation.
Contents
| Script | Purpose | Usage |
|---|---|---|
train_model.py | Train and evaluate ML models | python train_model.py |
Requirements
- Python 3.9+
- scikit-learn
- pandas
- numpy
- pyyaml
- joblib
#!/usr/bin/env python3
"""
Machine Learning Training Script
Trains and evaluates ML models with cross-validation.
"""
import yaml
import joblib
import numpy as np
import pandas as pd
from pathlib import Path
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score
from sklearn.preprocessing import StandardScaler
def load_config(config_path: str = "assets/model_config.yaml") -> dict:
"""Load model configuration from YAML file."""
with open(config_path) as f:
return yaml.safe_load(f)
def prepare_data(X, y, config: dict):
"""Split data into train/test sets."""
return train_test_split(
X, y,
test_size=config['data']['test_size'],
random_state=config['model']['random_state'],
stratify=y if config['data']['stratify'] else None
)
def train_model(X_train, y_train, config: dict):
"""Train the ML model based on configuration."""
model_type = config['model']['name']
params = config['hyperparameters']
params['random_state'] = config['model']['random_state']
if model_type == "random_forest_classifier":
model = RandomForestClassifier(**params)
elif model_type == "gradient_boosting_classifier":
model = GradientBoostingClassifier(**params)
else:
raise ValueError(f"Unknown model type: {model_type}")
model.fit(X_train, y_train)
return model
def evaluate_model(model, X_test, y_test, config: dict) -> dict:
"""Evaluate the trained model."""
predictions = model.predict(X_test)
probabilities = model.predict_proba(X_test)[:, 1] if hasattr(model, 'predict_proba') else None
results = {
'classification_report': classification_report(y_test, predictions, output_dict=True),
'confusion_matrix': confusion_matrix(y_test, predictions).tolist(),
}
if probabilities is not None:
results['roc_auc'] = roc_auc_score(y_test, probabilities)
return results
def cross_validate(model, X, y, config: dict) -> dict:
"""Perform cross-validation."""
cv_config = config['training']['cross_validation']
if not cv_config['enabled']:
return {}
scores = cross_val_score(
model, X, y,
cv=cv_config['folds'],
scoring=cv_config['scoring']
)
return {
'cv_scores': scores.tolist(),
'cv_mean': float(np.mean(scores)),
'cv_std': float(np.std(scores))
}
def save_model(model, config: dict, metrics: dict):
"""Save trained model and metrics."""
output_dir = Path(config['output']['model_path'])
output_dir.mkdir(parents=True, exist_ok=True)
model_path = output_dir / f"{config['model']['name']}.joblib"
joblib.dump(model, model_path)
print(f"Model saved to: {model_path}")
return model_path
def main():
"""Main training pipeline."""
config = load_config()
# Example usage - replace with actual data loading
print("Load your data and call train_model()")
print("Example:")
print(" X_train, X_test, y_train, y_test = prepare_data(X, y, config)")
print(" model = train_model(X_train, y_train, config)")
print(" results = evaluate_model(model, X_test, y_test, config)")
if __name__ == "__main__":
main()
Related skills
FAQ
What does machine-learning do?
machine-learning is a Claude Code skill for ai & agent building.
When should I use machine-learning?
When you need to helps with ai & agent building tasks., or when machine-learning is a claude code skill for ai & agent building.
What are the main capabilities?
machine-learning; AI & Agent Building; AI-coding skill.