You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "somil deshmukh (JIRA)" <ji...@apache.org> on 2015/06/29 10:13:04 UTC

[jira] [Commented] (SPARK-8660) Update comments that contain R statements in ml.logisticRegressionSuite

    [ https://issues.apache.org/jira/browse/SPARK-8660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605257#comment-14605257 ] 

somil deshmukh commented on SPARK-8660:
---------------------------------------

I would like to solve this issue

> Update comments that contain R statements in ml.logisticRegressionSuite
> -----------------------------------------------------------------------
>
>                 Key: SPARK-8660
>                 URL: https://issues.apache.org/jira/browse/SPARK-8660
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML
>    Affects Versions: 1.4.0
>            Reporter: Xiangrui Meng
>            Priority: Trivial
>              Labels: starter
>   Original Estimate: 20m
>  Remaining Estimate: 20m
>
> We put R statements as comments in unit test. However, there are two issues:
> 1. JavaDoc style "/** ... */" is used instead of normal multiline comment "/* ... */".
> 2. We put a leading "*" on each line. It is hard to copy & paste the commands to/from R and verify the result.
> For example, in https://github.com/apache/spark/blob/master/mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala#L504
> {code}
>     /**
>      * Using the following R code to load the data and train the model using glmnet package.
>      *
>      * > library("glmnet")
>      * > data <- read.csv("path", header=FALSE)
>      * > label = factor(data$V1)
>      * > features = as.matrix(data.frame(data$V2, data$V3, data$V4, data$V5))
>      * > weights = coef(glmnet(features,label, family="binomial", alpha = 1.0, lambda = 6.0))
>      * > weights
>      * 5 x 1 sparse Matrix of class "dgCMatrix"
>      *                      s0
>      * (Intercept) -0.2480643
>      * data.V2      0.0000000
>      * data.V3       .
>      * data.V4       .
>      * data.V5       .
>      */
> {code}
> should change to
> {code}
>     /*
>       Using the following R code to load the data and train the model using glmnet package.
>      
>       library("glmnet")
>       data <- read.csv("path", header=FALSE)
>       label = factor(data$V1)
>       features = as.matrix(data.frame(data$V2, data$V3, data$V4, data$V5))
>       weights = coef(glmnet(features,label, family="binomial", alpha = 1.0, lambda = 6.0))
>       weights
>       5 x 1 sparse Matrix of class "dgCMatrix"
>                            s0
>       (Intercept) -0.2480643
>       data.V2      0.0000000
>       data.V3       .
>       data.V4       .
>       data.V5       .
>     */
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org