Please check the input path to your test data, and call `.count()` and
see whether there are records in it. -Xiangrui
On Sat, Jun 20, 2015 at 9:23 PM, Gavin Yue wrote:
> Hey,
>
> I am testing the StreamingLinearRegressionWithSGD following the tutorial.
>
>
> It works, but I co
Hey,
I am testing the StreamingLinearRegressionWithSGD following the tutorial.
It works, but I could not output the prediction results. I tried the
saveAsTextFile, but it only output _SUCCESS to the folder.
I am trying to check the prediction results and use
BinaryClassificationMetrics to get
.0001.
val trainingData = ssc.textFileStream(inp(0)).map(LabeledPoint.parse)
val testData = ssc.textFileStream(inp(1)).map(LabeledPoint.parse)
val model = new
StreamingLinearRegressionWithSGD().setInitialWeights(Vectors.zeros(inp(3).toInt)).setNumIterations(inp(4).toInt).setStepSize(
I agree, implementing StreamingRidgeRegressionWithSGD
and StreamingLassoWithSGD following StreamingLinearRegressionWithSGD is
make sense.
2014-12-02 6:00 GMT+08:00 Joanne Contact :
> Hi Gurus,
>
> I did not look at the code yet. I wonder if
> StreamingLinearRegressionWit
Hi Gurus,
I did not look at the code yet. I wonder if StreamingLinearRegressionWithSGD
<http://spark.apache.org/docs/latest/api/java/org/apache/spark/mllib/regression/StreamingLinearRegressionWithSGD.html>
is equivalent to
LinearRegressionWithSGD
<http://spark.apache.org/docs/latest/api
ted values, which is the lp.features.
Thanks
Tri
From: Yanbo Liang [mailto:yanboha...@gmail.com]
Sent: Thursday, November 27, 2014 12:22 AM
To: Bui, Tri
Cc: user@spark.apache.org
Subject: Re: Inaccurate Estimate of weights model from
StreamingLinearRegressionWithSGD
Hi Tri,
Maybe my latest responds
Hi Tri,
Maybe my latest responds for your problem is lost, whatever, the following
code snippet can run correctly.
val model = new
StreamingLinearRegressionWithSGD().setInitialWeights(Vectors.zeros(args(3).toInt))
model.algorithm.setIntercept(true)
Because that all setXXX() function in
se)
val testData = ssc.textFileStream(args(1)).map(LabeledPoint.parse)
val model = new
StreamingLinearRegressionWithSGD().setInitialWeights(Vectors.zeros(args(3).toInt)).setNumIterations(args(4).toInt).setStepSize(.0001).algorithm.setIntercept(true)
model.trainOn(trainingData)
model.predictOnVa
;)
val ssc = new StreamingContext(conf, Seconds(args(2).toLong))
val trainingData = ssc.textFileStream(args(0)).map(LabeledPoint.parse)
val testData = ssc.textFileStream(args(1)).map(LabeledPoint.parse)
val model = new
StreamingLinearRegressionWithSGD().setInitialWeights(Vectors
Hi Tri,
setIntercept() is not a member function
of StreamingLinearRegressionWithSGD, it's a member function
of LinearRegressionWithSGD(GeneralizedLinearAlgorithm) which is a member
variable(named algorithm) of StreamingLinearRegressionWithSGD.
So you need to change your code to:
val model
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)
and:
val model = new
StreamingLinearRegressionWithSGD
information if it is convenience?
Turn on the intercept value can be set as following:
val model = new StreamingLinearRegressionWithSGD()
.algorithm.setIntercept(true)
2014-11-25 3:31 GMT+08:00 Bui, Tri :
> Hi,
>
>
>
> I am getting incorrect weights model from StreamingLinearRegre
Hi,
I am getting incorrect weights model from StreamingLinearRegressionwith SGD.
One feature Input data is:
(1,[1])
(2,[2])
...
.
(20,[20])
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 StreamingLinearRegressi
13 matches
Mail list logo