Skip to content
  • Xusen Yin's avatar
    d6dc12ef
    [SPARK-13449] Naive Bayes wrapper in SparkR · d6dc12ef
    Xusen Yin authored
    ## What changes were proposed in this pull request?
    
    This PR continues the work in #11486 from yinxusen with some code refactoring. In R package e1071, `naiveBayes` supports both categorical (Bernoulli) and continuous features (Gaussian), while in MLlib we support Bernoulli and multinomial. This PR implements the common subset: Bernoulli.
    
    I moved the implementation out from SparkRWrappers to NaiveBayesWrapper to make it easier to read. Argument names, default values, and summary now match e1071's naiveBayes.
    
    I removed the preprocess part that omit NA values because we don't know which columns to process.
    
    ## How was this patch tested?
    
    Test against output from R package e1071's naiveBayes.
    
    cc: yanboliang yinxusen
    
    Closes #11486
    
    Author: Xusen Yin <yinxusen@gmail.com>
    Author: Xiangrui Meng <meng@databricks.com>
    
    Closes #11890 from mengxr/SPARK-13449.
    d6dc12ef
    [SPARK-13449] Naive Bayes wrapper in SparkR
    Xusen Yin authored
    ## What changes were proposed in this pull request?
    
    This PR continues the work in #11486 from yinxusen with some code refactoring. In R package e1071, `naiveBayes` supports both categorical (Bernoulli) and continuous features (Gaussian), while in MLlib we support Bernoulli and multinomial. This PR implements the common subset: Bernoulli.
    
    I moved the implementation out from SparkRWrappers to NaiveBayesWrapper to make it easier to read. Argument names, default values, and summary now match e1071's naiveBayes.
    
    I removed the preprocess part that omit NA values because we don't know which columns to process.
    
    ## How was this patch tested?
    
    Test against output from R package e1071's naiveBayes.
    
    cc: yanboliang yinxusen
    
    Closes #11486
    
    Author: Xusen Yin <yinxusen@gmail.com>
    Author: Xiangrui Meng <meng@databricks.com>
    
    Closes #11890 from mengxr/SPARK-13449.
Loading