Code Monkey home page Code Monkey logo

Comments (12)

shenlixin avatar shenlixin commented on May 18, 2024

缺少了 majorityCnt 方法的实现

from ailearning.

woaiios avatar woaiios commented on May 18, 2024

缺少了 majorityCnt 方法的实现

在底下的源码链接有。

from ailearning.

mengrennwpu avatar mengrennwpu commented on May 18, 2024

决策树源码 DecisionTree中计算香农熵的第二种实现方法中的计算概率应该是:
probs = [p[1] * 1.0 / len(dataSet) for p in label_count.items()],而非probs = [p[1] / len(dataSet) for p in label_count.items()]

from ailearning.

jiangzhonglian avatar jiangzhonglian commented on May 18, 2024

小哥哥,能不能提交一下PR? 这个代码完全是按照作者写得来优化的。
我没太懂你们讨论的点在哪里?

from ailearning.

x931890193 avatar x931890193 commented on May 18, 2024

决策树源码 DecisionTree中计算香农熵的第二种实现方法中的计算概率应该是:
probs = [p[1] * 1.0 / len(dataSet) for p in label_count.items()],而非probs = [p[1] / len(dataSet) for p in label_count.items()]

小哥哥 这两区别大吗?变小数?

from ailearning.

GodBearC avatar GodBearC commented on May 18, 2024

为什么网页打不开

from ailearning.

jiangzhonglian avatar jiangzhonglian commented on May 18, 2024

小哥哥,你再试试
https://ailearning.apachecn.org/#/docs/ml/3.决策树

from ailearning.

xLuge avatar xLuge commented on May 18, 2024

firstStr=inputTree.keys()[0] 这句话报错,TypeError: 'dict_keys' object is not subscriptable

from ailearning.

cool-face avatar cool-face commented on May 18, 2024

firstStr=inputTree.keys()[0] 这句话报错,TypeError: 'dict_keys' object is not subscriptable
这个解决了吗

from ailearning.

jiangzhonglian avatar jiangzhonglian commented on May 18, 2024

这个主要是 3.x 升级了API,试试:

firstStr=list(inputTree.keys())[0]

如果方便的话,你们测试完,也可以提交一下最新代码!

from ailearning.

cool-face avatar cool-face commented on May 18, 2024

github还不太会用,不知道怎么提交,经过测试,以下两处需要修改,其他类似地方也据此修改即可。
1、 firstStr = list(inputTree.keys())
2、secondDict = inputTree.get(firstStr[0])

from ailearning.

jiangzhonglian avatar jiangzhonglian commented on May 18, 2024

你改复杂呢,差不多的意思

# 获取tree的根节点对于的key值
firstStr = list(inputTree.keys())[0]
# 通过key得到根节点对应的value
secondDict = inputTree[firstStr]

from ailearning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.