agentsclimarketplace

Topic label validation distribution analysis

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/ms-generic/skills/topic-label-validation-distribution-analysis

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 topic-label-validation-distribution-analysis

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 LDA topic inference has assigned dominant topic labels to mass spectra, and before those labels are passed to MLP or GNN multi-task training.

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

7.0 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

topic-label-validation-distribution-analysis

Summary

Validate and analyze the distribution of LDA-derived spectral topic labels across a dataset to ensure they capture meaningful spectral patterns before use as multi-task learning targets. This skill verifies label quality and statistical representativeness to enable reliable enhancement of neural network models.

When to use

After LDA topic inference has assigned dominant topic labels to mass spectra, and before those labels are passed to MLP or GNN multi-task training. Use this skill when you need to confirm that topic assignments are balanced across the dataset, that no topics are over- or under-represented, and that the inferred topics reflect genuine spectral heterogeneity rather than artifacts of the LDA fit.

When NOT to use

  • Topic labels have not yet been assigned by LDA (perform LDA inference first).
  • The goal is exploratory LDA analysis rather than preparation for multi-task learning (use unsupervised topic coherence metrics instead).
  • Spectra are from a completely homogeneous sample expected to cluster into a single topic (distribution validation is unnecessary when diversity is not expected).

Inputs

  • spectrum identifiers (string or integer array)
  • LDA-inferred dominant topic labels (integer array, one label per spectrum)
  • preprocessed spectral feature matrix or metadata (for validation cross-reference)

Outputs

  • topic label distribution table (topic ID, count, proportion)
  • distribution statistics (mean, std, min, max topic frequency)
  • validation report (flag for imbalance or anomalies)
  • validated label assignments (confirmed safe for downstream multi-task training)

How to apply

Load the structured table of spectrum identifiers and their corresponding LDA topic label assignments. Compute the frequency distribution (histogram or count table) of topic labels across all spectra in the dataset. Check for severe class imbalance (e.g., one topic dominating >80% of spectra) or near-empty topics, which would indicate poor topic separation or hyperparameter miscalibration. Validate that topics capture coherent spectral patterns by spot-checking representative spectra in each topic class and confirming that inferred topics align with domain knowledge of mass spectrometry fragmentation. Record the label distribution statistics (counts, proportions, min/max topic frequency) and flag any anomalies before passing validated labels to multi-task training pipelines.

Related tools

  • LDA (Latent Dirichlet Allocation) (Upstream inference tool that produces the topic labels being validated)
  • scikit-learn (Provides histogram, counting, and statistical distribution functions for label validation)
  • ESP (Ensembled Spectral Prediction) (Downstream multi-task learning pipeline that consumes validated topic labels) — https://github.com/HassounLab/ESP

Examples

# Validate topic label distribution after LDA inference
topic_counts = pd.Series(topic_labels).value_counts().sort_index()
print(topic_counts)
if topic_counts.max() / len(topic_labels) > 0.8:
    print('WARNING: Severe class imbalance detected')
else:
    print('Topic distribution validated; safe for multi-task training')

Evaluation signals

  • No topic label is missing or null across the spectrum identifiers (100% label assignment rate).
  • No single topic accounts for >80% of the dataset (severe class imbalance check).
  • Each topic has at least 5–10 assigned spectra (minimum viable frequency to avoid overfitting in multi-task branch).
  • Distribution plot shows multiple distinct topic clusters rather than a unimodal peak (confirms topic separation).
  • When spot-checked, representative spectra within each topic show visual or chemical coherence (fragmentation patterns or m/z distributions align within topic groups).

Limitations

  • LDA hyperparameter (number of topics) must be set a priori; this validation cannot recover from severe over- or under-specification of topic count.
  • Distribution validation does not guarantee that topics are chemically meaningful or align with reference metabolite classes; visual and domain-expert inspection is still required.
  • Imbalanced distributions may reflect true underlying biology (e.g., a dataset dominated by lipids) rather than a methodological failure; domain context is necessary to interpret flagged anomalies.
  • Small datasets (<500 spectra) may show high variance in topic label frequencies even with correct LDA settings; statistical significance of imbalance should be interpreted cautiously.

Evidence

  • [other] Compile topic label assignments into a structured table with spectrum identifiers and their corresponding topic labels.: "Compile topic label assignments into a structured table with spectrum identifiers and their corresponding topic labels."
  • [other] Verify label distribution across the dataset and validate that topics capture meaningful spectral patterns before passing labels to MLP and GNN multi-task training.: "Verify label distribution across the dataset and validate that topics capture meaningful spectral patterns before passing labels to MLP and GNN multi-task training."
  • [intro] spectral topic labels obtained using LDA (Latent Dirichlet Allocation) and used as additional multi-tasking data to enhance both MLP and GNN predictors alongside an attention mechanism.: "spectral topic labels obtained using LDA (Latent Dirichlet Allocation) and used as additional multi-tasking data to enhance both MLP and GNN predictors"
  • [readme] multi-tasking on additional data (spectral topic labels obtained using LDA (Latent Dirichlet Allocation), and 2) attention mechanism to capture dependencies among: "multi-tasking on additional data (spectral topic labels obtained using LDA (Latent Dirichlet Allocation), and 2) attention mechanism to capture dependencies"

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 327,132. 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.