stat-logistic-regression
Skill4 starsChanged 12 days agoMITView on GitHub
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).
In this repository56 other files it gives its agents.
- bioinformatics-env-setupSkill
- design-thermostable-mutationsSkill
- download-gdcSkill
- download-geoSkill
- download-sraSkill
- source-summarizerSkill
- genome-alignment-qcSkill
- genome-read-alignmentSkill
- genome-variant-annotationSkill
- genome-variant-callingSkill
- genome-variant-filteringSkill
- metagenome-assemblySkill
- metagenome-binningSkill
- metagenome-functional-profilingSkill
- metagenome-host-removalSkill
- metagenome-taxonomic-profilingSkill
- ncbi-eutilities-assistantSkill
- ngs-quality-controlSkill
- ngs-read-preprocessingSkill
- paper-to-briefSkill
- predict-protein-heat-stabilitySkill
- researchSkill
- rnaseq-alignment-qcSkill
- rnaseq-differential-expressionSkill
- rnaseq-functional-enrichmentSkill
- rnaseq-read-alignmentSkill
- rnaseq-read-countingSkill
- rnaseq-transcript-quantificationSkill
- rpsblast-assistantSkill
- scrnaseq-cellranger-countSkill
- scrnaseq-cell-type-annotationSkill
- scrnaseq-clusteringSkill
- scrnaseq-differential-expressionSkill
- scrnaseq-integrationSkill
- scrnaseq-quality-controlSkill
- scrnaseq-trajectory-analysisSkill
- search-enaSkill
- search-geoSkill
- search-gsaSkill
- search-ncbi-datasetsSkill
- search-sraSkill
- stat-analyze-distributionSkill
- stat-assess-data-qualitySkill
- stat-bayesian-estimationSkill
- stat-cluster-samplesSkill
- stat-compare-multiple-groupsSkill
- stat-compare-two-groupsSkill
- stat-fit-glmSkill
- stat-fit-linear-modelSkill
- stat-learn-bayesian-networkSkill
- stat-nonlinear-embeddingSkill
- stat-pairwise-correlationSkill
- stat-pcaSkill
- stat-survival-analysisSkill
- structured-intelligence-skill-creatorSkill
- <skill-id>Skill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Test set fraction for performance evaluation (default: 0.2)
- Distinctive: line 28
Read data; validate that outcome column is binary.
- Very specific: line 31
If regularization=none: unpenalized MLE fit for inferential reporting.
- Very specific: line 32
If regularization=l1 or l2: cross-validated penalized fit for prediction-focused modeling.
- Distinctive: line 38
If regularization is used: report optimal lambda from cross-validation and non-zero coefficients at optimal lambda.
- Distinctive: line 40
Write coefficient table(s), performance metrics (TSV), ROC curve plot (PDF), and calibration plot (PDF) to output directory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Logistic Regression
Use When
- User wants to model the probability of a binary outcome (disease/healthy, expressed/not expressed, responder/non-responder)
- User needs odds ratios and their confidence intervals for each predictor
- User wants to evaluate model discrimination with AUC-ROC and calibration
- Common in medical, epidemiological, and genomics classification tasks
Inputs
- Required:
- Data table (CSV or TSV) with a binary outcome column (0/1 or two-level factor) and one or more predictor columns
- Outcome variable name
- Predictor variable name(s)
- Optional:
- Regularization:
none(default),l1(Lasso), orl2(Ridge) - Test set fraction for performance evaluation (default:
0.2) - Output directory (default:
./logit_output)
- Regularization:
Workflow
- Read data; validate that outcome column is binary; encode predictors as needed.
- Split data into training and test sets (stratified by outcome).
- Fit logistic regression on training set:
- If
regularization=none: unpenalized MLE fit for inferential reporting. - If
regularization=l1orl2: cross-validated penalized fit for prediction-focused modeling.
- If
- Report coefficients:
- Unpenalized model: log-odds estimate, standard error, z-statistic, p-value, odds ratio, 95% CI.
- Penalized model: shrunken coefficients and odds ratios; do not report classical p-values/z-statistics from penalized fit.
- Evaluate on test set: compute AUC-ROC, plot ROC curve, compute confusion matrix at 0.5 threshold (accuracy, sensitivity, specificity, PPV, NPV).
- Compute Hosmer-Lemeshow goodness-of-fit test for calibration for the unpenalized model; for penalized models, report calibration curve and Brier score.
- If regularization is used: report optimal lambda from cross-validation and non-zero coefficients at optimal lambda.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results. - Write coefficient table(s), performance metrics (TSV), ROC curve plot (PDF), and calibration plot (PDF) to output directory.
Output Contract
- Coefficient table (TSV, unpenalized): term, log_odds, std_error, z_statistic, p_value, odds_ratio, ci_lower_or, ci_upper_or
- Coefficient table (TSV, penalized): term, log_odds, odds_ratio, selected_at_lambda
- Performance metrics (TSV): auc, accuracy, sensitivity, specificity, ppv, npv, hl_test_p_or_na, brier_score
- ROC curve (PDF)
- Confusion matrix (printed to stdout)
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- Assumes independence of observations; does not account for clustering or repeated measures.
- Requires sufficient events per variable (EPV ≥ 10 recommended) to avoid overfitting.
- Class imbalance can inflate accuracy; examine sensitivity/specificity and AUC.
- Penalized models are prediction-oriented; classical inferential statistics (standard errors/p-values) are not directly interpretable from penalized coefficients.
- Common failure: outcome column with more than two levels — binarize before running.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

