Source code for gui.core.regressionMethods.OMP

from PyQt5 import QtWidgets
from sklearn.linear_model import OrthogonalMatchingPursuit
from sklearn.linear_model import OrthogonalMatchingPursuitCV

from gui.ui.OMP import Ui_Form
from gui.util.Modules import Modules


[docs] class Ui_Form( Ui_Form, OrthogonalMatchingPursuit, OrthogonalMatchingPursuitCV, Modules ):
[docs] def setupUi(self, Form): super().setupUi(Form) self.checkMinAndMax() self.connectWidgets()
[docs] def get_widget(self): return self.formGroupBox
[docs] def setHidden(self, bool): self.get_widget().setHidden(bool)
[docs] def connectWidgets(self): self.fitInterceptCheckBox.setChecked(self.fit_intercept)
[docs] def run(self): params = { 'n_nonzero_coefs': self.n_coef_spin.value(), 'fit_intercept': self.fitInterceptCheckBox.isChecked(), 'precompute': True } return params, self.getChangedValues( params, OrthogonalMatchingPursuit() )
if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Form = QtWidgets.QWidget() ui = Ui_Form() ui.setupUi(Form) Form.show() sys.exit(app.exec_())