Skip to content

Bulk Analyses Leave One Site Out

Module: spectralbridge.bulk.analyses.leave_one_site_out.

Leave-one-site-out validation for synthetic sensor translation.

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.

LeaveOneSiteOutPaths dataclass

LeaveOneSiteOutPaths(directory: Path)

Resolve held-site fit tables and metadata beneath a bulk analysis run.

results property

results: Path

metadata property

metadata: Path

Audience: public. Also exported as spectralbridge.bulk.analyses.run_leave_one_site_out, spectralbridge.bulk.run_leave_one_site_out.

run_leave_one_site_out

run_leave_one_site_out(con: DuckDBPyConnection, paths: BulkAnalysisPaths, *, analysis_run_id: str, minimum_reflectance: float, translation_pairs: tuple[TranslationPair, ...] | None = None, reuse_existing: bool = True) -> dict[str, Any]

Fit on all other sites and score every held-out site.

Parameters:

Name Type Description Default
con DuckDBPyConnection

Open DuckDB connection prepared by the bulk workflow with the required catalog and observation views; the caller owns its lifetime.

required
paths BulkAnalysisPaths

BulkAnalysisPaths instance selecting isolated catalog, database, analysis and report locations.

required
analysis_run_id str

Provenance identifier written into generated tables and restart metadata for this run.

required
minimum_reflectance float

Lower screening bound in the stored reflectance units; used for regression validity, not automatic unit conversion.

required
translation_pairs tuple[TranslationPair, ...] | None

Explicit registered source-to-target relationships to analyze; None uses the selected registry/profile defaults.

None
reuse_existing bool

Reuse valid analysis outputs when their recorded inputs match, rather than recomputing them.

True

Returns:

Type Description
dict[str, Any]

Status, held-site result count and paths to compact results and metadata.

See Also

spectralbridge.pipelines.bulk.run_bulk_pipeline : Related source-derived API contract.

Explicitly exported constants and type aliases

These values describe package metadata, schemas or configuration; they are not observations from a production dataset.

Name Source expression
REQUIRED_INPUT_TABLES ('bulk_observations',)
REQUIRED_PROVENANCE_COLUMNS ('bulk_flightline_id', 'bulk_site')