def handle_norm_mean_action(self): if len(self.dataset_data.index) == 0: information_dialod(NO_DATASET_MESSAGE) else: norm_data = Norm(self.dataset_data) norm_data.mean_normilization() self.dataset_data = norm_data.get_normilized_data() information_dialod(NORMILIZED_BY_MESSAGE.format("mean method"))
def handle_norm_by_mean_action(self): if len(self.dataset_data.index) == 0: information_dialod(NO_DATASET_MESSAGE) else: norm_data = Norm(self.dataset_data) norm_data.normilize_by_mean_value() self.dataset_data = norm_data.get_normilized_data() information_dialod(NORMILIZED_BY_MESSAGE.format("by mean value"))
def show_pandas_table(self): if len(self.dataset_data.index) == 0: information_dialod(NO_DATASET_MESSAGE) else: pd_table = QTableView() model = PandasModel(self.dataset_data) pd_table.setModel(model) self.central_widget.addWidget(pd_table) self.central_widget.setCurrentWidget(pd_table)
def handle_lda_plot_action(self): if len(self.dataset_data.index) == 0: information_dialod(NO_DATASET_MESSAGE) else: self.plot_window = PlotWindow() self.plot_window.draw_lda(self.dataset_data) self.dataset_data = self.bak_data cur_widget = self.central_widget.currentWidget() if cur_widget != self.content_table: self.central_widget.removeWidget(cur_widget) self.central_widget.addWidget(self.plot_window) self.central_widget.setCurrentWidget(self.plot_window)
def handle_open_dataset_action(self): filename = import_dataset_action() column_file = os.path.dirname(filename) + "/column_names.txt" print(column_file) self.set_dataset_file(filename) if not file_is_exists(column_file): information_dialod(NOT_SUCCESS_IMPORT_MESSAGE) else: self.dataset_cols = ColumnImporter(column_file).get_columns() dataset_importer = DatasetImporter(self.dataset_file, self.dataset_cols) self.dataset_data = dataset_importer.get_dataset() self.bak_data = self.dataset_data if info_import_dataset_dialog(SUCCESS_IMPORT_MESSAGE): self.show_pandas_table()
def download_dataset(self): if internet_on() == True: index = self.currentRow() folder_url = self.uci.uci_folder_urls[index] dataset_name = self.uci.uci_dataset_name[index] if information_download_dialod( BEFORE_DOWNLOAD_MESSAGE.format( dataset_name)) == QMessageBox.Ok: url = os.path.join(BASE_UCI_URL_PART, folder_url) dataset_folder = os.path.join(ROOT_PROJECT_PATH, 'datasets', dataset_name) download_data(url, dataset_folder) information_dialod(DOWNLOAD_MESSAGE.format(dataset_name)) else: information_dialod(NO_CONN_MESSAGE)
def handle_attr_choose_action(self): if len(self.dataset_data.index) == 0: information_dialod(NO_DATASET_MESSAGE) else: cols = Chooser(self.dataset_cols[1:], self).get_data() self.dataset_data = self.dataset_data[cols]