Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6927#discussion_r32903263
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/regression/LinearRegressionSuite.scala 
---
    @@ -78,6 +85,49 @@ class LinearRegressionSuite extends SparkFunSuite with 
MLlibTestSparkContext {
         }
       }
     
    +  test("linear regression without intercept without regularization") {
    +    val trainer = (new LinearRegression).setFitIntercept(false)
    +    val model = trainer.fit(dataset)
    +    val modelNR = trainer.fit(datasetNR)
    +
    +    /**
    +     * Using the following R code to load the data and train the model 
using glmnet package.
    +     *
    +     * library("glmnet")
    +     * data <- read.csv("path", header=FALSE, stringsAsFactors=FALSE)
    +     * features <- as.matrix(data.frame(as.numeric(data$V2), 
as.numeric(data$V3)))
    +     * label <- as.numeric(data$V1)
    --- End diff --
    
    Remove from `Using` up to `label` since it already docuemnted before. 
    
    Also, in the following glmnet code, please add `intercept=FALSE`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to