简体   繁体   English

森林随机回归的残差(Python)

[英]Residuals of Random Forest Regression (Python)

When using RandomForestRegressor from Sklearn, how do you get the residuals of the regression? 使用Sklearn的RandomForestRegressor时,如何获得回归的残差? I would like to plot out these residuals to check the linearity. 我想绘制这些残差以检查线性度。

There is no function for that, as we like to keep the interface very simple. 没有任何功能,因为我们希望使界面保持非常简单。 You can just do 你可以做

y - rf.predict(X)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM