机器学习 决策树算法_机器学习中的决策树算法

机器学习 决策树算法

A decision tree is a non-parametric supervised machine learning algorithm. It is extremely useful in classifying or labels the object. It works for both categorical and continuous datasets. It is like a tree structure in which the root node and its child node should be present. It has a child node that denotes a feature of the dataset. Prediction can be made with a leaf or terminal node.

决策树是一种非参数有监督的机器学习算法。 在对对象进行分类或标记时非常有用。 它适用于分类数据集和连续数据集。 它就像一个树结构,其中应存在根节点及其子节点。 它有一个子节点,表示数据集的特征。 可以使用叶节点或终端节点进行预测。

递归贪婪算法 (Recursive Greedy Algorithm)

  • A recursive greedy algorithm is a very simple, intuitive algorithm that is used in the optimization problems.

    递归贪婪算法是一种非常简单,直观的算法,用于优化问题。
  • What a recursive greedy algorithm does that at every step you have a choice. Instead of evaluating all choices recursively and picking the best one choice, go with that, Recurse and do the same thing. So basically a recursive greedy algorithm picks the locally optimal choice hoping to get the best globally optimal solution.

    在每个步骤中,您都有选择什么递归贪婪算法的。 与其递归地评估所有选择并选择最佳选择,不如选择递归进行相同的事情。 因此,基本上,递归贪婪算法会选择局部最优选择,以期获得最佳的全局最优解。
  • Greedy algorithms are very powerful in some problems, such as Huffman encoding, or Dijkstra’s algorithm, which is used in data structure and algorithms. We will be using this algorithm for the formation of the tree.

    贪婪算法在某些问题上非常强大,例如霍夫曼编码或用于数据结构和算法的Dijkstra算法。 我们将使用此算法来形成树。
  • Step for learning the decision tree:

    学习决策树的步骤:
  • step 1: Start with an empty tree

    步骤1:从一棵空树开始
  • step 2: Select a feature to split the data

    步骤2:选择一项功能以分割数据
  • For each split of the tree :

    对于树的每个拆分:
  • step 3: If nothing to do more, predict with the last leaf node or terminal node

    步骤3:如果无事可做,请预测最后一个叶节点或终端节点
  • step 4: Otherwise, go to step 2 & continue (recurse) to split

    步骤4:否则,请转到步骤2并继续(递归)进行拆分
Image for post
decision tree example
决策树示例

For example — let’s say, start with an empty tree and I pick a feature to split on. In our case, we split on credit. So we decided to say, take my data and split on which data points have excellent credit, which ones have fair credit and which ones have poor credit, and then for each subset of data, excellent, fair, poor, I

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值