First parameter is the number of decision tree to use , TrainData is the training data vector , class is the label for each vector, method parameter is used to differ between regression and classification training. NVarToSample used to set the algorithm to "random forest" .
Now after training , how to use this object for classification :
YFIT : label the high fitted class label. scores : contain the score for each label .