xpectra.data
Data loading for the trust study, built on xpectra.pipeline.
Functions
|
Masks for synthetic OOD: train without one class, hold it out as OOD. |
|
One external augmentation pool (openspecy / simple / awi2024) from the norm route. |
|
Labeled spectra (4 studies, unknowns dropped), grouped 6-class labels. |
|
The kedzierski_2019_u unlabeled environmental pool, on the labeled grid. |
|
Leave-one-study-out folds over the labeled studies. |
- xpectra.data.load_labeled(route, trust, pre=None)[source]
Labeled spectra (4 studies, unknowns dropped), grouped 6-class labels.
When
trust.dedupe_spectrais set, exact-duplicate spectra within a study are dropped (keep-first) before the arrays are returned;n_dropped_duplicatesrecords how many rows were removed.- Parameters:
route (str)
trust (TrustConfig)
pre (PreprocessConfig | None)
- Return type:
- xpectra.data.load_unknown(route, feature_columns, wavenumbers, trust, pre=None)[source]
The kedzierski_2019_u unlabeled environmental pool, on the labeled grid.
- Parameters:
route (str)
wavenumbers (ndarray)
trust (TrustConfig)
pre (PreprocessConfig | None)
- Return type:
- xpectra.data.load_external(study_id, feature_columns, label_encoder, trust, pre=None)[source]
One external augmentation pool (openspecy / simple / awi2024) from the norm route.
The combined route files carry all datasets; externals are selected by their
studyid and are never part ofload_labeled. Returns (X, y, source) on the labeled feature grid, with labels already in the 6-group scheme encoded bylabel_encoder.sourceis the per-row source_study (finer than the dataset id only for openspecy), joined from the catalog DB; it falls back to the dataset id if the catalog is absent.- Parameters:
study_id (str)
label_encoder (Any)
trust (TrustConfig)
pre (PreprocessConfig | None)
- Return type: