diff --git a/sdb_gui.py b/sdb_gui.py index 4525beb..5451560 100644 --- a/sdb_gui.py +++ b/sdb_gui.py @@ -125,7 +125,8 @@ def __init__(self): global rf_op_list rf_op_list = [ 300, # n_estimators - 'mse' # criterion + 'mse', # criterion + True # bootstrap ] global svm_op_list @@ -692,6 +693,10 @@ def rfOptionWIndow(self): self.criterionCB = QComboBox() self.criterionCB.addItems(['mse', 'mae']) + bootstrapLabel = QLabel('Bootstrap:') + self.bootstrapCB = QComboBox() + self.bootstrapCB.addItems(['True', 'False']) + cancelButton = QPushButton('Cancel') cancelButton.clicked.connect(optionDialog.close) loadButton = QPushButton('Load') @@ -706,8 +711,11 @@ def rfOptionWIndow(self): grid.addWidget(criterionLabel, 2, 1, 1, 2) grid.addWidget(self.criterionCB, 2, 3, 1, 2) - grid.addWidget(loadButton, 3, 3, 1, 1) - grid.addWidget(cancelButton, 3, 4, 1, 1) + grid.addWidget(bootstrapLabel, 3, 1, 1, 2) + grid.addWidget(self.bootstrapCB, 3, 3, 1, 2) + + grid.addWidget(loadButton, 4, 3, 1, 1) + grid.addWidget(cancelButton, 4, 4, 1, 1) optionDialog.setLayout(grid) @@ -722,7 +730,8 @@ def loadRFOptionAction(self): global rf_op_list rf_op_list = [ self.ntreeSB.value(), - self.criterionCB.currentText() + self.criterionCB.currentText(), + self.str2bool(self.bootstrapCB.currentText()) ] @@ -1443,6 +1452,7 @@ def rfPredict(self): regressor = RandomForestRegressor( n_estimators=rf_op_list[0], criterion=rf_op_list[1], + bootstrap=rf_op_list[2], random_state=proc_op_list[2]) parameters.append(regressor) @@ -1450,7 +1460,8 @@ def rfPredict(self): global print_parameters_info print_parameters_info = ( 'N Trees:\t\t' + str(rf_op_list[0]) + '\n' + - 'Criterion:\t\t' + str(rf_op_list[1]) + 'Criterion:\t\t' + str(rf_op_list[1]) + '\n' + + 'Bootstrap:\t\t' + str(rf_op_list[2]) ) return parameters