spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bui, Tri" <>
Subject RE: Inaccurate Estimate of weights model from StreamingLinearRegressionWithSGD
Date Tue, 25 Nov 2014 15:51:53 GMT
Thanks Liang!

It was my bad, I fat finger one of the data point, correct it and the result match with yours.

I am still not able to get the intercept.  I am getting   [error] /data/project/LinearRegression/src/main/scala/StreamingLinearRegression.scala:47:
value setIntercept
mber of org.apache.spark.mllib.regression.StreamingLinearRegressionWithSGD

I try code below:
val model = new StreamingLinearRegressionWithSGD().setInitialWeights(Vectors.zeros(args(3).toInt))
model.setIntercept(addIntercept = true).trainOn(trainingData)


val model = new StreamingLinearRegressionWithSGD().setInitialWeights(Vectors.zeros(args(3).toInt))

But still get compilation error.


From: Yanbo Liang []
Sent: Tuesday, November 25, 2014 4:08 AM
To: Bui, Tri
Subject: Re: Inaccurate Estimate of weights model from StreamingLinearRegressionWithSGD

The case run correctly in my environment.

14/11/25 17:48:20 INFO regression.StreamingLinearRegressionWithSGD: Model updated at time
1416908900000 ms
14/11/25 17:48:20 INFO regression.StreamingLinearRegressionWithSGD: Current model: weights,

Can you provide more detail information if it is convenience?

Turn on the intercept value can be set as following:
val model = new StreamingLinearRegressionWithSGD()

2014-11-25 3:31 GMT+08:00 Bui, Tri <<>>:

I am getting incorrect weights model from StreamingLinearRegressionwith SGD.

One feature Input data is:


The result from the Current model: weights is [-4.432]….which is not correct.

Also, how do I turn on the intercept value for the StreamingLinearRegression ?


View raw message