logistic-regression — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited logistic-regression (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use for binary outcome prediction where interpretability matters as much as accuracy. Triggers:
For complex non-linear interactions, suggest a tree-based model after fitting logistic as the baseline. For continuous outcomes, use linear-regression. For time-to-event, use survival-analysis.
| Input | Why it matters |
|---|---|
| Binary target | What you're predicting (must be 0/1 or boolean) |
| Feature set | Predictors, with clear definitions |
| Observation grain | Per user / per session / per opportunity |
| Time cutoffs | Feature window must end BEFORE outcome window starts (leakage check) |
| Train/test strategy | Temporal split for production models, random split for exploratory |
data-quality-audit skill). print(y.value_counts(normalize=True))class_weight='balanced' and look at PR-AUC, not ROC-AUC alone train = df[df['as_of_date'] < cutoff]
test = df[df['as_of_date'] >= cutoff]Random splits are only acceptable for exploratory analysis.
LogisticRegression(C=1.0, penalty='l2') in sklearn). odds_ratio = exp(beta)
"A 1-unit increase in X multiplies the odds of Y by <odds_ratio>"# Logistic Regression: <outcome>
## Setup
- **Outcome:** <binary_target> (positive class = <description>, base rate = <X%>)
- **Observation unit:** <user_id> as of <as_of_date>
- **Sample size:** <N_train> train, <N_test> test (temporal split at <date>)
- **Features:** <N> features (<categories>)
## Performance (test set)
| Metric | Value | Notes |
|---|---|---|
| AUC-ROC | 0.78 | Solid ranking |
| AUC-PR | 0.34 | Base rate 0.08 (random baseline = 0.08) |
| Brier score | 0.072 | |
| Calibration | well-calibrated below 0.4, slight underprediction above | see plot |
| Threshold @ 0.30 | precision 0.42, recall 0.61, F1 0.50 | chosen for business cost |
## Top coefficients (sorted by absolute effect)
| Feature | Coef (β) | Odds Ratio | Interpretation |
|---|---|---|---|
| days_since_last_login | +0.082 | 1.085 | +1 day → +8.5% odds of churn |
| support_tickets_30d | +0.610 | 1.840 | +1 ticket → +84% odds |
| has_active_subscription | -1.420 | 0.242 | active sub → -76% odds |
| ... | | | |
## Calibration check
<observed vs predicted probability table, by decile>
| Decile | Predicted | Observed | n |
|---|---|---|---|
| 1 (lowest) | 0.012 | 0.014 | 1,240 |
| 5 (middle) | 0.103 | 0.108 | 1,240 |
| 10 (highest) | 0.612 | 0.587 | 1,240 |
## Operational impact at chosen threshold
- Flag rate: <X%> of users
- Precision: <X%> (of flagged, correctly identified)
- Recall: <X%> (of true positives, caught)
- Estimated business impact: <e.g., "If we contact all 5,200 flagged users this month, we expect to retain 460 (lift over no-action: +180 retained)">
## Caveats
- <e.g., model trained on stable period; performance may degrade if user base shifts>
- <e.g., features 1-3 require real-time computation; ensure pipeline supports>
- Calibration may drift; re-evaluate quarterly.
## Next steps
- <e.g., A/B test intervention on flagged users>
- <e.g., monitor model performance over next 30 days>
- <e.g., consider tree-based model if interaction terms become important>scripts/fit_logistic.py — End-to-end fit + evaluate + report from a CSV.python scripts/fit_logistic.py \
--input training_data.csv \
--target churned \
--features feature_list.txt \
--split-by signup_date \
--split-date 2026-03-01data-quality-audit — always run on inputs firstlinear-regression — for continuous outcomessurvival-analysis — when timing matterscausal-inference — if you need to estimate intervention effect, not just predictstakeholder-readout — for packaging the model output~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.