On the Equivalence of Regression and Classification