0
$\begingroup$

I have labels I feed to a LSTM model. I noticed that there were to few 1s and -1s compared to the number of 0s. I have at least 99.9% of 0s and the rest are 1s and -1s. I considered using weighted classes where I give more weight on 1 and -1 labels and a lot less weight on the 0 labels.

Is it a good practice to put kinda neighbourhood of 1s and -1s around each 1 and -1 in my dataset?

For instance, suppose I have:

..., 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, ... 

I would like to create a function that will transform that to:

..., 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, ...

when k=2. So that way we catch the information around the initial labels.

$\endgroup$
1
$\begingroup$

There is no way to truly answer this question since it will be highly dependent on your use case but things like "target replication" have been shown to improve the performance in some cases. However, I would definitely try the weighted classes first since it doesn't really change your target (though it will affect calibration of your model!)

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.