= 'test'
src_dir = ['spectra-features-smp.npy', 'spectra-wavenumbers-smp.npy',
fnames 'depth-order-smp.npy', 'target-smp.npy',
'tax-order-lu-smp.pkl', 'spectra-id-smp.npy']
= load_kssl(src_dir, fnames=fnames) X, X_names, depth_order, y, tax_lookup, X_id
Training & validation (PLSR)
Various utilities function to train and evaluate the Partial Least Squares Regression baseline model
Train & evaluate
Learner
Learner (data, model)
Initialize self. See help(type(self)) for accurate signature.
PLS_model
PLS_model (X_names, pipeline_kwargs={})
Partial Least Squares model runner
Learners
Learners (tax_lookup, seeds=range(0, 20), split_ratio=0.1)
Initialize self. See help(type(self)) for accurate signature.
Example of use
= Path('test/dumps-test/plsr/train_eval/all/models')
dest_dir_model = range(2)
seeds = Learners(tax_lookup, seeds=seeds)
learners -1]),
learners.train((X, y, depth_order[:, =range(40, 70, 2),
n_cpts_range=2e-3,
delta=dest_dir_model) dest_dir_model
--------------------------------------------------------------------------------
Seed: 0
--------------------------------------------------------------------------------
# of components chosen: 44
--------------------------------------------------------------------------------
Seed: 1
--------------------------------------------------------------------------------
# of components chosen: 48