What's a more elegant way to deal with this? I was thinking `-1 if np.dot(x, w) < 0 else 1` but then how to do the batch one efficiently?