pytorch-forecasting
pytorch-forecasting copied to clipboard
Partial dependency on categorical features
I am trying to make some sort of a "simulation", namely I want to plot the dependency of my target
feature demand from one of the known time_varying_known_categoricals
.
Here are my KWARGS:
KWARGS = {'max_prediction_length': 1, 'max_encoder_length': 6, 'time_idx': 'time_idx', 'target': 'SessionDuration', 'group_ids': ['Id'], 'time_varying_known_categoricals': ['CapColor'], 'static_reals': ["Latitude", "Longitude"], 'time_varying_known_reals': ["time_idx", "sin_month", "cos_month"], 'time_varying_unknown_reals': ["GrossPaid", "SessionDuration"]}
CapColor is a categorical policy that influences the target feature demand.
However, the best_tft.predict_dependency()
method does not work with categorical features.
dependency = best_tft.predict_dependency( val_dataloader.dataset, "CapColor", np.linspace(0, 30, 30), show_progress_bar=True, mode="dataframe" )
Are there any ideas on how to plot dependencies on categorical features?