def change_skin(self): """Set skins""" sender = self.sender() if sender: if (sender.text() in list(self.skins.keys())): self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style=self.skins[sender.text()])) else: self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark")) else: self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark"))
def change_skin(self): """Set skins""" sender = self.sender() if sender: if (sender.text() in list(self.skins.keys())): self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style=self.skins[sender.text()])) else: self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark")) else: self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark")) # Make the stackedWidg to default at the begining self.tabWidget_items.setCurrentIndex(0) self.stackedWidget_preprocessing_methods.setCurrentIndex(-1) self.stackedWidget_dimreduction.setCurrentIndex(-1) self.stackedWidget_feature_selection.setCurrentIndex(-1)
def __init__(self): print("Opening GUI...") self.root_dir = os.path.dirname(eslearn.__file__) QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.working_directory = None self.configuration_file = "" self.textBrowser.setText("Hi~, I'm easylearn. I hope I can help you finish this project successfully\n") # Display start progress self.start_process() # Set working_directory and debug if self.working_directory: cgitb.enable(format="text", display=1, logdir=os.path.join(self.working_directory, "log_data_loading.txt")) else: cgitb.enable(display=1, logdir=None) # Connecting to functions self.select_working_directory.triggered.connect(self.select_workingdir_fun) self.create_configuration_file.triggered.connect(self.initialize_configuration_fun) self.choose_configuration_file.triggered.connect(self.load_configuration_fun) self.data_loading.clicked.connect(self.data_loading_fun) self.feature_engineering.clicked.connect(self.feature_engineering_fun) self.machine_learning.clicked.connect(self.machine_learning_fun) self.model_evaluation.clicked.connect(self.model_evaluation_fun) self.run.clicked.connect(self.run_fun) self.quit.clicked.connect(self.closeEvent_button) # Skin self.skins = {"Dark": "style_Dark", "Black": "style_black", "DarkOrange": "style_DarkOrange", "Gray": "style_gray", "Blue": "style_blue", "Navy": "style_navy", "Classic": "style_Classic"} self.actionDark.triggered.connect(self.change_skin) self.actionBlack.triggered.connect(self.change_skin) self.actionDarkOrange.triggered.connect(self.change_skin) self.actionGray.triggered.connect(self.change_skin) self.actionBlue.triggered.connect(self.change_skin) self.actionNavy.triggered.connect(self.change_skin) self.actionClassic.triggered.connect(self.change_skin) # Set appearance self.set_run_appearance() # Set initial skin self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark")) # Dectecting versionn and news self.detect_version()
def __init__(self, working_directory=None): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.root_dir = os.path.dirname(eslearn.__file__) # Set working_directory and debug self.working_directory = working_directory self.configuration_file = "" if self.working_directory: cgitb.enable(format="text", display=1, logdir=os.path.join(self.working_directory, "log_data_loading")) else: cgitb.enable(display=1, logdir=None) # initiating self.data_loading = {} self.selected_group = None self.selected_modality = None self.selected_file = None self.loaded_targets_and_covariates = None self.loaded_mask = None self.loaded_files = None self.group_keys_exclude_modality = ["targets", "covariates"] # initialize list_view for groups, modalities and files self.slm_group = QStringListModel() self.slm_modality = QStringListModel() self.slm_file = QStringListModel() # connections self.actionChoose_configuration_file.triggered.connect( self.load_configuration) self.actionSave_configuration.triggered.connect( self.save_configuration) self.listView_groups.clicked.connect(self.identify_selected_group) self.pushButton_addgroups.clicked.connect(self.add_group) self.listView_groups.doubleClicked.connect(self.remove_selected_group) self.pushButton_removegroups.clicked.connect( self.remove_selected_group) self.pushButton_cleargroups.clicked.connect(self.clear_all_group) self.listView_modalities.clicked.connect( self.identify_selected_modality) self.pushButton_addmodalities.clicked.connect(self.add_modality) self.listView_modalities.doubleClicked.connect( self.remove_selected_modality) self.pushButton_removemodalites.clicked.connect( self.remove_selected_modality) self.pushButton_clearmodalities.clicked.connect( self.clear_all_modality) self.listView_files.clicked.connect(self.identify_selected_file) self.pushButton_addfiles.clicked.connect(self.add_files) self.listView_files.doubleClicked.connect(self.remove_selected_file) self.pushButton_removefiles.clicked.connect(self.remove_selected_file) self.pushButton_clearfiles.clicked.connect(self.clear_all_file) # mask_target_covariates self.target_covariate_mask_dict = { "Select mask": [self.lineEdit_mask, "mask"], "Clear mask": [self.lineEdit_mask, "mask"], "Select targets": [self.lineEdit_target, "targets"], "Clear targets": [self.lineEdit_target, "targets"], "Select covariates": [self.lineEdit_covariates, "covariates"], "Clear covariates": [self.lineEdit_covariates, "covariates"] } self.pushButton_selectMask.clicked.connect(self.input_mask) self.pushButton_selectTarget.clicked.connect( self.input_target_covariate) self.pushButton_selectCovariance.clicked.connect( self.input_target_covariate) self.pushButton_clearMask.clicked.connect( self.clear_mask_target_covariates) self.pushButton_clearTarget.clicked.connect( self.clear_mask_target_covariates) self.pushButton_clearCovriance.clicked.connect( self.clear_mask_target_covariates) self.pushButton_mask.clicked.connect(self.confirm_box_mask) self.pushButton_target.clicked.connect(self.confirm_box_target) self.pushButton_covariate.clicked.connect(self.confirm_box_covariates) # Skin self.skins = { "Dark": "style_Dark", "Black": "style_black", "DarkOrange": "style_DarkOrange", "Gray": "style_gray", "Blue": "style_blue", "Navy": "style_navy", "Classic": "style_Classic" } self.actionDark.triggered.connect(self.change_skin) self.actionBlack.triggered.connect(self.change_skin) self.actionDarkOrange.triggered.connect(self.change_skin) self.actionGray.triggered.connect(self.change_skin) self.actionBlue.triggered.connect(self.change_skin) self.actionNavy.triggered.connect(self.change_skin) self.actionClassic.triggered.connect(self.change_skin) # Set appearance self.set_run_appearance() # Set initial skin self.setStyleSheet( pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark"))
def __init__(self, working_directory=None): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.root_dir = os.path.dirname(eslearn.__file__) # Initialization self.machine_learning = {} self.working_directory = working_directory self.configuration_file = "" self.configuration = {} self.all_inputs_fun() # Debug # Set working_directory self.working_directory = working_directory if self.working_directory: cgitb.enable(format="text", display=1, logdir=os.path.join(self.working_directory, "log_machine_learning")) else: cgitb.enable(display=1, logdir=None) # Connect configuration functions self.actionLoad_configuration.triggered.connect( self.load_configuration) self.actionSave_configuration.triggered.connect( self.save_configuration) self.actionGet_all_available_configuration.triggered.connect( self._get_all_available_inputs) # Connect to radioButton of machine learning type: switche to corresponding machine learning type window self.machine_learning_type_stackedwedge_dict = { "Classification": 0, "Regression": 1, "Clustering": 2, "Deep learning": 3, } self.radioButton_classification.clicked.connect( self.switche_stacked_wedge_for_machine_learning_type) self.radioButton_regression.clicked.connect( self.switche_stacked_wedge_for_machine_learning_type) self.radioButton_clustering.clicked.connect( self.switche_stacked_wedge_for_machine_learning_type) self.radioButton_deeplearning.clicked.connect( self.switche_stacked_wedge_for_machine_learning_type) # Connect classification setting signal to slot: switche to corresponding classification model self.classification_stackedwedge_dict = { "LogisticRegression(solver='saga')": 0, "LinearSVC()": 1, "SVC()": 2, "RidgeClassifier()": 3, "GaussianProcessClassifier()": 4, "RandomForestClassifier()": 5, "AdaBoostClassifier()": 6 } self.radioButton_classification_lr.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_linearsvc.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_svm.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_ridge.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_gaussianprocess.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_randomforest.clicked.connect( self.switche_stacked_wedge_for_classification) self.radioButton_classification_adaboost.clicked.connect( self.switche_stacked_wedge_for_classification) # Connect regression setting signal to slot: switche to corresponding regression method self.regression_stackedwedge_dict = { "LinearRegression()": 0, "LassoCV()": 1, "RidgeCV()": 2, "ElasticNetCV()": 3, "SVR()": 4, "GaussianProcessRegressor()": 5, "RandomForestRegressor()": 6 } self.radioButton_regression_linearregression.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_lasso.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_ridge.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_elasticnet.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_svm.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_gaussianprocess.clicked.connect( self.switche_stacked_wedge_for_regression) self.radioButton_regression_randomforest.clicked.connect( self.switche_stacked_wedge_for_regression) # Connect clustering setting signal to slot: switche to corresponding clustering method self.clustering_stackedwedge_dict = { "KMeans()": 0, "SpectralClustering()": 1, "AgglomerativeClustering()": 2, "DBSCAN()": 3 } self.radioButton_clustering_kmeans.clicked.connect( self.switche_stacked_wedge_for_clustering) self.radioButton_spectral_clustering.clicked.connect( self.switche_stacked_wedge_for_clustering) self.radioButton_hierarchical_clustering.clicked.connect( self.switche_stacked_wedge_for_clustering) self.radioButton_DBSCAN.clicked.connect( self.switche_stacked_wedge_for_clustering) # Skin self.skins = { "Dark": "style_Dark", "Black": "style_black", "DarkOrange": "style_DarkOrange", "Gray": "style_gray", "Blue": "style_blue", "Navy": "style_navy", "Classic": "style_Classic" } self.actionDark.triggered.connect(self.change_skin) self.actionBlack.triggered.connect(self.change_skin) self.actionDarkOrange.triggered.connect(self.change_skin) self.actionGray.triggered.connect(self.change_skin) self.actionBlue.triggered.connect(self.change_skin) self.actionNavy.triggered.connect(self.change_skin) self.actionClassic.triggered.connect(self.change_skin) # Set appearance self.set_run_appearance() # Set initial skin self.setStyleSheet( pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark"))
def __init__(self, working_directory=None): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.root_dir = os.path.dirname(eslearn.__file__) # Initialization self.feature_engineering = {} self.working_directory = working_directory self.configuration_file = "" self.configuration = {} # self.all_available_inputs_fun() # Debug # Set working_directory if self.working_directory: cgitb.enable(format="text", display=1, logdir=os.path.join(self.working_directory, "log_feature_engineering")) else: cgitb.enable(display=1, logdir=None) # Connect configuration functions self.actionLoad_configuration.triggered.connect(self.load_configuration) self.actionSave_configuration.triggered.connect(self.save_configuration) self.actionGet_all_available_configuraton.triggered.connect(self._get_all_available_inputs) # connect preprocessing setting signal to slot: switche to corresponding stackedWidget self.preprocessing_stackedwedge_dict = {"StandardScaler()": 0, "MinMaxScaler()": 1, "None": 2} self.radioButton_zscore.clicked.connect(self.switche_stacked_wedge_for_preprocessing) self.radioButton_scaling.clicked.connect(self.switche_stacked_wedge_for_preprocessing) self.radioButton_none_methods.clicked.connect(self.switche_stacked_wedge_for_preprocessing) # connect dimreduction setting signal to slot: switche to corresponding stackedWidget self.dimreduction_stackedwedge_dict = {"PCA()": 0, "NMF()": 1, "None": 2} self.radioButton_pca.clicked.connect(self.switche_stacked_wedge_for_dimreduction) self.radioButton_nmf.clicked.connect(self.switche_stacked_wedge_for_dimreduction) self.radioButton_none.clicked.connect(self.switche_stacked_wedge_for_dimreduction) # connect feature selection setting signal to slot: switche to corresponding stackedWidget self.feature_selection_stackedwedge_dict = { "VarianceThreshold()": 0, "SelectPercentile(f_classif)": 1, "SelectPercentile(f_regression)": 2, "SelectPercentile(mutual_info_classif)": 3, "SelectPercentile(mutual_info_regression)": 4, "RFE()": 5, "SelectFromModel(LassoCV())": 6, "SelectFromModel(ElasticNetCV())": 7, "None": 8 } self.radioButton_variance_threshold.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_correlation.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_mutualinfo_cls.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_mutualinfo_regression.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_anova.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_rfe.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_l1.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_elasticnet.clicked.connect(self.switche_stacked_wedge_for_feature_selection) self.radioButton_featureselection_none.clicked.connect(self.switche_stacked_wedge_for_feature_selection) # Skin self.skins = {"Dark": "style_Dark", "Black": "style_black", "DarkOrange": "style_DarkOrange", "Gray": "style_gray", "Blue": "style_blue", "Navy": "style_navy", "Classic": "style_Classic"} self.actionDark.triggered.connect(self.change_skin) self.actionBlack.triggered.connect(self.change_skin) self.actionDarkOrange.triggered.connect(self.change_skin) self.actionGray.triggered.connect(self.change_skin) self.actionBlue.triggered.connect(self.change_skin) self.actionNavy.triggered.connect(self.change_skin) self.actionClassic.triggered.connect(self.change_skin) # Set appearance self.set_run_appearance() # Set initial skin self.setStyleSheet(pyqt5_loader.load_stylesheet_pyqt5(style="style_Dark"))