I am working on a multiclass classification problem using RandomForestClassifier. The target variable Y only contain one of 3 values {-1,0,1 }. I understand that numerical encoding is necessary.
However, I would like to understand if it is necessary for me to transform Y to obtain an indicator matrix like below by doing pd.get_dummies(Y) and then feed this indicator matrix into the RandomForestClassifier?
-1.0 0.0 1.0
0 0 0 1
1 1 0 0
2 0 0 1
3 1 0 0
4 1 0 0
... ... ...
6516 1 0 0
6517 0 0 1
6518 0 0 1
6519 0 0 1
6520 1 0 0
Comparing above to feeding the untransformed target variable Y (i.e. a 1 dimensional series) into RandomForestClassifier, how would this affect the machine learning algorithm ? Would the results be different and why ?
Is the RandomForestClassifier doing different things under these 2 different scenarios ?
Which approach is recommended (indicator matrix vs untransformed)?