agentsclimarketplace

Feature matrix preparation for supervised learning

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/feature-matrix-preparation-for-supervised-learning

Use when you have preprocessed metabolomics feature abundance data and want to train multiple classifiers (traditional ML or deep learning) to predict sample phenotype or disease status.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill feature-matrix-preparation-for-supervised-learning

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.0 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

feature-matrix-preparation-for-supervised-learning

Summary

Prepare a preprocessed metabolomics feature matrix with corresponding sample labels for input to supervised machine learning and deep learning classifiers. This skill transforms raw or intermediate metabolomics data into the structured matrix and label format required by the Lilikoi v2.0 machine_learning module.

When to use

You have preprocessed metabolomics feature abundance data and want to train multiple classifiers (traditional ML or deep learning) to predict sample phenotype or disease status. Specifically, when you need to format an expression matrix and phenotype labels for cross-validated, multi-algorithm comparison using Lilikoi v2.0.

When NOT to use

  • Input data is already a pre-trained classifier object or model weights — use skill only for data preparation, not model inference.
  • Metabolomics matrix contains missing values or requires imputation — this skill assumes preprocessing is complete; apply imputation before this skill.
  • You are performing unsupervised learning (e.g., clustering, PCA) — this skill is specific to supervised classification workflows.

Inputs

  • preprocessed metabolomics feature matrix (numeric; rows=metabolites, columns=samples)
  • sample phenotype labels (factor or character vector; length=ncol(matrix))
  • optional: metabolite-to-pathway mapping table (from lilikoi.MetaTOpathway())
  • optional: pathway feature selection results (from lilikoi.featuresSelection())

Outputs

  • formatted input matrix ready for lilikoi.machine_learning() (MLmatrix parameter)
  • aligned sample label vector (measurementLabels parameter)
  • pathway-aggregated abundance matrix (PDSmatrix) if pathway engineering applied
  • filtered pathway list if feature selection applied

How to apply

Load the preprocessed metabolomics feature matrix (rows = metabolites, columns = samples) and corresponding sample labels (e.g., disease/control phenotypes) into R using lilikoi.Loaddata() or equivalent. Ensure the matrix is numeric, with metabolite identifiers as row names and sample identifiers as column names; labels should be a factor or character vector aligned to matrix columns. Perform pathway-level feature engineering if needed using lilikoi.MetaTOpathway() to convert metabolite names to HMDB identifiers and lilikoi.PDSfun() to aggregate metabolites into pathway abundance scores (PDSmatrix). Optionally filter pathways using lilikoi.featuresSelection() with a threshold (e.g., 0.50) to reduce feature dimensionality and improve classifier stability. Pass the final matrix (metabolite-level or pathway-aggregated) and labels to lilikoi.machine_learning() with configurable parameters: trainportion (0.8), cvnum (10 folds), dlround (50 rounds), nrun (10 iterations), and classifier flags (Rpart, LDA, SVM, RF, GBM, PAM, LOG, DL). This structure enables direct comparison of multiple algorithms on the same training/validation splits.

Related tools

  • Lilikoi v2.0 (R package implementing machine_learning module that accepts the prepared matrix and labels; integrates h2o for deep learning and supports Rpart, LDA, SVM, RF, GBM, PAM, LOG classifiers) — https://github.com/lanagarmire/lilikoi2
  • R (Programming environment for loading data, executing lilikoi functions, and managing matrices and labels)
  • h2o (Deep learning backend integrated into Lilikoi v2.0 for training the DL classifier on the prepared matrix)

Examples

dt <- lilikoi.Loaddata(file="plasma_breast_cancer.csv"); PDSmatrix <- lilikoi.PDSfun(lilikoi.MetaTOpathway('name')$table); lilikoi.machine_learning(MLmatrix = PDSmatrix, measurementLabels = dt$Metadata$Label, trainportion = 0.8, cvnum = 10, dlround = 50, nrun = 10, DL = TRUE, SVM = TRUE, RF = TRUE)

Evaluation signals

  • Matrix dimensions match expected input: nrow(matrix) ≥ 1, ncol(matrix) = length(labels), no NA or NaN values in numeric matrix.
  • Labels are properly aligned: each column of the matrix corresponds to exactly one entry in the labels vector; label values are discrete/categorical (factor levels or unique character strings).
  • If pathway aggregation applied: pathway abundance scores (PDSmatrix) have fewer rows than original metabolite matrix; row names correspond to pathway identifiers; values are numeric and in expected ranges for the metabolomics platform.
  • If feature selection applied: filtered pathway list is a subset of full pathway list; selection threshold and method (gain, etc.) are recorded and reproducible.
  • Lilikoi.machine_learning() executes without errors on the prepared matrix and labels; cross-validation splits are created correctly (trainportion=0.8 produces ~80% training set per fold).

Limitations

  • Lilikoi v2.0 assumes balanced or manageable class distributions; highly imbalanced phenotypes may require additional weighting or stratification not covered by this skill.
  • Pathway aggregation using lilikoi.PDSfun() requires a complete metabolite-to-pathway mapping; metabolites without pathway assignments will be excluded, potentially losing information.
  • Feature selection threshold (e.g., 0.50 in lilikoi.featuresSelection) is user-specified; no guidance is provided in the README on optimal threshold selection for different metabolomics datasets.
  • The skill does not address batch correction, normalization beyond preprocessing, or integration of multi-modal data; assumes input matrix is already quality-controlled.

Evidence

  • [readme] Load and align feature matrix with labels: "dt <- lilikoi.Loaddata(file=system.file("extdata", "plasma_breast_cancer.csv", package = "lilikoi")); Metadata <- dt$Metadata; dataSet <- dt$dataSet"
  • [readme] Apply pathway transformation and feature engineering: "convertResults=lilikoi.MetaTOpathway('name'); Metabolite_pathway_table = convertResults$table; PDSmatrix=lilikoi.PDSfun(Metabolite_pathway_table); selected_Pathways_Weka="
  • [other] Module accepts expression matrix, labels, and configurable parameters: "The Lilikoi v2.0 machine_learning module accepts an expression matrix and labels, supports multiple classifiers (Rpart, LDA, SVM, RF, GBM, PAM, LOG, and DL), and provides configurable parameters"
  • [readme] Machine learning function invocation with prepared matrix and labels: "lilikoi.machine_learning(MLmatrix = Metadata, measurementLabels = Metadata$Label, significantPathways = 0, trainportion = 0.8, cvnum = 10, dlround=50,nrun=10, Rpart=TRUE,"
  • [intro] Workflow includes preprocessing and pathway-level aggregation: "Lilikoi v2.0 supports data preprocessing, exploratory analysis, pathway visualization and metabolite-pathway regression"

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.