Hello,
Function caret::createDatapartition preserves the proportions of
classes, like its documentation says, so you should expected the result
to be balanced only if the original data.frame is also balanced. A
solution is to write a small function that chooses a balanced set of
indices. Note
Dear community
I have a dataframe and want to split it into a learn and a test partition.
However the learnset should be balanced, i.e. each class should have the
same number of cases. I tried and searched a lot, without success so far.
Maybe you can help?
Some example code
*# generate example da
2 matches
Mail list logo