amplab / keystone

Simplifying robust end-to-end machine learning on Apache Spark.
http://keystone-ml.org/
Apache License 2.0
470 stars 117 forks source link

ClassLabelIndicatorsFromIntLabels should error when given labels outside [0, numClasses) #197

Closed ericmjonas closed 8 years ago

ericmjonas commented 8 years ago

It's not immediately obvious that ClassLabelIndicatorsFromIntLabels wants contiguous class labels, and a naive user might give it labels like {-1, +1} or simply unique keys. Throwing an error here would be great.

ericmjonas commented 8 years ago

Upon further investigation this is actually because we are indexing into a breeze array that treats (-1) as the last element of the list. Still a bug, but more subtle than I thought.