def show_pearson_correlation(self):
if self.dataset_loaded:
self.feature_inspection_fig.hide()
self.correlation_table.show()
correlation_matrix=pearson_correlation_matrix(self.X)
#initialize rows, columns and headers
self.correlation_table.setRowCount(0)
self.correlation_table.setColumnCount(0)
for i in xrange(len(self.X[0])):
self.correlation_table.insertRow(i)
self.correlation_table.insertColumn(i)
self.correlation_table.setHorizontalHeaderItem(i,QtWidgets.QTableWidgetItem(self.features[i]))
self.correlation_table.setVerticalHeaderItem(i,QtWidgets.QTableWidgetItem(self.features[i]))
#fill table data
for i in xrange(len(self.X[0])):
for j in xrange(len(self.X[0])):
self.correlation_table.setItem(i,j,QtWidgets.QTableWidgetItem(str(correlation_matrix[i][j])))
else:
QtWidgets.QMessageBox.information(self, "Data Not Found","Please load a dataset first.")
#Apply data tranformation
default_predictor.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录