When modeling time series data how do we give more weight to more recent data?

I did some research on this, it turned out that Xgboost has a parameter sample_weight_eval_set (list, optional) that we can pass in, but I can’t seem to find an example for this parameter, can someone please share ?
In addition, how do we in general assign more weight to more recent data points when modeling time series data ?
Thank you very much in advance !

1 Like

Hi @szd116!

Did you resolve this question? I’m using xgboost for a regression problem, and the sample_weight parameter does not work as I was expecting, and I couldn’t find much information about the meaning of these weights.

In my case, I’m trying to create a model to fit the following time series:

The behaviour of the time series has changes while the type of inputs has not. I was expecting to use the sample_weight parameter so the data prior to the change of pattern (about June 2020) would have a weight of 0 and the rest a weight of 10.

The resulting predictions do not seem to ignore the data that has a weight = 0, so in the predictions there are predicted values higher than the maximum registered values since June 2020.

Any help you can provide will be appreciated.

Thanks in advance!