Replace binnedFeatures:Array[Int] with binnedFeatures:Int=>Int