Agent skill

Lasso Logistics Analysis

by aipoch in aipoch/medical-research-skills

A skill your agent uses when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path…

MITAuto-check passedData & Analytics

Install Lasso Logistics Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill lasso-logistics-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills lasso-logistics-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'awesome-med-research-skills/Data Analysis/lasso-logistics-analysis' .claude/skills/lasso-logistics-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lasso-logistics-analysis
GitHub stars
2k
Token cost
~2.3k tokens
SKILL.md length
799 words
Files
22 (incl. scripts, references)
Skills in repo
578
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path…

  • Works in 4 steps: Validate Input → Prepare Modeling Matrix → Fit LASSO Logistic Regression → …
  • Building a binary classification model from an expression matrix
  • SKILL.md covers When to Read External Files, Usage, Arguments and Input Format, plus 7 more sections
  • Runs R scripts from its folder

What it does

Lasso Logistics Analysis is an agent skill from aipoch/medical-research-skills. Use when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path visualization. NOT for: multiclass classification, survival/Cox models, or ordinary linear regression.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 25 other files, including scripts and reference files (for example `eval_report_lasso-logistics-analysis_result.json`, `references/algorithm.md` and `references/cli-guide.md`).

It sits in Data & Analytics, covering Machine learning. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Building a binary classification model from an expression matrix
  • Other omics feature matrix with LASSO logistic regression
  • Cross-validation
  • Coefficient path visualization

Example prompts

  • “/lasso-logistics-analysis”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Validate Input
  2. Prepare Modeling Matrix
  3. Fit LASSO Logistic Regression
  4. Save Results and Visualizations

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 8 files in scripts/ (R, from the files we listed), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Lasso Logistics Analysis loads about 2.3k tokens when it runs, and up to ~5.3k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 799 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~76
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 799 words, ~2,256 tokens.

