pls opt fix
This commit is contained in:
parent
b35f814ef0
commit
7fd4ac6225
|
@ -426,7 +426,7 @@ class LPLS(Model):
|
||||||
No ids matching
|
No ids matching
|
||||||
"""
|
"""
|
||||||
if name not in self.model.keys():
|
if name not in self.model.keys():
|
||||||
return
|
raise ValueError("There is no key named: %s in model" %name)
|
||||||
DX, DY, DZ = self._dataset['X'], self._dataset['Y'], self._dataset['Z']
|
DX, DY, DZ = self._dataset['X'], self._dataset['Y'], self._dataset['Z']
|
||||||
dim_name_0, dim_name_1 = DX.get_dim_name()
|
dim_name_0, dim_name_1 = DX.get_dim_name()
|
||||||
dim_name_2, dim_name_3 = DY.get_dim_name()
|
dim_name_2, dim_name_3 = DY.get_dim_name()
|
||||||
|
@ -455,11 +455,17 @@ class LPLS(Model):
|
||||||
'tsqx' : [ids_1, zero_dim],
|
'tsqx' : [ids_1, zero_dim],
|
||||||
'tsqz' : [ids_4, zero_dim],
|
'tsqz' : [ids_4, zero_dim],
|
||||||
'K' : [ids_1, pc_ids],
|
'K' : [ids_1, pc_ids],
|
||||||
'rmsep' : [ids_3, pc_ids]
|
'rmsep' : [ids_3, pc_ids],
|
||||||
|
'Rx' : [ids_1, pc_ids],
|
||||||
|
'Rz' : [ids_4, pc_ids]
|
||||||
}
|
}
|
||||||
|
|
||||||
array = self.model[name]
|
try:
|
||||||
M = Dataset(array, identifiers=match_ids[name], name=name)
|
array = self.model[name]
|
||||||
|
ids = match_ids[name]
|
||||||
|
except:
|
||||||
|
raise ValueError("There are no identifers stored for: %s in model" %name)
|
||||||
|
M = Dataset(array, identifiers=ids, name=name)
|
||||||
return M
|
return M
|
||||||
|
|
||||||
def get_out_plots(self, options):
|
def get_out_plots(self, options):
|
||||||
|
@ -645,7 +651,10 @@ class PlsOptions(Options):
|
||||||
'strict', 'crot', 'cov_center']
|
'strict', 'crot', 'cov_center']
|
||||||
return self._copy_from_list(opt_list)
|
return self._copy_from_list(opt_list)
|
||||||
|
|
||||||
|
def validation_options(self):
|
||||||
|
opt_list = ['amax', 'n_sets', 'cv_val_method']
|
||||||
|
return self._copy_from_list(opt_list)
|
||||||
|
|
||||||
def permutation_confidence(self):
|
def permutation_confidence(self):
|
||||||
opt_list = ['q_pert_method', 'q_iter']
|
opt_list = ['q_pert_method', 'q_iter']
|
||||||
return self._copy_from_list(opt_list)
|
return self._copy_from_list(opt_list)
|
||||||
|
@ -663,17 +672,17 @@ class LplsOptions(Options):
|
||||||
opt['engine'] = nipals_lpls
|
opt['engine'] = nipals_lpls
|
||||||
opt['mode'] = 'normal' # how much info to calculate
|
opt['mode'] = 'normal' # how much info to calculate
|
||||||
opt['amax'] = 10
|
opt['amax'] = 10
|
||||||
opt['aopt'] = 9
|
opt['aopt'] = 4
|
||||||
opt['xz_alpha'] = .5
|
opt['xz_alpha'] = .6
|
||||||
opt['auto_aopt'] = False
|
opt['auto_aopt'] = False
|
||||||
opt['center'] = True
|
opt['center'] = True
|
||||||
opt['center_mth'] = [2, 0, 1]
|
opt['center_mth'] = [2, 0, 1]
|
||||||
opt['scale'] = 'scores'
|
opt['scale'] = 'scores'
|
||||||
opt['calc_conf'] = True
|
opt['calc_conf'] = True
|
||||||
opt['n_sets'] = 20
|
opt['n_sets'] = 75
|
||||||
opt['strict'] = False
|
opt['strict'] = False
|
||||||
opt['p_center'] = 'med'
|
opt['p_center'] = 'med'
|
||||||
opt['alpha'] = .3
|
opt['alpha'] = .4
|
||||||
opt['cov_center'] = 'med'
|
opt['cov_center'] = 'med'
|
||||||
opt['crot'] = True
|
opt['crot'] = True
|
||||||
|
|
||||||
|
@ -695,11 +704,18 @@ class LplsOptions(Options):
|
||||||
(blmplots.LineViewXc, 'Line view', True),
|
(blmplots.LineViewXc, 'Line view', True),
|
||||||
(blmplots.PredictionErrorPlot, 'Residual Error', False),
|
(blmplots.PredictionErrorPlot, 'Residual Error', False),
|
||||||
(blmplots.RMSEPPlot, 'RMSEP', False),
|
(blmplots.RMSEPPlot, 'RMSEP', False),
|
||||||
(blmplots.LplsHypoidCorrelationPlot, 'Hypoid corr.', False)
|
(blmplots.LplsHypoidCorrelationPlot, 'Hypoid corr.', False),
|
||||||
|
(blmplots.LplsXCorrelationPlot, 'X corr.', True),
|
||||||
|
(blmplots.LplsZCorrelationPlot, 'Z corr.', True)
|
||||||
]
|
]
|
||||||
|
|
||||||
opt['out_data'] = ['T','P', 'tsqx']
|
opt['out_data'] = ['T','P', 'tsqx', 'tsqz', 'L','K']
|
||||||
opt['out_plots'] = [blmplots.PlsScorePlot,blmplots.LplsXLoadingPlot,blmplots.LplsZLoadingPlot, blmplots.LineViewXc]
|
opt['out_plots'] = [blmplots.PlsScorePlot,
|
||||||
|
blmplots.LplsXLoadingPlot,
|
||||||
|
blmplots.LplsZLoadingPlot,
|
||||||
|
blmplots.LplsXCorrelationPlot,
|
||||||
|
blmplots.LplsZCorrelationPlot,
|
||||||
|
blmplots.LineViewXc]
|
||||||
|
|
||||||
#opt['out_data'] = None
|
#opt['out_data'] = None
|
||||||
|
|
||||||
|
|
Reference in New Issue