AI 与机器学习explained.ai
如何可视化决策树
How to visualize decision trees
2018 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 explained.ai 上关于如何可视化决策树的教程,重点讲分类树和回归树的图形呈现、不同方向和布局,以及怎样让树图更易读。作者还介绍了为 scikit-learn 决策树可视化和模型解释而做的 animl 包。
为什么经久不衰:决策树是随机森林和梯度提升等常用模型的基础,好的可视化能直观揭示模型结构并帮助发现过拟合等问题,因此多年后仍是学习与解释树模型的好材料。
HN 评论精选
作者说明做 animl 的动机:现有树可视化对新手不够友好。
决策树是梯度提升机和随机森林的基础构件,很可能是结构化数据上最常用的两类机器学习模型。可视化决策树对学习这些模型如何工作、以及解释模型都有巨大帮助。但现有的可视化包还很初级,对新手不够友好,所以我们做了 animl,用于 scikit-learn 决策树可视化和模型解释。
parrt查看英文原文
Decision trees are the fundamental building block of gradient boosting machines and Random Forests™, probably the two most popular machine learning models for structured data. Visualizing decision trees is a tremendous aid when learning how these models work and when interpreting models. Unfortunately, current visualization packages are rudimentary and not immediately helpful to the novice. So, we've created a general package called animl for scikit-learn decision tree visualization and model interpretation.
大规模树可视化需要交互、剪枝和布局技巧,且能快速暴露过拟合迹象。
很高兴看到也有人研究树模型可视化。我做过更大规模的树可视化,发现很快就没有空间了。我最终用交互来展开分支层级信息,根据训练支持度动态剪枝,并用更复杂的布局技术塞进更多信息。这样可视化树有助于快速发现问题:过拟合通常表现为过度使用某个字段,或长出又长又窄的分支。
jdonaldson查看英文原文
Good to see others looking into tree model viz. I've done work with larger scale tree visualizations and found you quickly run out of space. I wound up using interactivity to reveal branch level info, dynamically pruned the tree based on train support, and I used a more sophisticated layout technique to pack more info in. https://www.google.com/amp/s/blog.bigml.com/2012/01/23/beautiful-decisions-inside-bigmls-decision-trees/amp/ FWIW visualizing trees like that helps spot problems really quickly. Overfitting behavior typically involves overusing a certain field, or growing long and relatively narrow branches.
称赞分类/回归树的可视化,并追问树集成模型的可解释性可视化。
做得很好。很高兴看到分类和回归都被认真处理,设计上也很注意易理解性。现在的问题是:能否在此基础上(或做类似的事情)来处理树集成?随机森林、梯度提升树等常用于提升预测精度,但可解释性往往差很多。
jononor查看英文原文
Very nice work. Glad to see both classification and regression treated very well, with careful attention to design to make something that is easy to understand. Now the question is - can we build on this (or do something analogous) for tree ensembles? Random Forests, Gradient Boosted Trees etc. Quite common to use that to gain predictive accuracy, though interpretability/explainability tends to suffer considerably.
肯定不同树方向和经验教训:可视化也受生态工具能力制约。
解释得很好;我理解了不同的树可视化方向。我同意“经验教训”部分:这不只是编程问题,还要判断生态系统的能力。
julbook查看英文原文
Great explanation; I understand different visual tree orientations. I agree with the lesson learned section; it's not about programming alone but also about determining the ecosystem's capabilities.
历次讨论
同类还值得读
如何写一个拼写纠正器
How to Write a Spelling Corrector
Peter Norvig 用一个几十行的 Python 程序演示如何做拼写纠正:先用编辑距离(删除、插入、替换、换位)生成所有可能的候选词,再用从大量文本中统计出的词频概率,选出…
AI 与机器学习上首页 10 次 · 2007–2022norvig.com编辑精选面向黑客的概率编程与贝叶斯方法
Probabilistic Programming and Bayesian Methods for Hackers (2013)
《黑客的贝叶斯方法与概率编程》是一本开源的贝叶斯统计入门书,以 Python/PyMC 代码和交互式 Jupyter Notebook 为主线,强调“先实践、后数学”的学习路径,…
AI 与机器学习上首页 5 次 · 2013–2018camdavidsonpilon.github.io编辑精选神经网络黑客指南
Hacker's Guide to Neural Networks
Andrej Karpathy 写的神经网络入门教程,面向程序员,从最简单的表达式求导讲起,逐步推导出反向传播和梯度下降,最后引出神经网络。
AI 与机器学习上首页 4 次 · 2014–2019karpathy.github.io编辑精选神经网络能逼近任意函数的可视化证明
A visual proof that neural nets can approximate any function
这一章来自 Michael Nielsen 的在线书《Neural Networks and Deep Learning》,用 sigmoid 单元叠加成局部隆起/平滑阶跃的图示…
AI 与机器学习上首页 4 次 · 2014–2022neuralnetworksanddeeplearning.com编辑精选论乔姆斯基与统计学习的两种文化
On Chomsky and the Two Cultures of Statistical Learning
Norvig 回应 Chomsky 对统计语言模型批评的文章,围绕“统计学习能否解释语言”展开,比较生成与解释、少参数模型与 Shannon 式高参数统计模型。
AI 与机器学习上首页 4 次 · 2011–2025norvig.com编辑精选