Skip to content
cccskills
FreePublished on GitHub

svm-model-importance-analysis

Runs SVM-RFE, a method that ranks features by repeatedly removing less useful ones, on a numeric expression-like matrix with two groups. It uses cross-validated classification error to select a feature count and produces ranking tables and reproducible plots.

OriginalShow the original description

Use when you need a standardized R CLI workflow to run two-class SVM-RFE feature ranking on an expression-like matrix, choose an informative feature count from cross-validated error, and generate reproducible ranking and error plots. NOT for regression, multi-class classification, missing-value imputation, or remote data fetching.

Works withAWS

Run score Not tested

See how to install

Good for

  • Rank features that distinguish two sample groups
  • Choose a feature count using cross-validated error
  • Generate ranking and error plots for review

Files included (22)

  • SKILL.md7.1 KB
  • eval_report_svm-model-importance-analysis_result.json15.3 KB
  • references/algorithm.md3.3 KB
  • references/cli-guide.md6.1 KB
  • references/troubleshooting.md2.8 KB
  • scripts/cli_options.R179 B
  • scripts/core_option_groups.R2.5 KB
  • scripts/functions.R3.2 KB
  • scripts/io.R4.4 KB
  • scripts/main.R1.9 KB
  • scripts/option_validation.R2.1 KB
  • scripts/path_utils.R2.4 KB
  • scripts/plot_option_groups.R2.6 KB
  • scripts/recording.R182 B
  • scripts/run_analysis.R3.6 KB
  • scripts/svm_helpers.R2.9 KB
  • scripts/utils.R1.0 KB
  • scripts/validation_utils.R658 B
  • scripts/visualization.R1.9 KB
  • tests/data/expression_matrix.csv9.1 KB
  • tests/data/group_info.csv648 B
  • tests/run_tests.R347 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

SVM Model Importance Analysis

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdExplain SVM-RFE ranking, cross-validation logic, assumptions, and interpretation
Need to execute the analysisscripts/main.RRun the CLI entry point with a complete Rscript command
Encounter an errorreferences/troubleshooting.mdMap standardized error codes to causes and fixes
Need CLI examplesreferences/cli-guide.mdReview installation steps and runnable CLI examples
Need a runnable smoke testtests/data/Use the bundled small dataset for verification

Usage

Rscript scripts/main.R \
  --input_file ./input/expression_matrix.csv \
  --group_file ./input/group_info.csv \
  --case_group Case \
  --control_group Control \
  --output_dir output/basic-run \
  --seed 42 \
  --timeout_seconds 600

Arguments

ShortLongTypeDefaultRequiredDescription
-i--input_filecharacternoneyes, unless --plot_only TRUEExpression matrix file with samples in rows and features in columns
-g--group_filecharacternoneyes, unless --plot_only TRUEGroup file with sample IDs in the first column
-c--case_groupcharacternoneyes, unless --plot_only TRUECase group label
-r--control_groupcharacternoneyes, unless --plot_only TRUEControl group label
-o--output_dircharacteroutputyesOutput directory inside the skill root
-p--plot_onlylogicalFALSEnoReuse output_dir/data/svm_result.rds and regenerate plots without rerunning SVM-RFE
-s--seedinteger42noRandom seed for reproducibility
-t--timeout_secondsinteger600noElapsed time limit for the run
--svm_kinteger10noNumber of stratified outer folds used for SVM-RFE and validation
--svm_halve_aboveinteger50noIf surviving features exceed this count, remove half per iteration
--svm_max_features_capinteger30noMaximum feature count evaluated on the error curve
--svm_select_rulecharacterminnoFeature-count rule: min or tolerance
--svm_tolnumeric0.01noTolerance used when --svm_select_rule tolerance is selected
--svm_error_heightnumeric5noSVM error plot height in inches
--svm_error_widthnumeric6noSVM error plot width in inches
--svm_error_xlabcharacterNumber of FeaturesnoX-axis label for the SVM error plot
--svm_error_ylabcharacterClassification Error RatenoY-axis label for the SVM error plot
--svm_error_main_line_colorcharacterblacknoMain line color for the SVM error plot
--svm_error_second_line_colorcharacter#2BA2DEnoBaseline line color for the SVM error plot
--svm_error_best_point_colorcharacterrednoHighlight color for the best feature-count point
--svm_error_noinfo_ltyinteger3noLine type for the no-information baseline
--svm_error_label_cexnumeric0.75noLabel size for the best-point annotation
--svm_error_label_posinteger4noLabel position for the best-point annotation
--svm_rank_top_ninteger20noMaximum number of ranked features shown in the ranking plot
--svm_rank_widthnumeric7noRanking plot width in inches
--svm_rank_heightnumeric6noRanking plot height in inches
--svm_rank_colorcharacter#2BA2DEnoBar color for the ranking plot
--svm_rank_titlecharacterSVM-RFE Feature RankingnoTitle for the ranking plot

