File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
mllib/src/test/scala/org/apache/spark/mllib/regression Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .mllib .regression
1919
20-
21- import org .scalatest .BeforeAndAfterAll
2220import org .scalatest .FunSuite
2321
24- import org .apache .spark .SparkContext
2522import org .apache .spark .mllib .util .{LinearDataGenerator , LocalSparkContext }
2623
2724class LassoSuite extends FunSuite with LocalSparkContext {
@@ -104,4 +101,10 @@ class LassoSuite extends FunSuite with LocalSparkContext {
104101 // Test prediction on Array.
105102 validatePrediction(validationData.map(row => model.predict(row.features)), validationData)
106103 }
104+
105+ test(" do not support intercept" ) {
106+ intercept[UnsupportedOperationException ] {
107+ new LassoWithSGD ().setIntercept(true )
108+ }
109+ }
107110}
Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .mllib .regression
1919
20-
2120import org .jblas .DoubleMatrix
22- import org .scalatest .BeforeAndAfterAll
2321import org .scalatest .FunSuite
2422
2523import org .apache .spark .mllib .util .{LinearDataGenerator , LocalSparkContext }
2624
27-
2825class RidgeRegressionSuite extends FunSuite with LocalSparkContext {
2926
3027 def predictionError (predictions : Seq [Double ], input : Seq [LabeledPoint ]) = {
@@ -74,4 +71,10 @@ class RidgeRegressionSuite extends FunSuite with LocalSparkContext {
7471 assert(ridgeErr < linearErr,
7572 " ridgeError (" + ridgeErr + " ) was not less than linearError(" + linearErr + " )" )
7673 }
74+
75+ test(" do not support intercept" ) {
76+ intercept[UnsupportedOperationException ] {
77+ new RidgeRegressionWithSGD ().setIntercept(true )
78+ }
79+ }
7780}
You can’t perform that action at this time.
0 commit comments