Selection and Validation Nodes
Summary
Reference: nodes for choosing variables, splitting samples, and estimating reliability — cross-validation, variable selection, and component selection.
Selection and validation nodes help choose variables, split samples, and estimate model reliability.
Sample Partitioning
Variable Selection
Explicit feature engineering
Select Columns (selection.select_columns) keeps or excludes exact feature names from a SpectralDataset. Run its upstream node to populate the searchable column multi-select. Selection preserves the input column order, sample identities, target values, units, and missing values. Selecting no columns in keep mode is an error; in exclude mode it keeps every column. Unnamed features use one-based names such as Column 1.
Merge Features (data.merge_features) appends an Additional Features dataset to a Base Dataset. The base controls row order, sample metadata, and targets. The default join uses unique sample labels; sample_index instead uses retained sample-axis coordinates, not the current row positions or equal row counts. Both inputs must contain exactly the same unique sample identities. Reordered rows are aligned; unmatched/duplicate identities, conflicting targets, and conflicting inclusion masks are rejected.
For peak-feature engineering, connect Normalize to Merge Features' Base Dataset, Peak Finding's Per-spectrum Peak Matrix to Select Columns, and Select Columns to Additional Features. Connect Merged Features to Train/Test Split. Output names are prefixed base:: and added:: to prevent collisions. The output has a generic named feature axis, while original coordinate axes, block provenance and individual column units remain in metadata. Data View's Columns range selector lets you inspect appended columns beyond the first 50.
Neither node scales blocks or imputes missing values. Guide magnitudes remain measured values even when a peak is not detected; detected-peak measurements can remain missing. Choose a downstream method that supports your missing-value policy. Consider block weighting/scaling deliberately: these operations do not imply improved prediction, and distance-based splitting can change when features are appended.
Peak locations specified independently from chemical knowledge do not learn from held-out spectra. By contrast, consensus positions estimated from all input spectra are data-derived; use training-only estimation and fixed application when evaluating an inductive model. These two nodes select and combine already-computed features; they do not change Peak Finding's consensus-estimation procedure.
Model-based selection
selection.variable_select: Select wavelengths by VIP, coefficients, spectral region, peaks, or an incoming mask.
selection.dimension_project: Select one exact index from every inner dimension of an n-dimensional dataset before a two-dimensional algorithm. The closed projection record contains one zero-based index for every inner dimension.
selection.ipls: Search spectral intervals and keep the interval set with best cross-validated PLS performance.
selection.cars: Perform competitive adaptive reweighted sampling for wavelength selection.
selection.spa: Select variables with low collinearity using successive projections.
selection.mcuve: Rank measured variables by PLS-coefficient stability across Monte Carlo calibration subsets and retain the declared top count.
selection.stability: Keep variables that repeatedly pass a declared PLS scoring rule in seeded half-samples; reports empirical selection frequency, not predictive performance or a formal false-discovery guarantee.
selection.compare: Record Jaccard overlap among two to four exact boolean masks and build an inclusive-vote consensus without ranking the selectors. Retain a variable when votes are at least ceil(threshold × method_count); 0.5 means at least half, not a strict majority.
selection.audit: Produce a deterministic, digest-bound projection of the selection provenance already recorded on a dataset. include_scores controls whether exact finite feature scores accompany their always-recorded digest.
Validation and Diagnostics
selection.nested_cv: Estimate performance when variable selection happens inside each outer CV fold, with selection and PLS component tuning fitted together inside each inner-training fold. Requires one quantitative target. Single-repeat and repeated-validation evidence have different replay semantics, described below.
diagnostics.cross_validation: Summarize one producer-bound regression out-of-fold evidence record; it does not split or refit. Rejects missing or unbound evidence.
diagnostics.regression_evaluator: Compute the closed regression metric registry from explicit predictions and references. Local workbench evaluation requires the explicit reference edge; managed evaluation receives fold authority separately.
diagnostics.classification_evaluator: Compute confusion-matrix and label metrics from explicit predictions and references. The local evaluator does not verify held-out status; establish it from retained split/run lineage. Rejected or prediction-only labels remain visible.
diagnostics.outliers: Screen fitted PCA calibration samples by Hotelling T² and Q/SPE residuals. Connect the typed diagnostic-state output from Fit PCA Transform.
stats.summary: Compute deterministic descriptive summaries without inventing diagnostics or missing data.
Interpretation
Selection can improve interpretability, but it can also overfit. Prefer nested validation or a true holdout when variable selection influences the final model. A variable-selection method that sees the full dataset before cross-validation will usually make the CV result too optimistic.
selection.compare is an agreement recorder, not a model-selection or performance test. It uses the Jaccard coefficient (Jaccard, 1901, DOI 10.5169/seals-266450) for pairwise overlap and preserves the exact boolean input masks and their digests, vote counts, threshold, required vote count, union, intersection, and consensus mask in its report. That makes the agreement calculation independently replayable after upstream execution outputs are gone. Agreement between selectors does not show that the selected variables generalize; evaluate any resulting recipe under the same leakage-safe validation design used for the model.
selection.audit is provenance infrastructure, not a feature-selection algorithm and not an independent scientific verifier. It records a closed vocabulary of canonical selection operations, their exact bounded parameters and impacts, source order, input/output shapes, current matrix and feature-axis identities, and a digest chain over the resulting report. Source timestamps are deliberately omitted so identical scientific provenance produces identical audit bytes. The report can detect accidental or malicious changes unless the report and its unsigned digest are both replaced; it does not prove that an upstream selector's scientific calculation was correct. Selector-specific evidence and leakage-safe validation remain authoritative for that claim. Because this node performs no scientific selection calculation, it has no external algorithm citation.
selection.nested_cv uses seeded shuffled row-wise K-fold when no groups are bound. An explicit groups input enables group K-fold in both outer evaluation and inner tuning. Attached specimen groups are used only when group_source=attached is explicitly selected; explicit_or_rows uses explicit groups when connected and otherwise row-wise folds. See the generated registry reference below for the current default. Grouped folds are deterministic; the seed still controls stochastic selectors. Supply enough independent groups for both levels. Temporal validation is not implied. Group IDs and complete fold membership are retained and checked on evidence replay. The result records the canonical SDK split-plan digest and complete fold membership, plus the root seed and its versioned per-fold seed derivation. RMSECV, R², and positive-overprediction bias come from the versioned metric registry. SEP is the sample standard deviation of prediction residuals after removing that bias; RER is the observed target range divided by SEP. When SEP is exactly zero, RER has no finite scientific value, so the node reports rer: null with rer_status: undefined_zero_sep instead of substituting an arbitrary numerical floor.
The nested evaluator also records a closed selector profile. CARS uses 30 iterations and at most three selector folds; MC-UVE uses 30 Monte Carlo calibration subsets, a 0.8 calibration fraction, and retains at most 20 ranked variables; SPA selects at most 20 variables. These fixed local defaults are emitted in cv_metrics.selector_profile, so a scientist can see the exact choices rather than inheriting hidden implementation settings.
PCA outlier screening uses the fitted model's actual eigenvalues for Hotelling T² and the Nomikos–MacGregor finite-sample F limit. Q/SPE is calculated from the reconstruction residuals in the fitted feature space. Its displayed boundary is the selected quantile of those same calibration residuals: it is useful for screening the fitted samples, but it is not an independently validated false-alarm limit. Use a separately governed validation set when making a performance or deployment claim.
Held-out Regression with Source Labels
diagnostics.labeled_regression_evaluator is the workbench evaluator used by
new PLS Calibration starters. Connect predictions, explicit held-out reference
values (y_true), and the same held-out dataset (sample_context). It requires
matching row counts, response names, finite reference values in the same order,
and explicit sample labels. Comparison tables and plots retain those labels and their row order (labels need
not be unique);
metrics use the same versioned registry as the managed evaluator.
Before constructing comparison rows, the node checks a conservative limit of
500,000 counted values (including comparison expansion) and 2 MiB of text,
including repeated sample labels and response names. Excess input is refused;
select a smaller explicit cohort rather than silently truncating evaluation.
Python export uses the same evaluator and checks. The existing
diagnostics.regression_evaluator remains the frozen managed-fold operation;
its contract and replay identity are unchanged.
Inner tuning authority
Each inner candidate fits its selector using only inner-training observations, fits PLS on those columns, and predicts the inner-validation observations. Squared errors are pooled by observation count. A candidate lacking enough selected columns in any inner fold is not scored on a subset of folds. The chosen selector and model are refitted on the complete outer-training fold. Outer-test targets never participate. Outer-fold selection stability remains descriptive, not an independent validation of the selected model.
Repeated validation
Set Validation Repeats above one to run separately seeded nested validations.
Each repeat retains its own split, group IDs, out-of-fold predictions, selected
components and selection stability. The summary reports per-repeat RMSECV, R²,
bias and SEP with their mean, sample standard deviation and range. These are
partition-sensitivity statistics for the same dataset, not confidence intervals,
external validation or additional independent observations. Grouped repeats
randomly partition whole groups; single grouped runs remain deterministic.
Repeated mode emits repeated_evidence instead of a single oof_evidence record.
Do not feed it to a single-repeat evaluator or flatten its predictions. The
Inspector and expanded output show the repeated summary; exact evidence is
retained for export/replay. Fixed-prediction bootstrap semantics are unchanged.
The visible max_selector_fits budget limits selector calls; its current default is in the generated registry reference below. The conservative bound is repeats × outer folds × (3 × candidate components + 1). Oversized requests stop before fitting; reduce settings or explicitly raise the budget. The existing execution timeout still applies. Outer refits adapt the component count if fewer selected features survive, retaining both the inner choice and effective count in metrics.
Registry reference
Generated from registered node metadata. Edit methodology and examples outside the marked section.
Defaults and options below are JSON values; null means no concrete default is declared.
Internal parameters are retained for contract inspection and are not scientist-editable controls.
Conditional visibility describes the editor; execution admission remains node-owned.
| Node |
Operation |
| Merge Features |
data.merge_features |
| Reference Classification Evaluator (v2) |
diagnostics.classification_evaluator |
| Evaluate Out-of-Fold Predictions |
diagnostics.cross_validation |
| Held-out Regression with Source Labels |
diagnostics.labeled_regression_evaluator |
| Detect Outliers |
diagnostics.outliers |
| Reference Regression Evaluator (v2) |
diagnostics.regression_evaluator |
| Audit Feature Selection |
selection.audit |
| CARS |
selection.cars |
| Compare Feature Selections |
selection.compare |
| Dimension Projection |
selection.dimension_project |
| Interval PLS (iPLS) |
selection.ipls |
| MC-UVE |
selection.mcuve |
| Evaluate Nested CV Selection |
selection.nested_cv |
| Select Columns |
selection.select_columns |
| SPA-MLR Variable Selection (Araújo 2001) |
selection.spa |
| Stability Selection |
selection.stability |
| Variable Selection Rule |
selection.variable_select |
Merge Features (data.merge_features)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
base |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| input |
additional |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
match_by |
select |
true |
"sample_labels" |
["sample_labels", "sample_index"] |
— |
{"category": "basic"} |
Unique sample labels or retained sample-axis coordinates, not row count |
Reference Classification Evaluator (v2) (diagnostics.classification_evaluator)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/Categorical/1.0 |
true |
false |
[] |
| input |
y_true |
spectrasherpa://types/TargetMatrix/1.0 |
false |
false |
[] |
| output |
default |
spectrasherpa://types/ValidationResult/1.0 |
true |
false |
[] |
| output |
comparison |
spectrasherpa://types/ClassificationComparison/1.0 |
false |
false |
[] |
| output |
visualization |
spectrasherpa://types/Visualization/1.0 |
false |
false |
[] |
Parameters
No parameters.
Evaluate Out-of-Fold Predictions (diagnostics.cross_validation)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
evidence |
spectrasherpa://types/OutOfFoldEvidence/1.0 |
true |
false |
[] |
| output |
cv_metrics |
spectrasherpa://types/ValidationResult/1.0 |
true |
false |
[] |
| output |
observations |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
predictions |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
fold_assignments |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
plots |
spectrasherpa://types/Visualization/1.0 |
false |
false |
[] |
Parameters
No parameters.
Held-out Regression with Source Labels (diagnostics.labeled_regression_evaluator)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| input |
y_true |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| input |
sample_context |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
default |
spectrasherpa://types/ValidationResult/1.0 |
true |
false |
[] |
| output |
comparison |
spectrasherpa://types/RegressionComparison/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
target_names |
string_list |
false |
[] |
— |
— |
{"category": "internal"} |
Exact response labels inherited from the selected dataset target. |
Detect Outliers (diagnostics.outliers)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/DecompositionResult/1.0 |
true |
false |
[] |
| output |
model |
spectrasherpa://types/DecompositionResult/1.0 |
true |
false |
[] |
| output |
flags |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
T2 |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
Q |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
confidence_level |
number |
true |
0.95 |
— |
{"max_value": 0.999, "min_value": 0.8, "step": 0.01} |
{"category": "basic"} |
Confidence level for the calibration Hotelling T² and residual-spectrum Q/SPE limits Keeps the F-distribution limit finite and bounds unstable extreme-tail screening |
Reference Regression Evaluator (v2) (diagnostics.regression_evaluator)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| input |
y_true |
spectrasherpa://types/TargetMatrix/1.0 |
false |
false |
[] |
| output |
default |
spectrasherpa://types/ValidationResult/1.0 |
true |
false |
[] |
| output |
comparison |
spectrasherpa://types/RegressionComparison/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
target_names |
string_list |
false |
[] |
— |
— |
{"category": "internal"} |
Exact response labels inherited from the selected dataset target. |
Audit Feature Selection (selection.audit)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| output |
X_out |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
audit |
spectrasherpa://types/Any/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
include_scores |
boolean |
true |
true |
— |
— |
{"category": "basic"} |
Include finite per-feature scores when present; their digest is always recorded |
CARS (selection.cars)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
n_iterations |
number |
true |
50 |
— |
{"max_value": 200, "min_value": 10, "step": 5} |
{"category": "basic"} |
Number of sampling iterations Bounds stochastic PLS fits and interactive runtime while retaining a dense CARS path. |
max_components |
number |
true |
2 |
— |
{"max_value": 50, "min_value": 1, "step": 1} |
{"category": "basic"} |
Maximum latent variables evaluated for each recorded subset PLS latent-variable cap; runtime also restricts it to sample and feature support. |
cv_folds |
number |
true |
5 |
— |
{"max_value": 20, "min_value": 2, "step": 1} |
{"category": "basic"} |
Cross-validation folds Bounds repeated PLS fitting and prevents impractically small validation folds. |
calibration_fraction |
number |
true |
0.9 |
— |
{"max_value": 0.95, "min_value": 0.5, "step": 0.05} |
{"category": "advanced"} |
Fraction of samples used for each stochastic coefficient fit Leaves at least five percent outside each Monte Carlo calibration draw. |
component_selection |
select |
true |
"one_standard_deviation" |
["minimum_rmsecv", "one_standard_deviation"] |
— |
{"category": "advanced"} |
Choose the global RMSECV minimum or the simplest component count whose MSE lies within one sample-error standard deviation of that minimum |
cv_order |
select |
true |
"sorted_target" |
["sorted_target", "seeded_random", "input_order"] |
— |
{"category": "advanced"} |
Author-defined sample ordering before cyclic fold assignment |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Exact seed for Monte Carlo draws, adaptive sampling, and fixed CV folds Exact unsigned 32-bit seed accepted by the canonical CARS random generator. |
Compare Feature Selections (selection.compare)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
mask_1 |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| input |
mask_2 |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| input |
mask_3 |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
| input |
mask_4 |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
| output |
X_consensus |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
consensus_mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
report |
spectrasherpa://types/Any/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
consensus_threshold |
number |
true |
0.5 |
— |
{"max_value": 1.0, "min_value": 0.0, "step": 0.05} |
{"category": "basic"} |
Retain a feature when selected by at least ceil(fraction x method count) methods; 0.5 means at least half, not strictly more than half A vote fraction cannot exceed all admitted methods. |
Dimension Projection (selection.dimension_project)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
projection |
json |
true |
{"schema_version": "spectrasherpa-dimension-projection/1", "selections": []} |
— |
— |
{"category": "basic"} |
One exact zero-based index for every inner dimension |
Interval PLS (iPLS) (selection.ipls)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
n_intervals |
number |
true |
20 |
— |
{"max_value": 100, "min_value": 2, "step": 1} |
{"category": "basic"} |
Number of contiguous, non-overlapping intervals spanning the complete feature axis Bounds the number of independently cross-validated local PLS models. |
max_components |
number |
true |
5 |
— |
{"max_value": 30, "min_value": 1, "step": 1} |
{"category": "basic"} |
Maximum PLS latent variables evaluated independently for each interval Bounds latent-variable fitting for every local and full-spectrum model. |
cv_folds |
number |
true |
5 |
— |
{"max_value": 20, "min_value": 2, "step": 1} |
{"category": "basic"} |
Venetian-blinds folds shared by every interval and the full-spectrum reference Bounds repeated local PLS fitting and requires supported held-out folds. |
cv_order |
select |
true |
"sorted_target" |
["sorted_target", "seeded_random", "input_order"] |
— |
{"category": "advanced"} |
Sample order before cyclic Venetian-blinds fold assignment |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Seed for the optional seeded-random sample order Exact unsigned 32-bit seed used only by seeded-random CV ordering. |
MC-UVE (selection.mcuve)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
n_components |
number |
true |
5 |
— |
{"max_value": 50, "min_value": 1, "step": 1} |
{"category": "basic"} |
Bounds latent-variable fitting and calibration-subset support. |
n_resamples |
number |
true |
100 |
— |
{"max_value": 500, "min_value": 20, "step": 10} |
{"category": "basic"} |
Hard cap on the number of PLS models fitted by one node execution. |
calibration_fraction |
number |
true |
0.8 |
— |
{"max_value": 0.95, "min_value": 0.5, "step": 0.05} |
{"category": "advanced"} |
Leaves at least five percent outside each Monte Carlo calibration subset. |
n_variables |
number |
true |
20 |
— |
{"max_value": 500, "min_value": 1, "step": 1} |
{"category": "basic"} |
Bounds the canonical retained-variable decision and exported state size. |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Exact unsigned 32-bit seed used for Monte Carlo calibration subsets. |
Evaluate Nested CV Selection (selection.nested_cv)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
groups |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
repeated_evidence |
spectrasherpa://types/ValidationResult/1.0 |
false |
false |
[] |
| output |
cv_metrics |
spectrasherpa://types/ValidationResult/1.0 |
true |
false |
[] |
| output |
oof_evidence |
spectrasherpa://types/OutOfFoldEvidence/1.0 |
false |
false |
[] |
| output |
stability |
spectrasherpa://types/ValidationResult/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
group_source |
select |
true |
"explicit_or_rows" |
[{"label": "Row-wise unless Groups input is connected", "value": "explicit_or_rows"}, {"label": "Use attached specimen groups", "value": "attached"}] |
— |
{"category": "basic"} |
Existing workflows remain row-wise. Attached groups require explicit selection; insufficient groups never silently fall back. |
max_selector_fits |
number |
true |
500 |
— |
{"min_value": 1, "step": 1} |
{"category": "basic"} |
Conservative bound: repeats × outer folds × (3 × maximum components + 1). Each CARS/MCUVE call fits many models. Raising this budget does not raise the 120-second node limit. |
n_repeats |
number |
true |
1 |
— |
{"max_value": 20, "min_value": 1, "step": 1} |
{"category": "basic"} |
Separate seeded repeats; spread measures partition sensitivity, not new specimens. Repeated nested fitting multiplies selector and model work. |
selection_method |
select |
true |
"vip" |
[{"label": "VIP", "value": "vip"}, {"label": "|Coefficient|", "value": "coef_abs"}, {"label": "CARS", "value": "cars"}, {"label": "MC-UVE", "value": "mcuve"}, {"label": "SPA", "value": "spa"}, {"label": "None (full spectrum)", "value": "none"}] |
— |
{"category": "basic"} |
Variable selection method applied inside each fold |
n_components |
number |
true |
5 |
— |
{"max_value": 50, "min_value": 1, "step": 1} |
{"category": "basic"} |
Maximum latent variables considered by the inner CV loop Bounds the inner PLS search inside the declared local resource envelope. |
cv_folds |
number |
true |
5 |
— |
{"max_value": 20, "min_value": 2, "step": 1} |
{"category": "basic"} |
Number of outer cross-validation folds Bounds repeated outer and inner fitting inside the declared local resource envelope. |
vip_threshold |
number |
true |
1.0 |
— |
{"min_value": 0.1, "step": 0.1} |
{"category": "advanced", "visible_when": {"selection_method": ["vip"]}} |
VIP threshold (for VIP method) |
coef_threshold |
number |
true |
0.01 |
— |
{"min_value": 0.0, "step": 0.001} |
{"category": "advanced", "visible_when": {"selection_method": ["coef_abs"]}} |
Absolute PLS coefficient threshold (for |Coefficient| method) |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Exact seed for outer folds, inner folds, and stochastic selectors. Exact unsigned 32-bit root seed; per-fold seeds use overflow-safe hash derivation. |
Select Columns (selection.select_columns)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
mode |
select |
true |
"keep" |
["keep", "exclude"] |
— |
{"category": "basic"} |
— |
columns |
string_list |
true |
[] |
— |
— |
{"category": "basic"} |
Exact column names; run the upstream node to populate the selector |
SPA-MLR Variable Selection (Araújo 2001) (selection.spa)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
min_variables |
number |
true |
1 |
— |
{"max_value": 30, "min_value": 1, "step": 1} |
{"category": "basic"} |
Smallest projection-chain prefix evaluated by MLR cross-validation Matches the bounded exhaustive projection and MLR search envelope. |
max_variables |
number |
true |
20 |
— |
{"max_value": 30, "min_value": 1, "step": 1} |
{"category": "basic"} |
Largest projection-chain prefix evaluated by MLR cross-validation Bounds exhaustive projection-chain construction and MLR evaluation. |
cv_folds |
number |
true |
5 |
— |
{"max_value": 20, "min_value": 2, "step": 1} |
{"category": "basic"} |
Venetian-blinds folds shared by every candidate subset Bounds repeated MLR fitting for every candidate chain prefix. |
cv_order |
select |
true |
"sorted_target" |
["sorted_target", "seeded_random", "input_order"] |
— |
{"category": "advanced"} |
Sample order before cyclic Venetian-blinds fold assignment |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Seed for the optional seeded-random sample order Exact unsigned 32-bit seed used only by seeded-random CV ordering. |
Stability Selection (selection.stability)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
y |
spectrasherpa://types/TargetMatrix/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
base_method |
select |
true |
"vip" |
[{"label": "VIP", "value": "vip"}, {"label": "|Coefficient|", "value": "coef_abs"}, {"label": "Selectivity Ratio", "value": "selectivity_ratio"}] |
— |
{"category": "basic"} |
PLS variable score thresholded in every half-sample |
base_threshold |
number |
true |
1.0 |
— |
{"max_value": 1000000.0, "min_value": 1e-06, "step": 0.1} |
{"category": "basic"} |
Bounds the closed base-selector decision envelope. |
selection_probability_threshold |
number |
true |
0.6 |
— |
{"max_value": 1.0, "min_value": 0.500001, "step": 0.05} |
{"category": "basic"} |
Minimum empirical half-sample selection frequency A probability may not exceed one. |
n_resamples |
number |
true |
100 |
— |
{"max_value": 500, "min_value": 20, "step": 10} |
{"category": "basic"} |
Hard cap on PLS fits per node execution. |
n_components |
number |
true |
5 |
— |
{"max_value": 50, "min_value": 1, "step": 1} |
{"category": "basic"} |
Bounds latent-variable fitting and half-sample support. |
random_seed |
number |
true |
42 |
— |
{"max_value": 4294967295, "min_value": 0, "step": 1} |
{"category": "advanced"} |
Exact unsigned 32-bit sampling seed. |
Variable Selection Rule (selection.variable_select)
Ports
| Direction |
Port |
Type URI |
Required |
Variadic |
Accepted data roles |
| input |
X |
spectrasherpa://types/Array2D/1.0 |
true |
false |
["X_spectra", "X_features"] |
| input |
model |
spectrasherpa://types/FittedModel/1.0 |
false |
false |
[] |
| input |
mask |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
| input |
importance_scores |
spectrasherpa://types/VariableImportance/1.0 |
false |
false |
[] |
| output |
default |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
X_selected |
spectrasherpa://types/SpectralDataset/1.0 |
true |
false |
[] |
| output |
mask |
spectrasherpa://types/Array1D/1.0 |
true |
false |
[] |
| output |
scores |
spectrasherpa://types/Array1D/1.0 |
false |
false |
[] |
| output |
selection_report |
spectrasherpa://types/Any/1.0 |
true |
false |
[] |
Parameters
| Parameter |
Editor type |
Required |
Default |
Options / enum |
Bounds / step |
Visibility / category |
Description |
method |
select |
true |
"vip" |
[{"label": "Spectral Interval", "value": "interval"}, {"label": "Peak Window", "value": "peak_window"}, {"label": "Apply Existing Mask", "value": "apply_mask"}, {"label": "VIP (PLS)", "value": "vip"}, {"label": "Normalized Coefficient Magnitude", "value": "coef_abs"}, {"label": "Target-Projection Selectivity Ratio", "value": "selectivity_ratio"}] |
— |
{"category": "basic"} |
— |
region_start |
number |
false |
null |
— |
— |
{"category": "basic", "visible_when": {"method": ["interval"]}} |
— |
region_end |
number |
false |
null |
— |
— |
{"category": "basic", "visible_when": {"method": ["interval"]}} |
— |
peak_prominence |
number |
true |
0.1 |
— |
{"min_value": 0.001, "step": 0.01} |
{"category": "basic", "visible_when": {"method": ["peak_window"]}} |
— |
peak_half_window |
number |
true |
10 |
— |
{"min_value": 1, "step": 1} |
{"category": "basic", "visible_when": {"method": ["peak_window"]}} |
— |
include_negative_extrema |
boolean |
true |
false |
— |
— |
{"category": "advanced", "visible_when": {"method": ["peak_window"]}} |
— |
threshold |
number |
true |
1.0 |
— |
{"min_value": 0.0, "step": 0.1} |
{"category": "basic", "visible_when": {"method": ["vip", "coef_abs", "selectivity_ratio"]}} |
— |
invert |
boolean |
true |
false |
— |
— |
{"category": "advanced"} |
— |