def __init__(self, result=global_var.ResultRegression()):
     super(LinearOut, self).__init__()
     self.model = result.model
     data_test = result.data_test
     y_test = data_test.iloc[:, -1].values
     data_predict = result.data_predict
     y_predict = data_predict.iloc[:, -1].values
     mse = np.sum((y_predict - y_test) ** 2) / len(y_test)
     rmse = sqrt(mse)
     self.label_intercept = QLabel("intercept: ")
     intercept = result.intercept
     self.intercept = QLabel(str(intercept))
     self.label_coef = QLabel("coef: ")
     coef = result.coef
     self.coef = QLabel(str(coef))
     layout_1 = QHBoxLayout()
     layout_1.addWidget(self.label_intercept)
     layout_1.addWidget(self.intercept)
     layout_1.addWidget(self.label_coef)
     layout_1.addWidget(self.coef)
     self.label_MSE = QLabel("MSE: ")
     self.MSE_txt = QLabel(str(mse))
     self.label_RMSE = QLabel("RMSE: ")
     self.RMSE_txt = QLabel(str(rmse))
     layout_2 = QHBoxLayout()
     layout_2.addWidget(self.label_MSE)
     layout_2.addWidget(self.MSE_txt)
     layout_2.addWidget(self.label_RMSE)
     layout_2.addWidget(self.RMSE_txt)
     self.label_test = QLabel("测试集:")
     self.label_predict = QLabel("预测值:")
     self.table_test = DataTable(data_test)
     self.table_predict = DataTable(data_predict)
     layout_test = QVBoxLayout()
     layout_test.addWidget(self.label_test)
     layout_test.addWidget(self.table_test)
     layout_test.setStretch(0, 1)
     layout_test.setStretch(1, 5)
     layout_predict = QVBoxLayout()
     layout_predict.addWidget(self.label_predict)
     layout_predict.addWidget(self.table_predict)
     layout_predict.setStretch(0, 1)
     layout_predict.setStretch(1, 5)
     layout_3 = QHBoxLayout()
     layout_3.addLayout(layout_test)
     layout_3.addLayout(layout_predict)
     layout = QVBoxLayout()
     layout.addLayout(layout_1)
     layout.addLayout(layout_2)
     layout.addLayout(layout_3)
     self.setLayout(layout)
示例#2
0
 def __init__(self, result=global_var.ResultCluster()):
     super(ClusterOut, self).__init__()
     data = result.data
     self.table = DataTable(data)
     layout = QVBoxLayout()
     layout.addWidget(self.table)
     self.setLayout(layout)
示例#3
0
 def __init__(self, result=global_var.ResultClassify()):
     super(DTC_Out, self).__init__()
     data_test = result.data_test
     data_pre = result.data_predict
     data_test["predict"] = data_pre.iloc[:, -1]
     self.table = DataTable(data_test)
     layout = QVBoxLayout()
     layout.addWidget(self.table)
     self.setLayout(layout)
示例#4
0
文件: dataTail.py 项目: Xdmony/DMS
 def __init__(self, dataSet):
     super(DataTail, self).__init__()
     self.data = dataSet
     self.table = DataTable(dataSet.data)
     self.btn_add_data = QPushButton("添加到任务")
     self.btn_add_data.clicked.connect(self.add_data_to_task)
     self.features = dataSet.dataColumns
     layout_feature = QVBoxLayout()
     layout_feature.setSpacing(5)
     self.all_check = QCheckBox("全选")
     self.all_check.setChecked(True)
     self.all_check.stateChanged.connect(self.all_checked)
     layout_feature.addWidget(self.all_check)
     for feature in self.features:
         checkbox = QCheckBox(feature)
         checkbox.setObjectName(feature)
         checkbox.setChecked(True)
         layout_feature.addWidget(checkbox)
     layout_target = QHBoxLayout()
     target_label = QLabel("Target: ")
     self.target_combo = QComboBox()
     comboList = list()
     comboList.append("")
     comboList = comboList + self.features
     self.target_combo.addItems(comboList)
     layout_target.addWidget(target_label)
     layout_target.addWidget(self.target_combo)
     layout_feature.addLayout(layout_target)
     layout_feature.addWidget(self.btn_add_data)
     # layout_operate = QVBoxLayout()
     # layout_operate.addLayout(layout_feature)
     # layout_operate.addWidget(self.btn_add_data)
     # layout_operate.setStretch(0, 8)
     # layout_operate.setStretch(1, 1)
     layout = QHBoxLayout()
     layout.addWidget(self.table)
     layout.addLayout(layout_feature)
     layout.setStretch(0, 5)
     layout.setStretch(1, 1)
     self.setLayout(layout)
示例#5
0
 def __init__(self, result=global_var.ResultAssociation()):
     super(AprioriAssociationOut, self).__init__()
     self.table = DataTable(result.rule)
     layout = QVBoxLayout()
     layout.addWidget(self.table)
     self.setLayout(layout)