API reference
The public API is re-exported from the top-level xpectra namespace. The tables below are
generated from the installed package; click any name for the full signature and docstring.
Configuration & data
Labeled spectra (4 studies, unknowns dropped), grouped 6-class labels. |
|
The kedzierski_2019_u unlabeled environmental pool, on the labeled grid. |
|
One external augmentation pool (openspecy / simple / awi2024) from the norm route. |
|
Leave-one-study-out folds over the labeled studies. |
|
Masks for synthetic OOD: train without one class, hold it out as OOD. |
Metrics
Top-label ECE plus the per-bin table used for reliability diagrams. |
|
Mean squared error between one-hot labels and predicted probabilities. |
|
Selective-risk curve: abstain on the least confident samples first. |
|
Area under the risk-coverage curve (lower is better). |
|
Accuracy/macro-F1/MCC on the retained fraction at a target coverage. |
Calibration
One estimator + one calibration method behind a uniform proba API. |
|
Single-parameter temperature scaling fitted by NLL minimization. |
|
Per-bin confidence/accuracy table for reliability diagrams. |
Out-of-distribution detection & abstention
Predict a class when the OOD score is below tau, otherwise abstain. |
|
1 - max predicted probability. |
|
Normalized Shannon entropy of the predictive distribution. |
|
Negative log-sum-exp of logits (log-proba fallback for CV-calibrated models). |
|
Min per-class Mahalanobis distance in PCA space (shared LW covariance). |
|
Distance to the k-th nearest training sample in PCA space. |
|
Min spectral angle to the class-mean spectra (norm route only). |
Semi-supervised learning
LabelSpreading with a sparse kNN kernel on PCA-reduced features. |
|
Per LOSO fold: supervised-only vs self-training vs label-spreading, all evaluated on the held-out study. |
Weathering analysis
Integrated area (or peak height) of a wavenumber window. |
|
C=O band relative to the CH2-scissoring reference band. |
|
Spearman correlations of carbonyl index vs confidence and OOD scores. |
|
Class fractions among the unknowns, with and without abstentions. |
Module index
Configuration for the xpectra weathered-unknowns study. |
|
Data loading for the trust study, built on xpectra.pipeline. |
|
Calibration and selective-prediction metrics not provided by sklearn. |
|
Leakage-safe probability calibration wrappers. |
|
Out-of-distribution scoring and abstention. |
|
Semi-supervised learning: do the 4,058 unlabeled weathered spectra help? |
|
Band-ratio weathering indicators (carbonyl index) and composition tables. |
|
Experimental orchestrators shared by the driver scripts. |
|
Publication figures for the trust study. |
|
Reusable training and prediction utilities for the FTIR notebooks. |