Download SKILL.mdSave it as .claude/skills/lasso-logistics-analysis/SKILL.md (or your agent's skills folder). This skill also uses 21 other files; get the full folder from GitHub.
name
lasso-logistics-analysis
description
Use when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path visualization. NOT for: multiclass classification, survival/Cox models, or ordinary linear regression.

LASSO Logistic Regression Analysis

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdLASSO objective function, cross-validation, and interpretation
Need to run analysisscripts/main.RExecute: Rscript scripts/main.R --input_file ... --group_file ...
Encounter errorsreferences/troubleshooting.mdCommon errors and solutions
Need CLI examplesreferences/cli-guide.mdDetailed CLI usage examples
Need test datatests/data/Sample input files for testing
Need workflow implementation detailsscripts/run_analysis.RInspect orchestration, outputs, and file-writing behavior
Need input-validation or error-handling detailsscripts/utils.R, scripts/io.RInspect validation, parsing, logging, and standardized safeguards

Usage

bash
Rscript scripts/main.R \
  --input_file ./expression_matrix.csv \
  --group_file ./groups.csv \
  --case_group case \
  --control_group control \
  --output_dir ./output/ \
  --nfolds 10 \
  --timeout_seconds 1800 \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-i--input_filecharacterrequiredExpression matrix file (features as rows, samples as columns)
-g--group_filecharacterrequiredGroup file with sample and group columns
-c--case_groupcharacterrequiredCase class label encoded as 1
-t--control_groupcharacterrequiredControl class label encoded as 0
-f--featurecharacterNULLOptional feature list file or comma-separated feature names
-n--nfoldsinteger10Cross-validation folds: 3, 5, 7, 10
--cv_titlecharacter""Optional title for the cross-validation plot
--path_titlecharacter""Optional title for the coefficient path plot
--timeout_secondsinteger1800Maximum elapsed runtime in seconds
-o--output_dircharacter./output/Output directory
-s--seedinteger42Random seed for reproducibility

Input Format

Expression Matrix (input_file)

Features as rows, samples as columns, CSV or TSV format with feature IDs in the first column.

csv
,Sample01,Sample02,Sample03
TSPAN6,1.8479,1.8318,3.8276
TNMD,0.0349,0.0533,1.3889
Group File (group_file)

CSV or TSV with sample IDs and binary-group labels.

csv
sample,group
Sample01,case
Sample02,control
Sample03,case
Optional Feature File (feature)

One feature per line, or pass a comma-separated feature list directly on the CLI.

text
TNMD
DPM1
SCYL3

Output Files

FileDescription
coefficient.csvAll coefficients at lambda.min
feature_matrix.csvSample-level matrix with original group labels and binary event column
selected_features.txtNon-zero features at lambda.min excluding the intercept, when available
missing_features.txtRequested features not found in the matrix, when applicable
lasso_lambda_binary_plot.pdfCross-validation curve
lasso_var_binary_plot.pdfCoefficient path plot
session_info.txtR session and package version info

Workflow

Step 1: Validate Input

WHEN checking validation rules or parsing behavior, READ: scripts/utils.R and scripts/io.R

  • Check file existence
  • Read expression matrix and group file
  • Verify samples match between files
  • Ensure both classes are present with at least 2 samples per class
Step 2: Prepare Modeling Matrix

WHEN checking class encoding or feature filtering behavior, READ: scripts/modeling.R

  • Encode case_group as 1 and control_group as 0
  • Optionally restrict to a user-supplied feature panel
  • Transpose expression data to sample-by-feature format
Step 3: Fit LASSO Logistic Regression

WHEN understanding the statistical method or lambda selection, READ: references/algorithm.md

  • Train a binomial glmnet model with alpha = 1
  • Run cv.glmnet to select the optimal lambda
  • Extract coefficients at lambda.min
Step 4: Save Results and Visualizations

WHEN checking output generation or plot behavior, READ: scripts/run_analysis.R and scripts/plotting.R

  • Save flat output files directly into output_dir
  • Generate cross-validation and coefficient path PDF plots
  • Leave plot titles empty by default unless the user provides custom titles

Methods

LASSO Logistic Regression

The model minimizes binomial deviance with an L1 penalty, shrinking weak coefficients to zero and performing embedded feature selection.

Show full SKILL.md (319 more words)Show less
Cross-Validation

cv.glmnet evaluates candidate lambda values across nfolds folds and reports lambda.min and lambda.1se.


Examples

Basic Usage
bash
Rscript scripts/main.R \
  -i ./expression_matrix.csv \
  -g ./groups.csv \
  -c case \
  -t control \
  -o ./output
Use a Feature Panel
bash
Rscript scripts/main.R \
  -i ./expression_matrix.csv \
  -g ./groups.csv \
  -c case \
  -t control \
  -f ./genes.txt \
  -o ./output
Custom Folds and Seed
bash
Rscript scripts/main.R \
  -i ./expression_matrix.csv \
  -g ./groups.csv \
  -c case \
  -t control \
  -n 5 \
  --timeout_seconds 900 \
  -s 123 \
  -o ./output
Custom Plot Titles
bash
Rscript scripts/main.R \
  -i ./expression_matrix.csv \
  -g ./groups.csv \
  -c case \
  -t control \
  --cv_title "LASSO Cross-Validation" \
  --path_title "LASSO Coefficient Paths" \
  --timeout_seconds 1200 \
  -o ./output

Error Handling

Common Errors
ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file does not existCheck file path
SKILL_EMPTY_FILEAn input file exists but contains no dataVerify the file is not empty
SKILL_PARSE_ERRORThe input file cannot be parsed as CSV or TSVCheck delimiters, headers, and encoding
SKILL_FILE_WRITE_ERRORThe output directory cannot be created or writtenCheck output path and permissions
SKILL_EMPTY_DATAThe loaded table has no usable rows or columnsVerify that the input file contains valid data
SKILL_MISSING_COLUMNSThe group file does not provide the required columnsProvide sample and group columns
SKILL_INVALID_TYPEA parameter or data field has the wrong typeEnsure numeric fields are numeric and strings are valid
SKILL_SAMPLE_MISMATCHSample IDs differ between matrix and group fileMake names match exactly
SKILL_INVALID_GROUPCase/control labels not found in group fileCheck --case_group and --control_group
SKILL_INVALID_DATAToo few classes, samples, or valid featuresReview input structure and feature list
SKILL_INVALID_PARAMETERUnsupported nfolds or empty parameterUse documented argument values
SKILL_DEPENDENCY_MISSINGRequired R package not installedInstall missing CRAN package
SKILL_TIMEOUTAnalysis exceeded the configured time limitReduce feature count or increase --timeout_seconds
SKILL_MEMORY_ERRORThe runtime environment cannot allocate enough memoryReduce matrix size or available workload
SKILL_RUNTIME_ERRORAn unexpected runtime error occurredReview the exact console error and retry

IF error persists, READ: references/troubleshooting.md


Testing

Test with Sample Data
bash
# Check help
Rscript scripts/main.R --help

# Run with sample data
Rscript scripts/main.R \
  -i tests/data/expression_matrix.csv \
  -g tests/data/groups.csv \
  -c case \
  -t control \
  -f tests/data/genes.csv \
  --timeout_seconds 1800 \
  -o tests/output
Validation Commands
bash
# Check coefficient output
ls -la tests/output/coefficient.csv

# Check plots exist
ls -la tests/output/lasso_lambda_binary_plot.pdf
ls -la tests/output/lasso_var_binary_plot.pdf

Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • requireNamespace() dependency checks
  • Session info recording
  • Timeout control with --timeout_seconds
  • Temp file cleanup
  • File reading instructions in SKILL.md
  • Modular script structure (<150 lines per file)
  • Test data provided
  • Error handling with SKILL_* codes
  • Scripts in scripts/ directory
  • References in references/ directory

Last updated: 2026-04-17 | Version: 1.0.0

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 21 other files (scripts, references) in awesome-med-research-skills/Data Analysis/lasso-logistics-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_lasso-logistics-analysis_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/cli_utils.R
  • scripts/io.R
  • scripts/main.R
  • scripts/modeling.R
  • scripts/plotting.R
  • scripts/run_analysis.R
  • scripts/runtime_utils.R
  • scripts/utils.R
  • tests/data/expression_matrix.csv
  • tests/data/genes.csv
  • tests/data/groups.csv
  • tests/run_tests.R
  • … and 5 more

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Lasso Logistics Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lasso Logistics Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lasso Logistics Analysis this skillaipoch/medical-research-skills2k—~2.3kAutomated safety check: PassMIT
Scikit LearnzLanqing/codex-claude-academic-skills4.7k16 repos~3.9kAutomated safety check: PassBSD-3-Clause
Agentic Kaggle WorkflowFrankS-IntelLab/agentic-kaggle-skill188—~4kAutomated safety check: PassMIT
Senior Data ScientistRaidriar7170/hermes-skilleval1255 repos~1.4kAutomated safety check: PassMIT
Geomlitalo-goncalves/geoML109—~4.6kAutomated safety check: PassGPL-3.0
QuantMind Training Config Generatorqusong0627/QuantMind1.7k—~1.5kAutomated safety check: PassAGPL-3.0

Similar skills

  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.7k GitHub starsUsed in 16 repos~3.9k tokens
    Data & AnalyticsAuto-check passed
  • Agentic Kaggle Workflow

    FrankS-IntelLab/agentic-kaggle-skill

    Takes a Kaggle competition from rules and validation design through baselines, ensembling and notebook architecture to a scored submission.

    188 GitHub stars~4k tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Senior Data Scientist

    Raidriar7170/hermes-skilleval

    World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics.

    125 GitHub starsUsed in 5 repos~1.4k tokens
    Data & AnalyticsAuto-check passed
  • Geoml

    italo-goncalves/geoML

    Working knowledge of the geoML Python package (github.com/italo-goncalves/geoML): variational Gaussian processes for spatial data, implicit geological modelling, block models, drillhole data…

    109 GitHub stars~4.6k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Turns a plain-language model training request into a validated QuantMind training config file that can be imported from the Model Training page.

    1.7k GitHub stars~1.5k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Retention Analysis

    liangdabiao/claude-data-analysis-ultra-main

    Analyze user retention and churn using survival analysis, cohort analysis, and machine learning.

    290 GitHub stars~1.3k tokensUpdated 5 mo ago
    Data & AnalyticsAuto-check: notes

More from aipoch/medical-research-skills

All 578 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 22 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 22 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 22 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 22 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 22 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed

Questions about Lasso Logistics Analysis

What does Lasso Logistics Analysis do?

A skill your agent uses when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path…. Lasso Logistics Analysis is an agent skill from aipoch/medical-research-skills. Use when building a binary classification model from an expression matrix or other omics feature matrix with LASSO logistic regression, cross-validation, and coefficient path visualization.

When should I use Lasso Logistics Analysis?

Lasso Logistics Analysis fits situations like: building a binary classification model from an expression matrix; other omics feature matrix with LASSO logistic regression; cross-validation; coefficient path visualization.

How do I install Lasso Logistics Analysis in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill lasso-logistics-analysis -a claude-code`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/lasso-logistics-analysis in aipoch/medical-research-skills) into .claude/skills/lasso-logistics-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Lasso Logistics Analysis in Codex?

Run `npx skills add aipoch/medical-research-skills --skill lasso-logistics-analysis -a codex`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/lasso-logistics-analysis in aipoch/medical-research-skills) into .agents/skills/lasso-logistics-analysis in your project. Codex loads it when a task matches its description.

Can I use Lasso Logistics Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill lasso-logistics-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lasso-logistics-analysis, .gemini/skills/lasso-logistics-analysis, .github/skills/lasso-logistics-analysis and .opencode/skills/lasso-logistics-analysis in your project.

What does Lasso Logistics Analysis need to run?

Going by SKILL.md and its folder, Lasso Logistics Analysis needs R for the scripts in its folder.

Does Lasso Logistics Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Lasso Logistics Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Lasso Logistics Analysis use?

Lasso Logistics Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lasso Logistics Analysis use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Lasso Logistics Analysis?

Skills that share tags, products or a category with Lasso Logistics Analysis: Scikit Learn (zLanqing/codex-claude-academic-skills, 4.7k stars), Agentic Kaggle Workflow (FrankS-IntelLab/agentic-kaggle-skill, 188 stars), Senior Data Scientist (Raidriar7170/hermes-skilleval, 125 stars) and Geoml (italo-goncalves/geoML, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lasso Logistics Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,978 GitHub stars. The repository holds 578 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.