Input Format

Expression Matrix

  • CSV or TSV.
  • First column: sample IDs.
  • Remaining columns: numeric features.
  • Samples must be rows.
  • Missing or non-numeric feature values are not allowed.

Example:

sample,HIF1A,NR4A1,SOCS1
S1,6.21,-1.34,2.01
S2,6.57,0.37,3.62
S3,7.05,2.12,5.01

Group File

  • CSV or TSV.
  • First column: sample IDs.
  • One additional column must contain both the case and control labels.
  • Exactly two groups are supported.

Example:

sample,group
S1,Case
S2,Case
S3,Control

Output Files

FileFormatDescription
data/svm_result.rdsRDSSerialized SVM-RFE bundle with ranking results and metadata
table/svm_rfe_features.csvCSVSelected ranked features using the chosen feature-count rule
table/svm_rfe_full_ranking.csvCSVFull ranking table across all input features
plot/svm_rfe_error_plot.pdfPDFCross-validated classification error across feature counts
plot/svm_rfe_ranking_plot.pdfPDFBar plot of the highest-ranked SVM-RFE features
session_info.txtTXTR version, platform, and package version information

Error Handling

  • Successful runs exit with status code 0.
  • Failed runs exit with status code 1.
  • Error messages use standardized names such as SKILL_FILE_NOT_FOUND and SKILL_INVALID_PARAMETER.
  • Output paths are validated so that --output_dir cannot write outside the skill root.
  • The analysis never performs network requests and never executes user input through eval(), exec(), or system().

Common codes:

Error CodeMeaning
SKILL_FILE_NOT_FOUNDAn input file or required plot-only artifact does not exist
SKILL_MISSING_COLUMNSThe input file does not contain the required columns
SKILL_EMPTY_DATAAn input file is empty or a required ranking table is unavailable
SKILL_INVALID_PARAMETERA CLI argument, group setting, numeric constraint, or path is invalid
SKILL_SAMPLE_MISMATCHSample IDs do not match between the expression matrix and group file
SKILL_PACKAGE_NOT_FOUNDOne or more required CRAN packages are missing

For detailed fixes, READ: references/troubleshooting.md

Testing

Help Check

Rscript scripts/main.R --help

Full Test Run

Rscript tests/run_tests.R

Direct Test Command

Rscript scripts/main.R \
  --input_file tests/data/expression_matrix.csv \
  --group_file tests/data/group_info.csv \
  --case_group AR \
  --control_group Control \
  --output_dir tests/output/manual-test \
  --seed 42 \
  --svm_k 4 \
  --svm_max_features_cap 6 \
  --svm_rank_top_n 6 \
  --timeout_seconds 300

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Condense an academic paper into a structured abstract of up to 250 words, organized by background, objective, methods, results, and conclusion. It aims to retain key quantitative findings and supports papers from several research fields; figures and charts are not interpreted.

  • Creating a concise abstract from a research paper
  • Summarizing empirical studies while retaining key statistics
  • Preparing structured summaries across multiple papers
aipoch/medical-research-skills2KUpdated Sep 17, 2026

Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Refines long medical academic texts into SCI-style unstructured Chinese and English abstracts; use when you need to condense drafts/reports/summaries into bilingual abstracts and generate Summary_Report.md.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Generates submission-ready Elsevier/SCI Highlights from manuscript text or extracted PDF/DOCX/TXT content. Use when a user needs 3-5 concise, evidence-grounded highlight bullets for a research paper, review, meta-analysis, case report, or bioinformatics manuscript.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Predicts absorption, distribution, metabolism, and excretion properties for small molecules from their structures. Use the results to compare compounds, screen libraries, and review drug-likeness scores in structured outputs. Predictions support prioritization and need experimental validation.

  • Compare predicted ADME profiles for small-molecule candidates
  • Screen a compound library for drug-likeness
  • Rank candidates against target property ranges
aipoch/medical-research-skills2KUpdated Sep 17, 2026

See all skills by aipoch

Report a problem with this skill