Xgboost Analysis logo

Xgboost Analysis

OrganizationPopular
aipoch
xgboost-analysis

Use when building XGBoost models on tabular data and returning feature importance ranking outputs. Supports binary classification and regression with automatic task detection, train-test split, performance tables, feature importance ranking tables, and PNG importance plots.

Overview

Publisheraipoch
Repositorymedical-research-skills
Skill namexgboost-analysis
Stars
1.9K
Forks
175
Bundled files
11
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 11 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by aipoch on GitHub. Read the source before you install it.

Installation

Install the Xgboost Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Xgboost Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Xgboost Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Xgboost Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

XGBoost Modeling And Feature Importance Ranking

Use this skill to train an XGBoost model from a tabular dataset and export both feature importance ranking tables and feature importance plots.

Use This Skill When

  • You need a command-line XGBoost workflow in R for tabular data.
  • You need a reproducible train-test split, model training, and evaluation.
  • You need feature importance ranking outputs as both a table and a figure.
  • You need automatic one-hot encoding for categorical predictors.
  • Your data may contain a first unnamed sample ID column such as V1 that should not enter the model.

Do Not Use This Skill When

  • Your classification target has more than 2 classes.
  • Your input is not tabular CSV, TXT, or TSV data.
  • You need causal interpretation, mechanism claims, or policy, business, or clinical conclusions.
  • You only need narrative interpretation or triage of an existing result rather than model training.

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, Matrix, xgboost.
  • Install missing packages with Rscript -e 'install.packages(c("optparse", "data.table", "Matrix", "xgboost"), repos="https://cloud.r-project.org")'.

Core Arguments

ArgumentRequiredDescription
--data_fileYesInput CSV, TXT, or TSV file
--target_varYesTarget column used for modeling
--task_typeNoauto, classification, or regression. Default auto
--output_dirNoOutput directory, default ./XGBoost_Results
--ignore_varsNoComma-separated columns to exclude from predictors
--positive_classNoPositive class label for binary classification
--test_sizeNoTest set proportion between 0 and 1, default 0.2
--seedNoRandom seed, default 123
--nroundsNoMaximum boosting rounds, default 300
--max_depthNoTree depth, default 6
--etaNoLearning rate, default 0.1
--subsampleNoRow sampling ratio, default 0.8
--colsample_bytreeNoColumn sampling ratio, default 0.8
--min_child_weightNoMinimum child weight, default 1
--gammaNoMinimum split loss reduction, default 0
--lambdaNoL2 regularization, default 1
--alphaNoL1 regularization, default 0
--early_stopping_roundsNoEarly stopping rounds, default 20
--importance_metricNogain, cover, or frequency. Default gain
--top_nNoNumber of features to plot, default 20
--output_formatNoTable format: csv or txt, default csv
--output_prefixNoOutput filename prefix, default xgboost

Input Requirements

  • The input file must contain the target column.
  • Predictor columns can be numeric, integer, logical, character, or factor-like text.
  • Character and factor predictors are one-hot encoded automatically.
  • A first unnamed identifier column such as V1 is automatically excluded when it contains unique sample IDs.
  • Rows with missing target values are removed before training.
  • For classification, exactly 2 classes are required.
  • For regression, the target column must be numeric.
  • Each class should have at least 2 rows so both training and test sets can be created.

Example input:

csv
,fustat,CAMK2N2,GGT6,GPR161,RAB26,RIBC2
TCGA-C5-A1M5,1,2.248291938,5.274690305,2.825215762,3.121114894,5.35318565
TCGA-EA-A5O9,0,3.346176843,5.404368414,2.604616977,0.629473197,4.429314674
TCGA-C5-A3HL,0,3.363100974,5.363314779,4.124799581,4.127228806,4.916596068

Minimal Workflow

  1. Confirm the input file exists and the target column name is correct.
  2. Run scripts/main.R with --data_file and --target_var.
  3. Check the output directory for table/feature_importance_* and figure/feature_importance_*.

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

Outputs

Expected output structure:

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

Primary outputs:

  • table/<output_prefix>_feature_importance.csv
  • table/<output_prefix>_model_performance.csv
  • figure/<output_prefix>_feature_importance_<importance_metric>.png

Additional outputs:

  • session_info.txt

Feature importance table fields include:

  • Rank
  • Feature
  • Gain
  • Cover
  • Frequency
  • SelectedMetric
  • SelectedValue

Feature Importance Metrics

  • gain: Average contribution to loss reduction. Recommended for most ranking use cases.
  • cover: Relative sample coverage contributed by a feature.
  • frequency: How often the feature is used in splits.

Read These Files When Needed

NeedFile
XGBoost method details and importance interpretationreferences/algorithm.md
More CLI examplesreferences/cli-guide.md
Error diagnosisreferences/troubleshooting.md
Main execution entry pointscripts/main.R
Bundled test datatests/data/

Quick Examples

Auto-detected binary classification on dt_sample1.csv:

bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample1.csv \
  --target_var fustat \
  --task_type auto \
  --output_dir tests/output_binary

Binary classification on dt_sample2.csv:

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

Character-label classification on dt_sample3.txt:

bash
Rscript scripts/main.R \
  --data_file tests/data/dt_sample3.txt \
  --target_var Group \
  --task_type classification \
  --positive_class high \
  --top_n 15 \
  --output_dir tests/output_group

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_output

After running analysis, verify that these files exist:

  • tests/validation_output/table/xgboost_feature_importance.csv
  • tests/validation_output/table/xgboost_model_performance.csv
  • tests/validation_output/figure/xgboost_feature_importance_gain.png

Common Errors

  • SKILL_FILE_NOT_FOUND: Input file path is wrong or inaccessible.
  • SKILL_MISSING_COLUMNS: The target column is missing.
  • SKILL_INVALID_DATA: Data is malformed, the target type is unsuitable, classification has more or fewer than 2 classes, or too few usable rows remain.
  • SKILL_INVALID_PARAMETER: An argument value is invalid.
  • SKILL_DEPENDENCY_MISSING: A required R package such as xgboost is unavailable.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Xgboost Analysis AI skill do?

Use when building XGBoost models on tabular data and returning feature importance ranking outputs. Supports binary classification and regression with automatic task detection, train-test split, performance tables, feature importance ranking tables, and PNG importance plots.

Why use Xgboost Analysis on TypingMind?

Because you install it once and use it with any model. Xgboost Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Xgboost Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aipoch/medical-research-skills/tree/main/awesome-med-research-skills/Data%20Analysis/XGBoost-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Xgboost Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Xgboost Analysis?

As many as you like. As long as a model supports skills, you can use Xgboost Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Xgboost Analysis AI skill free?

Yes. It is published on GitHub by aipoch under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