scikit-learn中的随机森林解释 [英] Random Forest interpretation in scikit-learn
问题描述
我正在使用 scikit-learn的随机森林回归器以适合数据集上的随机森林回归器.是否可以用一种格式解释输出,然后我就可以使用不使用scikit-learn甚至Python的模型来实现模型拟合?
I am using scikit-learn's Random Forest Regressor to fit a random forest regressor on a dataset. Is it possible to interpret the output in a format where I can then implement the model fit without using scikit-learn or even Python?
该解决方案将需要在微控制器甚至 FPGA 中实现.我正在用Python进行分析和学习,但想在uC或FPGA上实现.
The solution would need to be implemented in a microcontroller or maybe even an FPGA. I am doing analysis and learning in Python but want to implement on a uC or FPGA.
推荐答案
您可以签出graphviz,它使用点语"存储模型(如果您想构建一些自定义解释器,则可以很容易理解,不难).scikit-learn 中有一个 export_graphviz
函数.您可以通过增强库 read_graphviz
方法或其他一些可用的自定义解释器来加载和处理C ++中的模型.
You can check out graphviz, which uses 'dot language' for storing models (which is quite human-readable if you'd want to build some custom interpreter, shouldn't be hard). There is an export_graphviz
function in scikit-learn. You can load and process the model in C++ through boost library read_graphviz
method or some of other custom interpreters available.
这篇关于scikit-learn中的随机森林解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!