I am building a model that recommends the optimal golf club based on data I have gathered. Since the model prediction should be a category, ie. a golf club, I would assume I would have to use a classifier algorithm. However, I have label encoded the types of golf clubs in an ordinal way from 1-14 (1 being the club with longer distance shots and 14 being the one for shortest shots) and have run both random forest regressor and classifier with scikit-learn and the regressor is more accurate. Why is this?
From the comments:
- How did you calculate accuracy for regression?
- By using the method .score(X_test, y_test)
RandomForestRegressor and RandomForestClassifier return completely different metrics when you call the
score functions. Regressor returns coefficient of determination ($R^2$), while for classifier the accuracy. You cannot compare those numbers, it's comparing apples to oranges. There is also no way to calculate accuracy for a regression problem because it doesn't do classification while accuracy is a classification metric (a poor one, by the way).
So the results you observed tell you nothing that allows you to tell that one of the approaches worked better than the another.