There is a 1 dimensional numpy
array named "target_y"
. My task is to ensure that "target_y"
has all values encoded as 1
and -1
, not 1
and 0
before performing logistic regression. Once I do it, I need to assign it to "prepared_y"
and return it. Can I write something like:
if target_y in 1,-1:
prepared_y = target_y