Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
freeman-lab committed Aug 1, 2014
1 parent 7d51378 commit 2fe0720
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.spark.streaming.dstream.DStream
*
* This class takes as type parameters a GeneralizedLinearModel,
* and a GeneralizedLinearAlgorithm, making it easy to extend to construct
* streaming versions of arbitrary regression analyses. For example usage,
* streaming versions of any analyses using GLMs. For example usage,
* see StreamingLinearRegressionWithSGD.
*
* NOTE: Only weights will be updated, not an intercept.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ object StreamingLinearRegressionWithSGD {
/**
* Start a streaming Linear Regression model by setting optimization parameters.
*
* @param numIterations Number of iterations of gradient descent to run.
* @param stepSize Step size to be used for each iteration of gradient descent.
* @param numIterations Number of iterations of gradient descent to run.
* @param miniBatchFraction Fraction of data to be used per iteration.
* @param initialWeights Weights to initialize model with.
*/
Expand All @@ -100,13 +100,13 @@ object StreamingLinearRegressionWithSGD {
/**
* Start a streaming Linear Regression model by setting optimization parameters.
*
* @param numIterations Number of iterations of gradient descent to run.
* @param stepSize Step size to be used for each iteration of gradient descent.
* @param numIterations Number of iterations of gradient descent to run.
* @param initialWeights Weights to initialize model with.
*/
def start(
numIterations: Int,
stepSize: Double,
numIterations: Int,
initialWeights: Vector): StreamingLinearRegressionWithSGD = {
start(stepSize, numIterations, 1.0, initialWeights)
}
Expand All @@ -130,7 +130,7 @@ object StreamingLinearRegressionWithSGD {
*/
def start(
initialWeights: Vector): StreamingLinearRegressionWithSGD = {
start(0.1, 100, 1.0, initialWeights)
start(0.1, 50, 1.0, initialWeights)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class StreamingLinearRegressionSuite extends FunSuite with LocalSparkContext {
val batchDuration = Milliseconds(1000)
val ssc = new StreamingContext(sc, batchDuration)
val data = MLUtils.loadStreamingLabeledPoints(ssc, testDir.toString)
//val model = StreamingLinearRegressionWithSGD.start(initialWeights=Vectors.dense(0.0), numIterations=50)
val model = new StreamingLinearRegressionWithSGD()
.setInitialWeights(Vectors.dense(0.0, 0.0))
.setStepSize(0.1)
Expand Down

0 comments on commit 2fe0720

Please sign in to comment.