You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering about the order in which estimators are stored, specifically, in an XGBoost model. Let's say, I train a model called xgb on a multivariate target series with two components A and B, and an output_chunk_length=2 with multi_models=True.
Are the estimators in xgb.model.estimators_ stored as [A1, A2, B1, B2] or [A1, B1, A2, B2] (if e.g. B2 donates the estimator for component B with horizon 2)?
Alternatively, is there maybe something similar to xgb.lagged_feature_names to retrieve the "target names" of all estimators?
Thank you!
The text was updated successfully, but these errors were encountered:
Based on your example, the order is [A1, B1, A2, B2]. You can access each individual estimator using the helper method model.get_multioutput_estimator(horizon, target_dim), to access the estimator for A1 for example, you would pass horizon=0, target_dim=0.
Oh so you would like an additional method that would return the target name & horizon step forecasted by each estimator as a list?
But sure, it would be convenient if you could retrieve the target and horizon of an estimator.
For example, I'm currently looking at the feature importance of my estimators, e.g.:
x = xgb.model.estimators_[20] x.get_booster().feature_names = xgb.lagged_feature_names plot_importance(x, max_num_features=30)
But I'd also like to know which target this estimator refers to, which is not straightforward, but I can now figure it out by knowing the order.
I just looked at the method you referred to, but I'm not sure it's doing the right thing? It returns self.model.estimators_[horizon + target_dim]. Shouldn't there be some multiplication in there (something like horizon*max_target_dim + target_dim)? Currently, horizon=0 and target_dim=1 returns the same as horizon=1 and target_dim=0, or am I missing something? 🤔
Hi there,
I was wondering about the order in which estimators are stored, specifically, in an XGBoost model. Let's say, I train a model called
xgb
on a multivariate target series with two componentsA
andB
, and anoutput_chunk_length=2
withmulti_models=True
.Are the estimators in
xgb.model.estimators_
stored as[A1, A2, B1, B2]
or[A1, B1, A2, B2]
(if e.g.B2
donates the estimator for componentB
with horizon2
)?Alternatively, is there maybe something similar to
xgb.lagged_feature_names
to retrieve the "target names" of all estimators?Thank you!
The text was updated successfully, but these errors were encountered: