MCPcopy Create free account

hub / github.com/Erikfather/Decision_tree-python / functions

Functions23 in github.com/Erikfather/Decision_tree-python

↓ 16 callersFunctionsplitdataset
(dataset, axis, value)
tree.py:70
↓ 12 callersFunctioncal_acc
:param test_output: the output of testset :param label: the answer :return: the acc of
tree.py:417
↓ 6 callersFunctionclassifytest
输入:决策树,分类标签,测试数据集 输出:决策结果 描述:跑决策树
tree.py:405
↓ 6 callersFunctionread_testset
年龄段:0代表青年,1代表中年,2代表老年; 有工作:0代表否,1代表是; 有自己的房子:0代表否,1代表是; 信贷情况:0代表一般,1代表好,2代表非常好; 类别(是否给贷款):0代表否,1代表是
tree.py:35
↓ 5 callersFunctioncal_entropy
(dataset)
tree.py:53
↓ 5 callersFunctiongetNumLeafs
(myTree)
treePlotter.py:14
↓ 5 callersFunctiongetTreeDepth
(myTree)
treePlotter.py:25
↓ 4 callersFunctionplotTree
(myTree, parentPt, nodeTxt)
treePlotter.py:43
↓ 3 callersFunctionmajorityCnt
数据集已经处理了所有属性,但是类标签依然不是唯一的, 此时我们需要决定如何定义该叶子节点,在这种情况下,我们通常会采用多数表决的方法决定该叶子节点的分类
tree.py:159
↓ 2 callersFunctionC45_chooseBestFeatureToSplit
(dataset)
tree.py:112
↓ 2 callersFunctionCART_chooseBestFeatureToSplit
(dataset)
tree.py:139
↓ 2 callersFunctionID3_chooseBestFeatureToSplit
(dataset)
tree.py:88
↓ 2 callersFunctionplotMidText
(cntrPt, parentPt, txtString)
treePlotter.py:38
↓ 2 callersFunctionplotNode
(nodeTxt, centerPt, parentPt, nodeType)
treePlotter.py:9
↓ 1 callersFunctionC45_createTree
(dataset, labels, test_dataset)
tree.py:245
↓ 1 callersFunctionCART_createTree
(dataset, labels, test_dataset)
tree.py:315
↓ 1 callersFunctionID3_createTree
(dataset, labels, test_dataset)
tree.py:174
↓ 1 callersFunctionclassify
输入:决策树,分类标签,测试数据 输出:决策结果 描述:跑决策树
tree.py:386
↓ 1 callersFunctionread_dataset
年龄段:0代表青年,1代表中年,2代表老年; 有工作:0代表否,1代表是; 有自己的房子:0代表否,1代表是; 信贷情况:0代表一般,1代表好,2代表非常好; 类别(是否给贷款):0代表否,1代表是
tree.py:13
FunctionC45_Tree
(inTree)
treePlotter.py:87
FunctionCART_Tree
(inTree)
treePlotter.py:101
FunctionID3_Tree
(inTree)
treePlotter.py:73
FunctioncreatePlot
(inTree)
treePlotter.py:61