-
- Downloads
[SPARK-17697][ML] Fixed bug in summary calculations that pattern match against...
[SPARK-17697][ML] Fixed bug in summary calculations that pattern match against label without casting ## What changes were proposed in this pull request? In calling LogisticRegression.evaluate and GeneralizedLinearRegression.evaluate using a Dataset where the Label is not of a double type, calculations pattern match against a double and throw a MatchError. This fix casts the Label column to a DoubleType to ensure there is no MatchError. ## How was this patch tested? Added unit tests to call evaluate with a dataset that has Label as other numeric types. Author: Bryan Cutler <cutlerb@gmail.com> Closes #15288 from BryanCutler/binaryLOR-numericCheck-SPARK-17697.
Showing
- mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala 1 addition, 1 deletion...g/apache/spark/ml/classification/LogisticRegression.scala
- mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala 6 additions, 5 deletions...che/spark/ml/regression/GeneralizedLinearRegression.scala
- mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala 17 additions, 1 deletion...che/spark/ml/classification/LogisticRegressionSuite.scala
- mllib/src/test/scala/org/apache/spark/ml/regression/GeneralizedLinearRegressionSuite.scala 25 additions, 0 deletions...park/ml/regression/GeneralizedLinearRegressionSuite.scala
Loading
Please register or sign in to comment