metabolomics-classifier-training
Summary
Train and compare multiple machine learning and deep learning classifiers on preprocessed metabolomics feature matrices to discriminate sample phenotypes. This skill integrates traditional algorithms (SVM, RF, GBM, LDA, logistic regression) with h2o-based deep learning to enable multi-algorithm model selection and performance benchmarking on metabolomics classification tasks.
When to use
Apply this skill when you have a preprocessed metabolomics feature matrix (expression matrix with metabolite abundances as columns and samples as rows) with corresponding binary or multi-class sample labels, and you need to train and compare classifier performance to select the best-performing model for disease classification or phenotype discrimination.
When NOT to use
- Input is raw, unpreprocessed metabolomics data (e.g., still contains missing values, batch effects, or uninformative features) — apply preprocessing and feature selection before classifier training.
- Sample size is very small (n < 20) relative to feature count — use dimensionality reduction or pathway-aggregated features (e.g., PDSmatrix from lilikoi.PDSfun) before training.
- Labels are continuous (e.g., disease severity scores) rather than categorical — use prognosis prediction (lilikoi.prognosis with Cox-PH or Cox-nnet) instead.
Inputs
- Preprocessed metabolomics feature matrix (samples × metabolites, numeric)
- Sample phenotype labels (binary or multi-class factor or character vector)
- Metabolomics data object from lilikoi.Loaddata() containing Metadata and dataSet
Outputs
- Trained classifier model objects (Rpart, LDA, SVM, RF, GBM, PAM, LOG, DL) for each algorithm
- Performance metrics table (accuracy, sensitivity, specificity, AUC per classifier)
- Cross-validation results and model comparison summary
- Structured output files containing aggregated models and performance rankings
How to apply
Load the preprocessed metabolomics feature matrix and corresponding sample labels into R. Initialize the Lilikoi v2.0 machine_learning module with classifier configuration flags (Rpart, LDA, SVM, RF, GBM, PAM, LOG, DL) and key hyperparameters: trainportion (default 0.8 for train/test split), cvnum (10-fold cross-validation), dlround (50 rounds for h2o deep learning), and nrun (10 iterations for repeated runs). Execute each enabled classifier sequentially, which trains models on the training partition and evaluates on held-out test data. Extract performance metrics (accuracy, sensitivity, specificity, AUC) for each method. Aggregate trained model objects and compile results into a structured comparison table to identify the classifier with the highest overall performance or best sensitivity/specificity trade-off for your phenotype of interest.
Related tools
- Lilikoi v2.0 (R package implementing machine_learning module with support for multiple classifiers (Rpart, LDA, SVM, RF, GBM, PAM, LOG) and h2o deep learning integration) — https://github.com/lanagarmire/lilikoi2
- h2o (Deep learning framework integrated into Lilikoi v2.0 for neural network-based classification with configurable rounds (dlround parameter))
- R (Programming environment for executing Lilikoi v2.0 machine learning pipeline)
Examples
lilikoi.machine_learning(MLmatrix = Metadata, measurementLabels = Metadata$Label, significantPathways = 0, trainportion = 0.8, cvnum = 10, dlround = 50, nrun = 10, Rpart = TRUE, LDA = TRUE, SVM = TRUE, RF = TRUE, GBM = TRUE, PAM = FALSE, LOG = TRUE, DL = TRUE)
Evaluation signals
- All enabled classifier models are trained and return valid model objects without errors.
- Cross-validation results show consistent performance across all cv folds (low variance in fold-wise accuracy/AUC indicates stable model).
- Performance metrics (accuracy, sensitivity, specificity, AUC) are within valid ranges [0, 1] and sum-of-class accuracies are consistent with overall accuracy.
- Test set performance (held-out partition) is comparable to cross-validation performance (within ~5–10%), indicating no severe overfitting.
- Deep learning model (DL) converges within dlround=50 iterations; inspect loss curves to confirm training stability.
Limitations
- Default train/test split (trainportion=0.8) is fixed; no stratification mentioned — may lead to class imbalance in folds for imbalanced datasets.
- Deep learning hyperparameters (dlround=50, nrun=10) are hard-coded defaults; no guidance provided for tuning on small sample sizes (n < 100).
- No automatic feature scaling or normalization is documented as part of the classifier module; assumes input matrix is already appropriately normalized.
- Classifier comparison is based on cross-validation and held-out test metrics only; no statistical significance testing (e.g., McNemar test) is mentioned to compare classifier pairs.
Evidence
- [readme] multiclassifier_support: "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)"
- [readme] configurable_parameters: "and provides configurable parameters including trainportion (0.8), cvnum (10 folds), dlround (50 rounds for deep learning), and nrun (10 iterations)"
- [intro] deep_learning_method: "The new Lilikoi v2.0 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods."
- [other] workflow_steps: "1. Load the preprocessed metabolomics feature matrix and corresponding sample labels into R. 2. Initialize the Lilikoi v2.0 machine learning classification module with the input matrix and classifier"
- [intro] h2o_integration: "The new Lilikoi v2.0 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods."
1---2name: metabolomics-classifier-training3description: Use when you have a preprocessed metabolomics feature matrix (expression matrix with metabolite abundances as columns and samples as rows) with corresponding binary or multi-class sample labels, and you need to train and compare classifier performance to select the -performing model for disease.4license: CC-BY-4.05---67# metabolomics-classifier-training89## Summary1011Train and compare multiple machine learning and deep learning classifiers on preprocessed metabolomics feature matrices to discriminate sample phenotypes. This skill integrates traditional algorithms (SVM, RF, GBM, LDA, logistic regression) with h2o-based deep learning to enable multi-algorithm model selection and performance benchmarking on metabolomics classification tasks.1213## When to use1415Apply this skill when you have a preprocessed metabolomics feature matrix (expression matrix with metabolite abundances as columns and samples as rows) with corresponding binary or multi-class sample labels, and you need to train and compare classifier performance to select the best-performing model for disease classification or phenotype discrimination.1617## When NOT to use1819- Input is raw, unpreprocessed metabolomics data (e.g., still contains missing values, batch effects, or uninformative features) — apply preprocessing and feature selection before classifier training.20- Sample size is very small (n < 20) relative to feature count — use dimensionality reduction or pathway-aggregated features (e.g., PDSmatrix from lilikoi.PDSfun) before training.21- Labels are continuous (e.g., disease severity scores) rather than categorical — use prognosis prediction (lilikoi.prognosis with Cox-PH or Cox-nnet) instead.2223## Inputs2425- Preprocessed metabolomics feature matrix (samples × metabolites, numeric)26- Sample phenotype labels (binary or multi-class factor or character vector)27- Metabolomics data object from lilikoi.Loaddata() containing Metadata and dataSet2829## Outputs3031- Trained classifier model objects (Rpart, LDA, SVM, RF, GBM, PAM, LOG, DL) for each algorithm32- Performance metrics table (accuracy, sensitivity, specificity, AUC per classifier)33- Cross-validation results and model comparison summary34- Structured output files containing aggregated models and performance rankings3536## How to apply3738Load the preprocessed metabolomics feature matrix and corresponding sample labels into R. Initialize the Lilikoi v2.0 machine_learning module with classifier configuration flags (Rpart, LDA, SVM, RF, GBM, PAM, LOG, DL) and key hyperparameters: trainportion (default 0.8 for train/test split), cvnum (10-fold cross-validation), dlround (50 rounds for h2o deep learning), and nrun (10 iterations for repeated runs). Execute each enabled classifier sequentially, which trains models on the training partition and evaluates on held-out test data. Extract performance metrics (accuracy, sensitivity, specificity, AUC) for each method. Aggregate trained model objects and compile results into a structured comparison table to identify the classifier with the highest overall performance or best sensitivity/specificity trade-off for your phenotype of interest.3940## Related tools4142- **Lilikoi v2.0** (R package implementing machine_learning module with support for multiple classifiers (Rpart, LDA, SVM, RF, GBM, PAM, LOG) and h2o deep learning integration) — https://github.com/lanagarmire/lilikoi243- **h2o** (Deep learning framework integrated into Lilikoi v2.0 for neural network-based classification with configurable rounds (dlround parameter))44- **R** (Programming environment for executing Lilikoi v2.0 machine learning pipeline)4546## Examples4748```49lilikoi.machine_learning(MLmatrix = Metadata, measurementLabels = Metadata$Label, significantPathways = 0, trainportion = 0.8, cvnum = 10, dlround = 50, nrun = 10, Rpart = TRUE, LDA = TRUE, SVM = TRUE, RF = TRUE, GBM = TRUE, PAM = FALSE, LOG = TRUE, DL = TRUE)50```5152## Evaluation signals5354- All enabled classifier models are trained and return valid model objects without errors.55- Cross-validation results show consistent performance across all cv folds (low variance in fold-wise accuracy/AUC indicates stable model).56- Performance metrics (accuracy, sensitivity, specificity, AUC) are within valid ranges [0, 1] and sum-of-class accuracies are consistent with overall accuracy.57- Test set performance (held-out partition) is comparable to cross-validation performance (within ~5–10%), indicating no severe overfitting.58- Deep learning model (DL) converges within dlround=50 iterations; inspect loss curves to confirm training stability.5960## Limitations6162- Default train/test split (trainportion=0.8) is fixed; no stratification mentioned — may lead to class imbalance in folds for imbalanced datasets.63- Deep learning hyperparameters (dlround=50, nrun=10) are hard-coded defaults; no guidance provided for tuning on small sample sizes (n < 100).64- No automatic feature scaling or normalization is documented as part of the classifier module; assumes input matrix is already appropriately normalized.65- Classifier comparison is based on cross-validation and held-out test metrics only; no statistical significance testing (e.g., McNemar test) is mentioned to compare classifier pairs.6667## Evidence6869- [readme] multiclassifier_support: "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)"70- [readme] configurable_parameters: "and provides configurable parameters including trainportion (0.8), cvnum (10 folds), dlround (50 rounds for deep learning), and nrun (10 iterations)"71- [intro] deep_learning_method: "The new Lilikoi v2.0 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods."72- [other] workflow_steps: "1. Load the preprocessed metabolomics feature matrix and corresponding sample labels into R. 2. Initialize the Lilikoi v2.0 machine learning classification module with the input matrix and classifier"73- [intro] h2o_integration: "The new Lilikoi v2.0 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods."