使用 XGBoostplot_tree 绘制 BQML 增强树回归量
我在 BQML 中训练了增强树回归器,并导出了模型。请参阅下面生成的文件结构。
我可以使用 XBoost 导入 model.bst 文件并绘制决策树,但图中缺少特征名称。
# plot decision tree
from xgboost import XGBRegressor, plot_tree, plot_importance
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
model=XGBRegressor()
model.load_model('./boostedtree_model/model.bst')
plt.figure(figsize=(50,50)) # set plot size (denoted in inches)
plot_tree(model,fontsize="48",rankdir='LR')
plt.savefig('boosted_tree.pdf',bbox_inches='tight',dpi=1200)
据我在互联网上找到的信息,BQML 不会生成包含模型和功能名称的 model.json。
有谁知道如何获取 BQML 训练模型的名称?
I trained a boosted tree regressor in BQML, and exported the model. See below the resulting file structure.
I'm able to import the model.bst file with XBoost and plot the decision tree, but the name of the features are missing from the plot.
# plot decision tree
from xgboost import XGBRegressor, plot_tree, plot_importance
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
model=XGBRegressor()
model.load_model('./boostedtree_model/model.bst')
plt.figure(figsize=(50,50)) # set plot size (denoted in inches)
plot_tree(model,fontsize="48",rankdir='LR')
plt.savefig('boosted_tree.pdf',bbox_inches='tight',dpi=1200)
For what I could find on the internet, BQML do not generate a model.json, which would contain the model and the feature names.
Does anyone knows how to get the names for BQML trained models?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论