Machine Learning with Scikit-Learn and Tensorflow 6.3 预测类别概率
2017-03-30 22:55
549 查看
书籍信息
Hands-On Machine Learning with Scikit-Learn and Tensorflow
出版社: O’Reilly Media, Inc, USA
平装: 566页
语种: 英语
ISBN: 1491962291
条形码: 9781491962299
商品尺寸: 18 x 2.9 x 23.3 cm
ASIN: 1491962291
系列博文为书籍中文翻译
代码以及数据下载:https://github.com/ageron/handson-ml
此为6.1得到的决策树
决策树也能够估计实例归属特定类别的概率,基本思想是返回叶子结点中特定类别的比例。例如,如果petal length=5厘米,petal width=1.5厘米,那么实例对应的叶子结点是左下角的结点,类别的比例是
setosa:0%(0/54)
versicolor:90.7%(49/54)
virginica:9.3%(5/54)
类别的比例即是类别的概率。预测的类别是概率最高的类别,即versicolor。我们可以通过代码检验我们的结果。
Hands-On Machine Learning with Scikit-Learn and Tensorflow
出版社: O’Reilly Media, Inc, USA
平装: 566页
语种: 英语
ISBN: 1491962291
条形码: 9781491962299
商品尺寸: 18 x 2.9 x 23.3 cm
ASIN: 1491962291
系列博文为书籍中文翻译
代码以及数据下载:https://github.com/ageron/handson-ml
此为6.1得到的决策树
决策树也能够估计实例归属特定类别的概率,基本思想是返回叶子结点中特定类别的比例。例如,如果petal length=5厘米,petal width=1.5厘米,那么实例对应的叶子结点是左下角的结点,类别的比例是
setosa:0%(0/54)
versicolor:90.7%(49/54)
virginica:9.3%(5/54)
类别的比例即是类别的概率。预测的类别是概率最高的类别,即versicolor。我们可以通过代码检验我们的结果。
tree_clf.predict_proba([[5, 1.5]]) # output # array([[ 0. , 0.90740741, 0.09259259]]) tree_clf.predict([[5, 1.5]]) # output # array([1])
相关文章推荐
- Machine Learning with Scikit-Learn and Tensorflow 6.2 进行预测
- Machine Learning with Scikit-Learn and Tensorflow 7.11 练习
- Machine Learning with Scikit-Learn and Tensorflow 6.8 决策树回归
- Machine Learning with Scikit-Learn and Tensorflow 7.3 Out-of-Bag评价方式
- Machine Learning with Scikit-Learn and Tensorflow 7.2 Bagging和Pasting
- Machine Learning with Scikit-Learn and Tensorflow 7.4 Random Patches和Random Subspaces
- Machine Learning with Scikit-Learn and Tensorflow 7 集成学习和随机森林(章节目录)
- chapter2 of OReilly.Hands-On.Machine.Learning.with.Scikit-Learn.and.TensorFlow
- Machine Learning with Scikit-Learn and Tensorflow 6.6 基尼不纯度/熵
- Machine Learning with Scikit-Learn and Tensorflow 6.9 决策树局限性
- Machine Learning with Scikit-Learn and Tensorflow 6.10 练习
- 集成算法(chapter 7 - Hands on machine learning with scikit learn and tensorflow)
- OReilly.Hands-On.Machine.Learning.with.Scikit-Learn.and.TensorFlow.翻译以及读书心得--p41-53
- Machine Learning with Scikit-Learn and Tensorflow 7.8 AdaBoost
- Machine Learning with Scikit-Learn and Tensorflow 7.9 Gradient Boosting
- Machine Learning with Scikit-Learn and Tensorflow 6 决策树(章节目录)
- OReilly.Hands-On.Machine.Learning.with.Scikit-Learn.and.TensorFlow.翻译以及读书心得--p33-p40
- Machine Learning with Scikit-Learn and Tensorflow 7.5 随机森林
- Machine Learning with Scikit-Learn and Tensorflow 7.7 特征重要程度
- 《Hands-on Machine Learning with Scikit-Learn and TensorFlow》 读书笔记