Skip to content
  • Yanbo Liang's avatar
    07be232e
    [SPARK-18412][SPARKR][ML] Fix exception for some SparkR ML algorithms training on libsvm data · 07be232e
    Yanbo Liang authored
    ## What changes were proposed in this pull request?
    * Fix the following exceptions which throws when ```spark.randomForest```(classification), ```spark.gbt```(classification), ```spark.naiveBayes``` and ```spark.glm```(binomial family) were fitted on libsvm data.
    ```
    java.lang.IllegalArgumentException: requirement failed: If label column already exists, forceIndexLabel can not be set with true.
    ```
    See [SPARK-18412](https://issues.apache.org/jira/browse/SPARK-18412) for more detail about how to reproduce this bug.
    * Refactor out ```getFeaturesAndLabels``` to RWrapperUtils, since lots of ML algorithm wrappers use this function.
    * Drop some unwanted columns when making prediction.
    
    ## How was this patch tested?
    Add unit test.
    
    Author: Yanbo Liang <ybliang8@gmail.com>
    
    Closes #15851 from yanboliang/spark-18412.
    07be232e
    [SPARK-18412][SPARKR][ML] Fix exception for some SparkR ML algorithms training on libsvm data
    Yanbo Liang authored
    ## What changes were proposed in this pull request?
    * Fix the following exceptions which throws when ```spark.randomForest```(classification), ```spark.gbt```(classification), ```spark.naiveBayes``` and ```spark.glm```(binomial family) were fitted on libsvm data.
    ```
    java.lang.IllegalArgumentException: requirement failed: If label column already exists, forceIndexLabel can not be set with true.
    ```
    See [SPARK-18412](https://issues.apache.org/jira/browse/SPARK-18412) for more detail about how to reproduce this bug.
    * Refactor out ```getFeaturesAndLabels``` to RWrapperUtils, since lots of ML algorithm wrappers use this function.
    * Drop some unwanted columns when making prediction.
    
    ## How was this patch tested?
    Add unit test.
    
    Author: Yanbo Liang <ybliang8@gmail.com>
    
    Closes #15851 from yanboliang/spark-18412.
Loading