ibm-granite / granite-tsfm

Foundation Models for Time Series
Apache License 2.0
282 stars 151 forks source link

Does demo support multivariate input single output? #19

Open zmce2018 opened 3 months ago

zmce2018 commented 3 months ago

Thank you so much for providing an easy-to-follow demo and notebook. I have seen the example given on multivariate input and multivariate output forecasting. I wonder if this module supports multivariate input and single output.

For instance, using "HUFL","HULL","MUFL","MULL","LUFL","LULL","OT" as input and predict "MUFL" since we only care about "MUFL"?

Scott534 commented 3 weeks ago

yes, just specify the column indices you want to predict, and add it to 'prediction_channel_indices' to your PatchTSMixerConfig. for example:

config = PatchTSMixerConfig(
        context_length=context_length,
        prediction_length=forecast_horizon,
        patch_length=patch_length,
        num_input_channels=len(forecast_columns2),
        patch_stride=patch_stride,
        d_model=d_model,
        num_layers=3,
        expansion_factor=3,
        dropout=0.7,
        head_dropout=0.6,
        mode="common_channel",
        scaling="std",
        prediction_channel_indices=forecast_channel_indices,
    )