I fit a dataset with a binary target class by the random forest. In python, I can do it either by randomforestclassifier or randomforestregressor.
I can get the classification directly from randomforestclassifier or I could run randomforestregressor first and get back a set of estimated probabilities. Then I can find a cutoff value to derive the predicted classes out of the set of probabilities. Both methods can achieve the same goal (i.e. predict the classes for the test data).
Also I can observe that
randomforestclassifier.predict_proba(X_test)[:,1])
is different from
randomforestregressor.predict(X_test)
So I just wanna confirm that both methods are valid and then which one is better in random forest application?