Did you try up train on raster and then identify your thresholds in Quantize class value ,
Did you check up this post
Source of the post