# Elastic Net Feature Selection

Use when selecting predictive genes or other molecular features from bulk expression...

- Repository: https://github.com/aipoch/medical-research-skills (2020 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-09-17
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add aipoch/medical-research-skills --skill elastic-net-feature-selection -g -a claude-code -y`
Codex: `npx skills add aipoch/medical-research-skills --skill elastic-net-feature-selection -g -a codex -y`
Cursor: `npx skills add aipoch/medical-research-skills --skill elastic-net-feature-selection -g -a cursor -y`
Gemini CLI: `npx skills add aipoch/medical-research-skills --skill elastic-net-feature-selection -g -a gemini-cli -y`

## Description

Use when selecting predictive genes or other molecular features from bulk expression matrices for binary case-vs-control classification with elastic net logistic regression, including coefficient path and cross-validation plots. Trigger keywords: elastic net, glmnet, feature selection, binary classification, lambda.min, lambda.1se. NOT for: survival/Cox modeling, multiclass outcomes, single-cell data, or non-expression tables.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Elastic Net Feature Selection

## When to Use

- Use this skill for binary case-vs-control classification on bulk expression matrices.
- Use it when you need elastic net logistic regression feature selection, coefficient paths, and `cv.glmnet`-based lambda selection.
- Use custom labels such as `Tumor` and `Normal` only when the group file still contains exactly two outcome levels.

## Out of Scope

- Survival or Cox modeling
- Multiclass outcomes
- Single-cell data
- Non-expression tables

Out-of-scope enforcement:

- If the group file contains any label outside the requested `case_group` and `control_group`, the command stops with `SKILL_INVALID_DATA` instead of silently dropping samples.
- If either requested class is missing after validation, the command stops with `SKILL_INVALID_DATA`.

## When to Read External Files

| Situation | File to Read | Purpose |
|-----------|--------------|---------|
| **Need to understand alpha, lambda choice, or feature-selection behavior** | `references/algorithm.md` | Elastic net logistic regression, penalty mixing, cross-validation, and coefficient selection assumptions |
| **Need the authoritative executable entrypoint** | `scripts/main.R` | Run: `Rscript scripts/main.R --input_file ... --group_file ... --output_dir ...` |
| **Need parameter examples, smoke-test commands, or recorded local runs** | `references/cli-guide.md` | Verified CLI examples for normal runs, conservative runs, and test-data runs |
| **Need bundled sample inputs for a first run or regression test** | `tests/data/` | Sample expression matrix, group file, and feature list |
| **Encounter errors, warnings, or timeout issues** | `references/troubleshooting.md` | Common failures, console warning interpretation, and recovery steps |

---

## Usage

The rest: https://github.com/aipoch/medical-research-skills/blob/HEAD/awesome-med-research-skills/Data Analysis/elastic-net-feature-selection/SKILL.md
