'Plotting BQML boosted tree regressor using XGBoost plot_tree

I trained a boosted tree regressor in BQML, and exported the model. See below the resulting file structure. enter image description here

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?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source