xpectra.ssl

Semi-supervised learning: do the 4,058 unlabeled weathered spectra help?

Functions

label_spread(X_lab, y_lab, X_unlab[, ...])

LabelSpreading with a sparse kNN kernel on PCA-reduced features.

self_train(estimator, X_lab, y_lab, X_unlab)

ssl_loso_experiment(estimator, X_lab, y_lab, ...)

Per LOSO fold: supervised-only vs self-training vs label-spreading, all evaluated on the held-out study.

xpectra.ssl.self_train(estimator, X_lab, y_lab, X_unlab, threshold=0.9, max_iter=3)[source]
Parameters:
Return type:

SelfTrainingClassifier

xpectra.ssl.label_spread(X_lab, y_lab, X_unlab, n_neighbors=10, pca_components=50, random_state=42)[source]

LabelSpreading with a sparse kNN kernel on PCA-reduced features.

Returns the fitted spreader plus the scaler+PCA embedding used, so test data can be transformed into the same space for inductive prediction.

Parameters:
Return type:

tuple[LabelSpreading, Pipeline]

xpectra.ssl.ssl_loso_experiment(estimator, X_lab, y_lab, study, X_unlab, threshold=0.9, max_iter=3, n_neighbors=10, pca_components=50, random_state=42)[source]

Per LOSO fold: supervised-only vs self-training vs label-spreading, all evaluated on the held-out study.

Parameters:
Return type:

list[dict[str, Any]]