agentsclimarketplace

Peak quality classifier optimization

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/peak-quality-classifier-optimization

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill peak-quality-classifier-optimization

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

  • 14 stars14 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 author says it does

Copied from the file, not written here

Use when after calculating 12 peak-quality metrics on a development set of extracted ion chromatograms (EICs) and labeled peaks, when you need to select both the classification algorithm and its optimal hyperparameters before training a final model on held-out test data.

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.7 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Peak-Quality Classifier Optimization

Summary

Optimize machine learning classifier hyperparameters for detecting low-quality chromatographic peaks in LC-MS metabolomics data using k-fold cross-validation and comparative evaluation metrics. This skill identifies the best-performing algorithm configuration (e.g., AdaBoost with nIter=150, method='Adaboost.M1') by training multiple classifiers on development data and ranking them by performance across diverse quality metrics.

When to use

After calculating 12 peak-quality metrics on a development set of extracted ion chromatograms (EICs) and labeled peaks, when you need to select both the best classification algorithm and its optimal hyperparameters before training a final model on held-out test data. Typical trigger: you have a candidate set of 8+ machine learning algorithms and want data-driven evidence to choose one algorithm and its parameter configuration rather than relying on defaults.

When NOT to use

  • Input is a pre-trained, published classifier model with fixed hyperparameters — skip optimization and go directly to getPredictions() on test data.
  • Development set is <100 peaks or heavily imbalanced (>>90% one class) — cross-validation results will be unreliable; collect more balanced labeled data first.
  • You only have a test set with no held-out development set — hyperparameter tuning on test data causes overfitting; partition labeled data into development and test before applying this skill.

Inputs

  • Peak-quality metrics matrix (pqm_development): 500+ peaks × 89 samples with 12 calculated quality metrics (RSD, signal-to-noise, shape symmetry, etc.)
  • Binary labels or quality annotations for development peaks
  • List of candidate classification algorithms (subset or all 8 available in caret)

Outputs

  • Cross-validation results object (models$<algorithm>$pred) containing predictions and hyperparameter combinations for each fold/repetition
  • Evaluation measures data frame (M4, M7, M11, etc.) for each model–hyperparameter pair
  • Optimized hyperparameter values and algorithm name (e.g., AdaBoost with nIter=150, method='Adaboost.M1')
  • Visualization plots (bar plots, CD plots) comparing classifier performance

How to apply

Call runCrossValidation() with k=5 folds, repNum=10 repetitions, rand.seed=512, and a subset of models (e.g., models='all' to try AdaBoost, Random Forest, SVM, etc.) on the development peak-quality matrix (pqm_development). Extract the pred data frame from each trained model to access hyperparameter combinations and their cross-validation performance. Calculate evaluation measures (e.g., M4, M7, M11 representing sensitivity, specificity, and F-score) using getEvaluationMeasures() for each model–hyperparameter pair. Visualize comparative rankings with getBarPlots() or getCDPlots() to identify the algorithm and hyperparameters yielding the highest performance across your chosen metric set. Record the optimized configuration (e.g., nIter and method for AdaBoost) and validate it corresponds to the best-performing classifier before invoking trainClassifier() with those fixed hyperparameters on the full development set.

Related tools

  • MetaClean (R package hosting the runCrossValidation(), getEvaluationMeasures(), getBarPlots(), getCDPlots(), and trainClassifier() functions for classifier optimization and evaluation) — https://github.com/KelseyChetnik/MetaClean
  • caret (Underlying R package providing the 8 classification algorithms (including AdaBoost, Random Forest, SVM, etc.) and cross-validation framework used by MetaClean)
  • R (Programming environment for executing MetaClean functions and manipulating cross-validation results)

Examples

models <- runCrossValidation(trainData = pqm_development, k = 5, repNum = 10, rand.seed = 512, models = 'all', metricSet = c('M4','M7','M11')); eval_measures <- getEvaluationMeasures(models); getBarPlots(eval_measures); optimized_model <- trainClassifier(trainData = pqm_development, model = 'AdaBoost', metricSet = 'M11', hyperparameters = list(nIter = 150, method = 'Adaboost.M1'))

Evaluation signals

  • Cross-validation repetitions (repNum=10) converge on the same or highly similar best hyperparameters; high variance across repetitions suggests unstable optimization.
  • Evaluation measures (sensitivity M4, specificity M7, F-score M11) for the selected algorithm exceed baseline or threshold values (e.g., F-score > 0.80); compare against published benchmarks if available.
  • Optimized hyperparameters differ meaningfully from algorithm defaults; if optimized nIter, method, or other tuned parameters match library defaults, re-check cross-validation configuration (seed, folds, metric set).
  • Performance on held-out test set (obtained via getPredictions() with optimized hyperparameters) remains within ±5–10% of cross-validation performance; larger gaps indicate overfitting or distribution shift.
  • Bar plots / CD plots show the selected algorithm as statistically distinct (non-overlapping confidence intervals) from runner-up classifiers across the metric set.

Limitations

  • Cross-validation results depend critically on the composition and balance of the development set; sparse or skewed class distributions can produce unreliable rankings.
  • Optimization uses only the 12 pre-defined peak-quality metrics (RSD, S/N, shape symmetry, etc.); novel or domain-specific metrics not in the MetaClean metric set are not considered.
  • The skill assumes independence between peak samples; if peaks within the same sample or batch are highly correlated, cross-validation folds may leak information between training and validation sets.
  • Hyperparameter space explored is limited to algorithm-specific tuning grids in caret; custom or application-specific hyperparameter ranges beyond caret defaults cannot be searched with runCrossValidation().

Evidence

  • [methods] Cross-validation setup and hyperparameter extraction: "Load the trained models list returned by runCrossValidation() with parameters k=5, repNum=10, rand.seed=512, models='all', metricSet=c('M4','M7','M11') on pqm_development (500 peaks, 89 samples). 2."
  • [methods] Evaluation measures computation: "The runCrossValidation function is a wrapper function that uses cross-validation to train a user-selected subset of the 8 available algorithms."
  • [methods] Comparative visualization: "MetaClean provides a simple wrapper function to easily generate bar plot visualizations of the evaluation measures for each model. This is getBarPlots"
  • [methods] Classifier training with optimized hyperparameters: "metaclean_model <- trainClassifier(trainData = pqm_development, model = "AdaBoost", metricSet = "M11", hyperparameters = hyperparameters)"
  • [readme] Algorithm diversity and metric foundation: "MetaClean utilizes 12 peak-quality metrics and 9 diverse machine learning algorithms to build a classifier to detect and flag low-quality peaks in untargeted metabolomics data."

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 328,083. 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.