we add some functionality which, at least in the simple case with 0s and 1s, checks whether the levels correspond to the numbers in the input vector. If that's not the case, we throw a warning.
we create a helper function that allows users to convert their input into a factor and specify exactly which outcome their predicted value corresponds to.
Transforming a vector of
0
s and1
s into a factor can be tricky (at least if you're me).Consider the following example:
those two things give different results.
I suggest the following:
0
s and1
s, checks whether the levels correspond to the numbers in the input vector. If that's not the case, we throw a warning.