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 yue.yuany...@gmail.com wrote:
Hey,
I am testing the StreamingLinearRegressionWithSGD following the tutorial.
It works, but I could
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
.
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(inp(5
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 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/java/org
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.zeros(args(3).toInt
= 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.predictOnValues(testData.map(lp
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
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 tri@verizonwireless.com.invalid:
Hi,
I am getting incorrect weights model from
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)
and:
val model = new
StreamingLinearRegressionWithSGD
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 = new
11 matches
Mail list logo