摘要: 1、依赖于matplotlib, sklearn.tree.plot_tree 2、第一步先把生成的分类树模型传入plot_tree(tree_model)中 3、第二步调用matplotlib的pyplot.show()显示图形 4、plot_tree()参数列表 def plot_tree(de 阅读全文
posted @ 2021-10-07 17:21 耿集 阅读(368) 评论(0) 推荐(0)
摘要: 1、离散化:将无限空间中的有限数据映射到有限空间中去,提高算法的效率,简单来说就是将许多很大的值缩小成较小的值,方便计算 例如有这一组数据:[1111, 2222, 3333, 4444, 5555, 20, 99, 36] 离散化之后的结果为:[4, 5, 6, 7, 8, 1, 3, 2] 就是 阅读全文
posted @ 2021-10-07 15:56 耿集 阅读(122) 评论(0) 推荐(0)
摘要: 1、分类模型评估指标 一、sklearn.metrics提供分类算法模型的评估指标 # 实例数据 iris = load_iris() # 分割测试集和训练集 x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.ta 阅读全文
posted @ 2021-10-07 10:39 耿集 阅读(852) 评论(0) 推荐(0)