# emphasise some observation weights more than the others

I want to emphasise (increase the weight) of only a subset of data. Lets say I have old and fresh data, I would like to say that old data has to have more weight and therefore has more influence in the decision than the new data.

In scikit-learn I found only class-weight parameter, but it does not change the weight of the samples, only of all samples within the class.

Is there a way to incorporate this emphasis into the gradient boosted trees in spark or xgboost in python?

If you have a date variable (or something similar), you can create a weight using this.

If you're using XGBoost, there is an option to specify a weight for each instance when creating the DMatrix - feed your observation weighting in here.

There might be a fancier way to create dynamic weights but I would probably start with oversampling the subset and see how that goes. So if you've got classes A, B, and C and want to emphasize C, make a duplicate copy of C and insert that into your training data. In other words, assume you have six records to train on:

1. A1
2. A2
3. B1
4. B2
5. C1
6. C2