Random Forest interpretation in scikit-learn

我与影子孤独终老i 提交于 2021-02-07 13:47:06

问题


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?

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.


回答1:


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.




回答2:


It's unclear what you mean by this part:

Now, that I have the results, is it possible to interpret this in some format where I can then implement the fit without using sklearn or even python?

Implement the fitting process for a given dataset? tree topology? choice of parameters?

As to 'implement... without using sklearn or python', did you mean 'port the bytecode or binary' or 'clean-code a totally new implementation'?

Assuming you meant the latter, I'd suggest GPU rather than FPGA or uC.



来源:https://stackoverflow.com/questions/16329384/random-forest-interpretation-in-scikit-learn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!