摘要: 代码: print(classification_report(y_test, pca_y_predict, target_names=np.arange[10].astype(str))) 原因: 将np.arange(10)写成了np.arange[10] 阅读全文
posted @ 2020-09-08 16:51 君君姐 阅读(2275) 评论(0) 推荐(0) 编辑
摘要: 代码: px = X_pca[:, 0][y_train.as_matrix() == i] # python3.X报错 原因: python3.X中as_matrix()不可用 修改: px = X_pca[:, 0][y_train.values == i] 阅读全文
posted @ 2020-09-08 16:27 君君姐 阅读(1363) 评论(0) 推荐(0) 编辑
摘要: 代码: for i in xrange(len(colors)): # python3.X 报错 pass 原因: python3.X,range()与xrange()合并为range() 阅读全文
posted @ 2020-09-08 16:22 君君姐 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 代码: print np.sort(zip(etr.feature_importances_, boston.feature_names), axis=0) # Python2.X 不报错 print(np.sort(zip(etr.feature_importances_, boston.feat 阅读全文
posted @ 2020-09-08 14:40 君君姐 阅读(3055) 评论(0) 推荐(0) 编辑