CtrlK
BlogDocsLog inGet started
Tessl Logo

svm-model-importance-analysis

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.

71

Quality

87%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

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
Repository
aipoch/medical-research-skills
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.