Agent skill

Decision Tree Analysis

by aipoch in aipoch/medical-research-skills

A skill your agent uses when building a decision tree model in R and generating feature importance ranking outputs.

MITAuto-check passedData & Analytics

Install Decision Tree Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill decision-tree-analysis -a claude-code

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

GitHub CLI
$ gh skill install aipoch/medical-research-skills decision-tree-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/decision-tree-analysis' .claude/skills/decision-tree-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
decision-tree-analysis
GitHub stars
2k
Token cost
~2.1k tokens
SKILL.md length
697 words
Files
12 (incl. scripts, references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building a decision tree model in R and generating feature importance ranking outputs.

  • Works in 3 steps: Confirm the input file exists and the… → Run scripts/main.R with the target… → Check the output directory for feature…
  • Building a decision tree model in R and generating feature importance ranking outputs
  • SKILL.md covers Use This Skill When, Primary Command, Prerequisites and Core Arguments, plus 9 more sections
  • Runs R scripts from its folder; reaches cloud.r-project.org

What it does

Decision Tree Analysis is an agent skill from aipoch/medical-research-skills. Use when building a decision tree model in R and generating feature importance ranking outputs. Supports classification and regression, automatic task detection, parameter validation, model evaluation summaries, and exports of feature-importance tables and figures.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including scripts and reference files (for example `eval_report_decision-tree-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 decision tree model in R and generating feature importance ranking outputs
  • Tasks that involve Machine learning

Example prompts

  • “/decision-tree-analysis”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Confirm the input file exists and the target column name is correct.
  2. Run scripts/main.R with the target column and optional modeling parameters.
  3. Check the output directory for feature importance tables under table/ and the ranking plot under figure/.

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 4 files in scripts/ (R), which the agent can run.

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cloud.r-project.org

    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

Decision Tree Analysis loads about 2.1k tokens when it runs, and up to ~3.3k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 697 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.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). 697 words, ~2,066 tokens.

Download SKILL.mdSave it as .claude/skills/decision-tree-analysis/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
decision-tree-analysis
description
Use when building a decision tree model in R and generating feature importance ranking outputs. Supports classification and regression, automatic task detection, parameter validation, model evaluation summaries, and exports of feature-importance tables and figures.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

Decision Tree Analysis

Use this skill to train a decision tree model from a tabular file and export feature importance ranking results.

Use This Skill When

  • You need a decision tree workflow in R for either classification or regression.
  • You need feature importance ranking as a table and a figure.
  • You need a command-line workflow with parameter validation and standardized output folders.

Primary Command

bash
Rscript scripts/main.R \
  --data_file <input_file> \
  --target_var <target_column> \
  --task_type <auto|classification|regression> \
  --output_dir <output_dir>

Prerequisites

  • Rscript is available in the shell.
  • Required R packages: optparse, data.table, rpart.
  • Install missing packages with Rscript -e 'install.packages(c("optparse", "data.table", "rpart"), repos="https://cloud.r-project.org")'.

Core Arguments

ArgumentRequiredDescription
--data_fileYesInput data file in CSV, TXT, or TSV format
--target_varYesTarget column to predict
--task_typeNoauto, classification, or regression. Default auto
--output_dirNoOutput directory, default ./Decision_Tree_Results
--train_ratioNoTrain set ratio between 0 and 1, default 0.7
--max_depthNoMaximum tree depth, default 5
--minsplitNoMinimum observations required to attempt a split, default 10
--minbucketNoMinimum observations allowed in a terminal node, default 3
--cpNoComplexity parameter for pruning, default 0.001
--seedNoRandom seed, default 42
--exclude_varsNoComma-separated columns to exclude from modeling
--importance_top_nNoNumber of top features to show in the importance plot, default 15
--output_formatNoTable output format: csv or txt, default csv

Input Requirements

  • The input file must contain the target column.
  • All predictor columns come from the remaining columns after excluding target_var and exclude_vars.
  • If the first column is unnamed or uses an ID-like name such as id or rowname, and its values are unique, the skill automatically treats it as row names instead of a predictor.
  • Rows with missing values in any modeling column are removed before training.
  • Character predictors are automatically converted to factors.
  • In auto mode, a numeric target with more than 10 unique values is treated as regression; otherwise it is treated as classification.
  • At least 5 complete rows are required after filtering.

Example input:

csv
study_hours,sleep_hours,attendance,score_band
3.5,7.0,0.88,medium
5.0,6.5,0.95,high
2.0,8.0,0.75,low

Minimal Workflow

  1. Confirm the input file exists and the target column name is correct.
  2. Run scripts/main.R with the target column and optional modeling parameters.
  3. Check the output directory for feature importance tables under table/ and the ranking plot under figure/.

If you omit --data_file or --target_var, the script exits with SKILL_MISSING_INPUT.

Outputs

Expected output structure:

text
<output_dir>/
├── data/
├── table/
└── figure/

Primary result files:

  • table/decision_tree_feature_importance.<csv|txt>
  • table/decision_tree_metrics.csv
  • figure/decision_tree_feature_importance.pdf

Additional files:

  • data/decision_tree_predictions.csv
  • data/decision_tree_model.rds

Notes:

  • Exactly one feature-importance table is written per run. The file extension is controlled by --output_format.
  • Evaluation metrics are saved to table/decision_tree_metrics.csv.
  • If the fitted tree does not split, the run completes but emits a warning because feature importances and predictions may be degenerate on very small training sets.

Feature importance result fields include:

  • rank
  • feature
  • importance
  • relative_importance
Show full SKILL.md (252 more words)Show less

Choose the Task Type

  • Use classification for categorical targets such as yes/no, risk_level, or species.
  • Use regression for continuous numeric targets such as price, score, or yield.
  • Use auto when the target type is obvious and you want the script to infer it.

Read These Files When Needed

NeedFile
Decision tree method and feature importance detailsreferences/algorithm.md
More CLI examplesreferences/cli-guide.md
Error diagnosisreferences/troubleshooting.md
Main execution entry pointscripts/main.R
Sample test datatests/data/

Test Data

  • tests/data/dt_sample1.csv: CSV classification sample with an unnamed first column automatically recognized as row names. Suggested target: fustat.
  • tests/data/dt_sample2.csv: CSV classification sample with an unnamed first column automatically recognized as row names. Suggested target: fustat.
  • tests/data/dt_sample3.txt: Tab-delimited high-dimensional classification sample with an unnamed first column automatically recognized as row names. Suggested target: Group.

Quick Examples

Classification:

bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample1.csv \
  --target_var fustat \
  --task_type classification \
  --max_depth 4 \
  --output_dir tests/output_dt_sample1_classification

Classification on a second CSV sample:

bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample2.csv \
  --target_var fustat \
  --task_type classification \
  --output_dir tests/output_dt_sample2_classification

TXT input example:

bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample3.txt \
  --target_var Group \
  --task_type classification \
  --max_depth 4 \
  --output_dir tests/output_dt_sample3_classification

Validation

bash
Rscript scripts/main.R --help
bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample1.csv \
  --target_var fustat \
  --task_type classification \
  --output_dir tests/validation_dt_sample1
bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample2.csv \
  --target_var fustat \
  --task_type classification \
  --output_dir tests/validation_dt_sample2
bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample3.txt \
  --target_var Group \
  --task_type classification \
  --output_dir tests/validation_dt_sample3

After running analysis, verify that the following exist:

  • tests/validation_dt_sample1/table/decision_tree_feature_importance.csv
  • tests/validation_dt_sample1/table/decision_tree_metrics.csv
  • tests/validation_dt_sample1/figure/decision_tree_feature_importance.pdf
  • tests/validation_dt_sample2/table/decision_tree_feature_importance.csv
  • tests/validation_dt_sample2/table/decision_tree_metrics.csv
  • tests/validation_dt_sample2/figure/decision_tree_feature_importance.pdf
  • tests/validation_dt_sample3/table/decision_tree_feature_importance.csv
  • tests/validation_dt_sample3/table/decision_tree_metrics.csv
  • tests/validation_dt_sample3/figure/decision_tree_feature_importance.pdf

Common Errors

  • SKILL_FILE_NOT_FOUND: Input file path is wrong or inaccessible.
  • SKILL_MISSING_COLUMNS: The target column or requested excluded columns are missing.
  • SKILL_INVALID_DATA: Input data is malformed or unsuitable for model training.
  • SKILL_INVALID_PARAMETER: An argument value is invalid.
  • SKILL_INSUFFICIENT_DATA: Too few usable rows or classes remain after filtering.
  • SKILL_DEPENDENCY_MISSING: A required R package such as optparse, data.table, or rpart is unavailable.

If a run succeeds but logs that the decision tree did not split, lower --minsplit and --minbucket or provide more training rows before trusting the ranking output.

If the issue is not obvious, read references/troubleshooting.md.

© 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 11 other files (scripts, references) in awesome-med-research-skills/Data Analysis/decision-tree-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_decision-tree-analysis_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/functions.R
  • scripts/main.R
  • scripts/run_analysis.R
  • scripts/utils.R
  • tests/data/dt_sample1.csv
  • tests/data/dt_sample2.csv
  • tests/data/dt_sample3.txt

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Decision Tree 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.

Decision Tree Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Decision Tree Analysis this skillaipoch/medical-research-skills2k—~2.1kAutomated safety check: PassMIT
Scikit LearnzLanqing/codex-claude-academic-skills4.6k17 repos~3.9kAutomated safety check: PassBSD-3-Clause
Senior Data ScientistRaidriar7170/hermes-skilleval1256 repos~1.4kAutomated safety check: PassMIT
Agentic Kaggle WorkflowFrankS-IntelLab/agentic-kaggle-skill188—~4kAutomated safety check: PassMIT
Retention Analysisliangdabiao/claude-data-analysis-ultra-main2901 repos~1.3kAutomated safety check: NotesNone
Geomlitalo-goncalves/geoML109—~4.2kAutomated safety check: PassGPL-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.6k GitHub starsUsed in 17 repos~3.9k tokens
    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 6 repos~1.4k 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
  • Retention Analysis

    liangdabiao/claude-data-analysis-ultra-main

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

    290 GitHub starsUsed in 1 repo~1.3k tokens
    Data & AnalyticsAuto-check: notes
  • 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.2k tokensUpdated 6 days ago
    Data & AnalyticsAuto-check passed
  • Radiomics ML

    Aperivue/medsci-skills

    A skill your agent uses when building or auditing a radiomics or tabular clinical-ML prediction model with a classical learner (LASSO, SVM, random forest, XGBoost and similar).

    329 GitHub starsUsed in 1 repo~2.7k tokens
    Data & AnalyticsAuto-check passed

More from aipoch/medical-research-skills

All 567 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 21 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 21 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 21 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 21 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 21 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 21 days ago
    Auto-check passed

Questions about Decision Tree Analysis

What does Decision Tree Analysis do?

A skill your agent uses when building a decision tree model in R and generating feature importance ranking outputs. Decision Tree Analysis is an agent skill from aipoch/medical-research-skills. Use when building a decision tree model in R and generating feature importance ranking outputs.

When should I use Decision Tree Analysis?

Decision Tree Analysis fits situations like: building a decision tree model in R and generating feature importance ranking outputs; tasks that involve Machine learning.

How do I install Decision Tree Analysis in Claude Code?

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

How do I install Decision Tree Analysis in Codex?

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

Can I use Decision Tree 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 decision-tree-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/decision-tree-analysis, .gemini/skills/decision-tree-analysis, .github/skills/decision-tree-analysis and .opencode/skills/decision-tree-analysis in your project.

What does Decision Tree Analysis need to run?

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

Does Decision Tree Analysis access the network?

SKILL.md names 1 domain. In commands or code: cloud.r-project.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Decision Tree 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 Decision Tree Analysis use?

Decision Tree Analysis is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Decision Tree Analysis use?

About 2.1k tokens (SKILL.md is roughly 8.3k 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 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Decision Tree Analysis?

Skills that share tags, products or a category with Decision Tree Analysis: Scikit Learn (zLanqing/codex-claude-academic-skills, 4.6k stars), Senior Data Scientist (Raidriar7170/hermes-skilleval, 125 stars), Agentic Kaggle Workflow (FrankS-IntelLab/agentic-kaggle-skill, 188 stars) and Retention Analysis (liangdabiao/claude-data-analysis-ultra-main, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Decision Tree Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 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.