I have used MLJ for XGBoost in the past, and was able to explore the feature importances doing the following:
using MLJ, DataFrames @load XGBoostRegressor pkg=XGBoost X = DataFrame(rand((0, 1), (200, 5)), :auto) y = rand([true, false], 200) model = MLJXGBoostInterface.XGBoostRegressor() xgb = machine(model, X, y) |> fit! y_hat = MLJ.predict(xgb, X) f = fitted_params(xgb) r = report(xgb) # the report had all the following fields I could access: begin gains = [i.gain for i in r] covers = [i.cover for i in r] freqs = [i.freq for i in r] feats = [i.fname for i in r] end
However, this no longer works because it’s no longer part of
fieldnames(typeof(r)) > (:features,)
How can I now access the gain, cover and frequency of the different features?
PS: This is straightforward using the original XGBoost package, but I like using MLJ:
using XGBoost b = xgboost((X, y)) c = importancereport(b)