Skip to content

决策树分类,决策树深度,特征选择标准,叶子结点最小样本数,贝叶斯分类

Notifications You must be signed in to change notification settings

TLGits/Decision_tree

Repository files navigation

Decision_tree

决策树分类,决策树深度,特征选择标准,叶子结点最小样本数,贝叶斯分类 Decision_tree

文件: Decision_tree_Iris_data.py:手写决策树代码(Iris数据集)(实验一);

Decision_tree_contrast.py:对比实验(实验二);

Decision_tree_contrast.ipynb:对比实验(实验二)(推荐);

Decision_tree_contrast.html: 对比实验(实验二)(推荐);

Decision_tree_contrast.pdf:对比实验(实验二);

requirements.txt:安装依赖

所有程序均在Python3.6版本实现 运行程序前,需要安装对应的工具包:pip install -r requirements.txt

(PS: 为了更好地可视化决策树,需要安装graphviz。流程如下:

第一步是安装graphviz。下载地址在:http://www.graphviz.org/ 如果你是linux,可以用apt-get或者yum的方法安装。如果是windows,就在官网下载msi文件安装。无论是linux还是windows,装完后都要设置环境变量,将graphviz的bin目录加到PATH,比如我是windows,将C:/Program Files (x86)/Graphviz2.38/bin/加入了PATH

第二步是安装python插件graphviz: pip install graphviz

第三步是安装python插件pydotplus。这个没有什么好说的: pip install pydotplus)

参考:https://blog.csdn.net/t949500898/article/details/107399267

About

决策树分类,决策树深度,特征选择标准,叶子结点最小样本数,贝叶斯分类

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published