It would be useful to be able to give weights for ...
# neural-forecast
m
It would be useful to be able to give weights for loss computation to the different timeseries (e.g., by associating a weight to each "unique_id"). At the moment I think the only way to achieve something like this is to oversample the timeseries you want to give a higher weight by replicating them within the training set.
k
Hey @Manuel, You are correct, for the moment we don't have implemented weighted losses in the code. You can hack them through over sampling series in the dataset. Weighted losses is something that we want to include soon in the library's capabilities.
👍 1
c
a couple of weeks ago we added the possibility to add an
available_mask
column to the input dataframe. It is meant to indicate missing/available values, but since it is basically used as a weight multiplier of the loss you could use it for your purpose
m
@Cristian (Nixtla) Interesting! I'm currently using an exogenous variable called "is_real_data" to indicate whether a value is available or not. How does this "available_mask" work? Do I need to add a column with the name "available_mask" in which I enter the value 0 for missing, 1 for available values and a value greater than 1 to give it more weight? Is it sufficient to add this column or do I need to enable this feature in some special way? Since I want to give a different weight to each "unique_id" but in this case I have a value of "available_mask" for each point, is it ok to enter the same value for each point belonging to the same "unique_id"? Thanks
c
Yes to everything, just add the column.
👍 1
Still, note that this is a hack and we didn't explicitly intend to use the
available_mask
for this purpose. We will add a proper weight variable in future releases