Skip to content

Plant Spectral Quantiles

Module: spectralbridge.plant_spectral_quantiles.

Checkpointed boosted conditional quantile signatures and held-plant matching.

Fitted curves are representations, never synthetic independent plant observations. Species fits use independent polygon medians; individual fits use repeated-flight polygon medians. Unsupported NEON segments are trained separately.

API glossary · Workflow / scientific context

Signatures and documentation below are collected from the current source. Advanced objects are not newly declared stable by inclusion here.

Audience: advanced.

QuantileModelConfig dataclass

QuantileModelConfig(quantiles: tuple[float, ...] = QUANTILES, boosting_rounds: int = 80, learning_rate: float = 0.1, max_depth: int = 5, max_bin: int = 256, seed: int = 0, min_plants_per_species: int = 10, holdout_fraction: float = 0.2, workers: int = 4, stages: tuple[str, ...] = _STAGES)

Configure historical boosted quantile spectral models, group eligibility and rendering budgets.

validate

validate()

Audience: advanced.

fit_quantile_signature

fit_quantile_signature(wavelengths, spectra, *, config=None, hyperspectral=True)

Fit exact supplied wavelengths with equal total weight per input spectrum.

NaN columns and >8 nm hyperspectral gaps split independent boosting models. Returns raw fitted quantiles and explicitly pointwise-rearranged ordered quantiles. No clipping, normalization, extrapolation or added samples.

Audience: advanced.

quantile_distance

quantile_distance(observed, curves, quantiles, *, minimum_bands=2)

Mean pinball loss times two: a discrete 1–99% integrated-score approximation.

Lower is a closer match in supplied units. It is not a class probability and treats wavelengths marginally, without estimating spectral covariance.

Audience: advanced.

rank_unknown_spectrum

rank_unknown_spectrum(output_dir, wavelengths_nm, values, *, stage='corr', region=None, level='species', exclude_plant_ids=(), minimum_shared_fraction=0.5, allow_unverified_export_coordinates=False)

Rank supplied native-unit spectra against full quantile references.

Pointwise pinball ranking is exploratory; scores are not identification probabilities. Query gaps/exclusions are preserved, with no extrapolation. Individual references represent repeated observations of one polygon.

Audience: advanced.

run_boosted_quantile_atlas

run_boosted_quantile_atlas(comparisons_dir, output_dir, *, config=None, make_individual_pdf=True)

Fit species/site and individual-polygon quantile signatures with checkpoints.

All 1–99% quantiles are jointly trained with separate quantile tree outputs. Uses completed compact tables only. Models/plots are derivatives; original pixel library and parent plant tables remain immutable.