def function(self):
p_attrib = {'False': False, 'True': True, 'Array-like': 'array-like'}
r_attrib = {'None': None}
# TODO Add back the random state later.
# try:
# r_state = int(self.randomStateLineEdit.text())
# except:
# r_state = r_attrib[self.randomStateLineEdit.text()]
index = self.precomputeComboBox.currentIndex()
precomputeComboBox = self.precomputeComboBox.itemText(index)
if self.CVCheckBox.isChecked():
params = {
'l1_ratio': self.l1_ratioDoubleSpinBox.value(),
'eps': self.epsDoubleSpinBox.value(),
'n_alphas': self.n_alphasSpinBox.value(),
'alphas': {'None': None}.get(self.alphasLineEdit.text()),
'fit_intercept': self.fit_interceptCheckBox.isChecked(),
'normalize': self.normalizeCheckBox.isChecked(),
'precompute': self.precomputeComboBox.currentText(),
'max_iter': self.max_iterSpinBox.value(),
'tol': self.max_iterSpinBox.value(),
'cv': self.cVSpinBox.value(),
'copy_X': self.copy_XCheckBox.isChecked(),
'verbose': self.verboseCheckBox.isChecked(),
'n_jobs': self.n_jobsSpinBox.value(),
'positive': self.positiveCheckBox.isChecked(),
'selection': self.selectionComboBox.currentText(),
'CV': self.CVCheckBox.isChecked()}
return params, self.getChangedValues(params, ElasticNetCV())
else:
params = {
'alpha': self.alpha_text.value(),
'l1_ratio': self.enl1_ratioDoubleSpinBox.value(),
'fit_intercept': self.enfit_interceptCheckBox.isChecked(),
'normalize': self.ennormalizeCheckBox.isChecked(),
'precompute': self.enprecomputeCheckBox.isChecked(),
'max_iter': self.enmax_iterSpinBox.value(),
'copy_X': self.encopy_XCheckBox.isChecked(),
'tol': self.entolDoubleSpinBox.value(),
'warm_start': self.enwarm_startCheckBox.isChecked(),
'positive': self.enpositiveCheckBox.isChecked(),
'selection': self.selectionComboBox.currentText(),
'CV': self.CVCheckBox.isChecked()}
return params, self.getChangedValues(params, ElasticNet())
ElasticNet.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录