Logistic regression
Skill WindcleaverDev/regkit/.agents/skills/logistic-regression
Statistically rigorous regression skills for Claude — Python computes, the model narrates.
npx -y skills add WindcleaverDev/regkit --skill logistic-regressionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.9 KB, as published. Nobody here has run it
logistic-regression
Fits a binary logistic regression with statsmodels, produces a LogisticRegressionReport validating against the pack schema, renders a standalone HTML report.
When to use
- Target has exactly two distinct values (0/1, yes/no, true/false, two category names)
- User asks for logistic regression, "model a binary outcome", "predict yes/no"
- pre-analysis identified the target as
binary - User wants odds ratios or predicted probabilities, not just coefficient signs
Quick start
python .agents/skills/logistic-regression/scripts/fit.py \
--data path/to/data.csv \
--target churned \
--positive-class yes \
--features tenure,monthly_charges,contract_type \
--output results/
Outputs results/report.json (LogisticRegressionReport) and results/report.html.
Arguments
| Flag | Default | Description |
|---|---|---|
--data | required | CSV or Parquet path |
--target | required | Binary target column (exactly 2 unique values) |
--positive-class | auto | Which value to treat as 1 (default: 1 if 0/1 numeric, else alphabetically last) |
--features | required | Comma-separated columns, or all |
--output | required | Output directory |
--robust-se | off | HC0–HC3 robust standard errors |
--threshold | 0.5 | Classification decision threshold |
--dataset-name | "" | Label shown in report header |
Outputs
out/
├── report.json # LogisticRegressionReport (Pydantic schema)
└── report.html # Self-contained HTML with Plotly charts
Report sections
- Fit summary — AUC, Brier score, McFadden pseudo-R², AIC/BIC, positive rate
- Marginal effects — AME forest plot + table (the primary interpretation surface)
- Coefficients — log-odds table + odds ratio forest plot (log scale)
- Classification performance — confusion matrix, accuracy, balanced accuracy, F1
- ROC curve — AUC annotated
- Calibration — reliability diagram with Brier score
- Interpretation — AME-based plain-English facts per feature
- Flags & recommendations
Interpreting the output
Lead with marginal effects (AME), not raw log-odds. AME tells you the average change in predicted probability per unit increase in each feature — the quantity humans find most interpretable.
- AUC 0.5 = random, 0.7 = OK, 0.8 = good, 0.9+ = strong
- Brier score 0.25 = baseline for balanced classes (lower is better)
CLASS_IMBALANCEflag: accuracy is misleading; prefer balanced accuracy and AUC
Chaining
After fit, run diagnostics for assumption checks adapted to logistic models (log-odds linearity, leverage analysis). Or run model-comparison alongside an OLS fit on the same binary target.
References
references/odds_ratio_interpretation.mdreferences/marginal_effects.mdreferences/class_imbalance.mdreferences/threshold_choice.md