Skip to main content
skill CX Codex

regression-modeler — Claude Code skill: regression on CSV

Fits OLS or logistic regression on your table and explains the coefficients in plain language. Handy when you need significance checks without writing the stats code yourself.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add zebbern/claude-code-guide --skill regression-modeler -a claude-code
Open on GitHub

What regression-modeler does

The skill runs scripts/regression_analyzer.py against a CSV, TSV, Excel or JSON file. Point --target at the dependent column and pass predictors with --features as a comma-separated list. Leave features out and every numeric column gets used.

Linear output covers coefficients, R² and adjusted R², the F-test, AIC/BIC and the Durbin — Watson statistic. Logistic output gives coefficients, odds ratios, pseudo-R² and a likelihood ratio test. VIF is computed per predictor with warning levels, so multicollinearity shows up right away. The default --type auto flips to logistic when the target holds only zeros and ones.

You need Python 3.8+ plus pandas, numpy, statsmodels and scipy. Rows with missing values are dropped unless you pass --keep-na, which is meant for debugging. Results go to stdout or to a JSON file via --output.

What it helps with

  • fit a linear regression on a spreadsheet
  • test predictor significance with p-values
  • spot multicollinearity through VIF
  • build a logistic model for a binary target
  • get metric explanations in plain language

Example prompts for the agent

  • run a regression on data.csv with price as the target
  • fit a logistic regression for churn using age, income, tenure
  • save the regression results to result.json

How to install regression-modeler

1Skills CLI (Vercel)

npx skills add zebbern/claude-code-guide --skill regression-modeler -a claude-code

2Manually: put the files in place

~/.claude/skills/regression-modeler/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/regression-modeler/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about regression-modeler

How do I install regression-modeler in Claude?

Run npx skills add zebbern/claude-code-guide --skill regression-modeler -a claude-code. The skill lands in ~/.claude/skills/regression-modeler/SKILL.md.

What does regression-modeler do?

It fits OLS or logistic regression on an uploaded table and reports coefficients, R², p-values and VIF, with plain-language notes on what each metric means.

What do I need to run it?

Python 3.8+ and the pandas, numpy, statsmodels and scipy packages, installed with pip install pandas numpy statsmodels scipy.

Source text

SKILL.md · MIT
---
name: regression-modeler
description: "Run regression analysis (OLS or logistic) on uploaded CSV/Excel data, generating coefficients, R², p-values, VIF, and plain-language interpretation. Triggered by requests for regression modeling, fitting data, testing significance, checking multicollinearity, or keywords like OLS, logit, coefficient, p-value, or R-squared."
license: MIT
---

# regression-modeler

Automated regression modeling tool — performs linear regression (OLS) or logistic regression (Logit) on tabular data, producing comprehensive statistical results with plain-language interpretation.

## Capabilities

| Feature | Description |
|---------|-------------|
| Linear Regression | OLS with coefficients, R², adjusted R², F-test, AIC/BIC, Durbin-Watson |
| Logistic Regression | Logit with coefficients, Odds Ratio, Pseudo R², likelihood ratio test |
| Multicollinearity Detection | VIF values for each predictor with warning levels |
| Plain-Language Interpretation | Clear explanations of what each metric and coefficient means |
| Auto Detection | Automatically switches to logistic regression when the target is binary (0/1) |

## Quick Start

```bash
# Linear regression: predict price using all numeric columns as predictors
python3 scripts/regression_analyzer.py data.csv --target price

# Logistic regression: predict churn (0/1) with specified features
python3 scripts/regression_analyzer.py users.csv --target churn --features "age,income,tenure"

# Save results to JSON
python3 scripts/regression_analyzer.py data.csv --target sales --output result.json
```

## Detailed Usage

### Basic Invocation

```bash
python3 scripts/regression_analyzer.py <data_file> --target <target_column> [options]
```

### Specifying Regression Type

```bash
# Force linear regression
python3 scripts/regression_analyzer.py data.csv -t y --type linear

# Force logistic regression
python3 scripts/regression_analyzer.py data.csv -t label --type logistic

# Auto-detect (default)
python3 scripts/regression_analyzer.py data.csv -t y --type auto
```

### Selecting Feature Columns

```bash
# Manually specify (comma-separated)
python3 scripts/regression_analyzer.py data.csv -t price -f "sqft,bedrooms,bathrooms"

# Omit to automatically use all numeric columns
python3 scripts/regression_analyzer.py data.csv -t price
```

## Parameters

| Parameter | Short | Required | Default | Description |
|-----------|-------|----------|---------|-------------|
| `input` | — | Yes | — | Input file path (CSV/TSV/Excel/JSON) |
| `--target` | `-t` | Yes | — | Target variable (dependent variable) column name |
| `--features` | `-f` | No | All numeric columns | Predictor column names, comma-separated |
| `--type` | `-T` | No | `auto` | Regression type: `linear` / `logistic` / `auto` |
| `--output` | `-o` | No | stdout | Output JSON file path |
| `--no-const` | — | No | `false` | Do not add an intercept term |
| `--keep-na` | — | No | `false` | Keep rows with missing values (for debugging) |

## Output Structure (JSON)

```json
{
  "type": "linear",
  "r_squared": 0.8523,
  "r_squared_adj": 0.8471,
  "f_statistic": 162.34,
  "f_p_value": 0.0,
  "coefficients": {
    "sqft": {"coefficient": 135.42, "p_value": 0.0001, ...},
    "bedrooms": {"coefficient": 8021.5, "p_value": 0.032, ...}
  },
  "vif": {"sqft": 2.31, "bedrooms": 1.87},
  "interpretation": {
    "model_summary": ["R² = 0.8523 (good model fit...)"],
    "variable_analysis": ["sqft: coefficient = 135.42... positive effect..."]
  }
}
```

## Dependencies

- Python 3.8+
- pandas
- numpy
- statsmodels
- scipy

```bash
pip install pandas numpy statsmodels scipy
```

© zebbern · MIT · zebbern/claude-code-guide

Similar skills

All skills for Data and databases →

From the same set12

secure-code-review This skill walks your code through all ten OWASP Top 10 categories and returns a report with vulnerable examples and working fixes. Useful before a release or when reviewing unfamiliar code. CX Codex +1 ★ 4,676repo stars project-sizing-guide Produces effort estimates with PERT, T-shirt sizing or Function Point Analysis. Useful when someone asks how long a feature will take. CX Codex +1 ★ 4,676repo stars pipeline-blueprint The skill hands you CI/CD pipeline templates for GitHub Actions and GitLab CI, picked by project type. Useful when you're setting up CI or cleaning up a pipeline that grew messy. CX Codex +1 ★ 4,676repo stars network-101 A skill that walks the agent through standing up and testing HTTP, HTTPS, SNMP and SMB in a pentest lab, from service config to log analysis. CX Codex +1 ★ 4,676repo stars linux-shell-scripting A skill that hands your agent ready bash templates for backups, resource monitoring, user management and log parsing. Useful when you want a working script, not a sketch. CX Codex +1 ★ 4,676repo stars dev-guide-generator Turns a technical topic into a full tutorial: prerequisites, environment setup, core steps, error troubleshooting and a closing cheatsheet. CX Codex +1 ★ 4,676repo stars database-scout A read-only skill for SQLite and PostgreSQL: lists tables, inspects schemas, previews rows and renders Mermaid ER diagrams. Queries stay read-only. CX Codex +1 ★ 4,676repo stars cv-tailor This skill compares your resume against a job description, scores keyword coverage, and rewrites experience bullets with STAR and numbers. CX Codex +1 ★ 4,676repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor