Packs / data-science-public
linear-regression-report
fit a simple linear regression on two CSV columns and report slope, intercept and R-squared
Install
logicpacks pack use data-science-public/linear-regression-reportget_pack data-science-public/linear-regression-reportThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
python-stdlibpandas - Checks: 2 in
outcome/checks.yaml - Code:
regress.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
Fit a simple linear regression on two CSV columns and report slope, intercept and R-squared.
Steps
- Plot or eyeball the data first; check the relation looks linear.
- Run regress.py.
- Report slope with units and R^2; don't extrapolate far outside the data.
Edge cases
- Outliers dominate OLS; check residuals.
- Constant x gives division by zero (no fit possible).
Don'ts
- Don't read correlation as causation.
Routes (free first)
python-stdlib:code/regress.py(no install).pandas(free): same job in pandas for large files (pip install pandas)