# Lightgbm Analysis

Use when training a LightGBM model on tabular data in R and returning model metrics...

- 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 lightgbm-analysis -g -a claude-code -y`
Codex: `npx skills add aipoch/medical-research-skills --skill lightgbm-analysis -g -a codex -y`
Cursor: `npx skills add aipoch/medical-research-skills --skill lightgbm-analysis -g -a cursor -y`
Gemini CLI: `npx skills add aipoch/medical-research-skills --skill lightgbm-analysis -g -a gemini-cli -y`

## Description

Use when training a LightGBM model on tabular data in R and returning model metrics, feature importance ranking tables, and feature importance plots.

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

> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)

# LightGBM Analysis

Use this skill to build a LightGBM model on tabular data and export feature importance ranking results as both a table and a figure.

## Use This Skill When

- You need a command-line LightGBM workflow written in R.
- You need classification or regression on structured tabular data.
- You need ranked feature importance outputs for reporting or interpretation.
- You need standardized outputs under `table/`, `figure/`, and `data/`.

## Primary Command

```bash
Rscript scripts/main.R \
  --data_file <input_file> \
  --target_var <target_column> \
  --output_dir <output_dir>
```

## Prerequisites

- `Rscript` is available in the shell.
- Required R packages: `optparse`, `data.table`, `lightgbm`.
- Install basic dependencies with `Rscript -e 'install.packages(c("optparse", "data.table"), repos="https://cloud.r-project.org")'`.
- Install the R `lightgbm` package from the LightGBM project because it is usually not available from CRAN.

## Core Arguments

The rest: https://github.com/aipoch/medical-research-skills/blob/HEAD/awesome-med-research-skills/Data Analysis/LightGBM-analysis/SKILL.md
