Dicsrete values as taget variable
I suspect the problem is that your discrete values are non-integer floats.  The classifier's fit method runs type_of_target, which returns (in part):


  'continuous': y is an array-like of floats that are not all
            integers, and is 1d or a column vector.


(source)

(Tracing the source code wasn't straightforward; a traceback of the error from you would have been helpful.  For reference here, RandomForestClassifier inherits from BaseForest, whose fit method calls _validate_y_class_weight which (in the ForestClassifier child class) calls check_classification_targets which calls type_of_target.)