I have an imbalanced dataset which looks like this. I will use the a reweighing technique to improve the fairness of my dataset (a good example of this is shown in this article).

Computing the weights is pretty straight forward, but my question is:

Do I compute these weights on the original dataset? Or do I compute the weights on the training dataset after I have performed an 80:20 split?

  • $\begingroup$ You should be computing the sample weights on the training data as while the model is training more weightage will be given to the data values with lesser data points. $\endgroup$ – Arjun Muraleedharan Aug 4 '20 at 11:35
  • 1
    $\begingroup$ That said, a useful rule of thumb is that first you split, and then, for all your modeling pipeline, you pretend as if you didn't have access at all to the test split. $\endgroup$ – desertnaut Aug 4 '20 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.