Is there a better way to split data and deal with an unbalanced dataset?

I think some solutions to this question have already been proposed here: