Comments (12)
缺少了 majorityCnt 方法的实现
from ailearning.
缺少了 majorityCnt 方法的实现
在底下的源码链接有。
from ailearning.
决策树源码 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.
小哥哥,能不能提交一下PR? 这个代码完全是按照作者写得来优化的。
我没太懂你们讨论的点在哪里?
from ailearning.
决策树源码 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.
为什么网页打不开
from ailearning.
小哥哥,你再试试
https://ailearning.apachecn.org/#/docs/ml/3.决策树
from ailearning.
firstStr=inputTree.keys()[0] 这句话报错,TypeError: 'dict_keys' object is not subscriptable
from ailearning.
firstStr=inputTree.keys()[0] 这句话报错,TypeError: 'dict_keys' object is not subscriptable
这个解决了吗
from ailearning.
这个主要是 3.x 升级了API,试试:
firstStr=list(inputTree.keys())[0]
如果方便的话,你们测试完,也可以提交一下最新代码!
from ailearning.
github还不太会用,不知道怎么提交,经过测试,以下两处需要修改,其他类似地方也据此修改即可。
1、 firstStr = list(inputTree.keys())
2、secondDict = inputTree.get(firstStr[0])
from ailearning.
你改复杂呢,差不多的意思
# 获取tree的根节点对于的key值
firstStr = list(inputTree.keys())[0]
# 通过key得到根节点对应的value
secondDict = inputTree[firstStr]
from ailearning.
Related Issues (20)
- bayes 问题 咨询 HOT 2
- AiLearning
- TODO
- 关于在 Numpy简介 一节中使用 ploat(a,b)报错的问题。 HOT 1
- Ai lean
- 添加 上一页/下一页 按钮 HOT 2
- 1
- 关于“片刻” B站录制 “自然语言处理”的文档内容,下载地址问题!
- M
- 此项目已正式封版
- it is excellent project,thanks to all guys. HOT 8
- 在线阅读(Gitee)打不開 HOT 8
- 朴素贝叶斯实战例子疑惑 HOT 3
- 数据分析文档描述错误 HOT 4
- 数据集 HOT 2
- 催更
- cartpoleenv.step HOT 1
- 第11章_Apriori算法 HOT 2
- 第四章(朴素贝叶斯)中 rss 订阅失效 HOT 2
- 提问一定要先看一下!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ailearning.