def initMenus(self): """ Initialise top bar menu items by importing from configuration file. """ menu_items = eval(file_io.load_config(MENU_FILE)) menubar = self.menuBar() for menu in menu_items: newMenu = menubar.addMenu(menu[0]) for action in menu[1]: if action["name"] == "sep": newMenu.addSeparator() continue newAction = QtGui.QAction(action["name"], self) newAction.setShortcut(action["shortcut"]) newAction.setStatusTip(action["tip"]) newAction.triggered.connect(action["cb"]) newMenu.addAction(newAction)
import sys from datetime import datetime from sklearn.model_selection import RandomizedSearchCV import file_io as io import report as rp import util as ut # Display progress logs on stdout log.basicConfig(level=log.INFO, format='%(asctime)s %(levelname)s %(message)s') if __name__ == '__main__': """Does hp search and stores the parameters for each dataset and classifier.""" config = io.load_config(sys.argv, None) experiment_dir = "{}_hpsearch".format(config['experiment']) if not os.path.exists(experiment_dir): os.makedirs(experiment_dir) for dataset_i, dataset_filename in enumerate(config['datasets']): log.debug("DATASET_{}: {}".format(dataset_i, dataset_filename)) # load preprocessed dataset X, y, arff_data = io.load_data(dataset_filename, config) dataset_name = os.path.splitext(dataset_filename)[0] log.info("DATASET_{}_NAME: {}".format(dataset_i, dataset_name)) for estimator_i, estimator in enumerate(config['estimators']): log.debug("ESTIMATOR_{}: {}".format(estimator_i,
import file_io import arm import simulator import sequencer import controls import sys from PyQt4 import QtGui, QtCore, QtOpenGL MENU_FILE = 'menus.conf' CONFIG_FILE = 'config.conf' CONFIG = eval(file_io.load_config(CONFIG_FILE)) class MainWindow(QtGui.QMainWindow): """ Main top level class, contains instances of all other main classes""" def __init__(self): """ Initialise all main classes. """ super(MainWindow, self).__init__() self.file_manager = file_io.FileManager(self, CONFIG["def_arm"], CONFIG["def_arms_directory"]) self.arm = arm.Arm(self) self.arm_data = None self.sim_widget = simulator.SimWidget(self, self.arm, CONFIG["cam_config"]) self.controls_area = controls.ControlsArea(self)
Available estimators: * RandomForestClassifier * ExtraTreesClassifier * DecisionTreeClassifier * AdaBoostClassifier * GaussianNB * KNeighborsClassifier * SVC * GaussianProcessClassifier * MLPClassifier * Perceptron * ... TODO add more estimators """ config = io.load_config(sys.argv, default_config) experiment_dir = config['experiment'] if not os.path.exists(experiment_dir): os.makedirs(experiment_dir) times_columns = [ 'dataset_name', 'estimator_name', 'train_size', 'repetition', 'split', 'fit_time', 'score_time' ] times = pd.DataFrame(columns=times_columns) scores_columns = [ 'dataset_name', 'estimator_name', 'train_size', 'repetition', 'split', 'accuracy', 'f1_macro', 'precision_macro', 'recall_macro' ] scores = pd.DataFrame(columns=scores_columns)