File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
mllib/src/test/scala/org/apache/spark/mllib/regression Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -195,17 +195,14 @@ class IsotonicRegressionSuite
195
195
196
196
class IsotonicRegressionClusterSuite
197
197
extends FunSuite
198
- with LocalClusterSparkContext
199
- with MLlibTestSparkContext
200
- with Matchers {
198
+ with LocalClusterSparkContext {
201
199
202
200
test(" task size should be small in both training and prediction" ) {
203
201
val n = 5
204
202
205
-
206
203
val trainData = (0 to n).map(i => (i.toDouble, i.toDouble, 1 .toDouble))
207
204
208
- val points = sc.parallelize(trainData, 2 )
205
+ val points = sc.parallelize(trainData, 1 )
209
206
210
207
/* val points = sc.parallelize(0 until n, 2).mapPartitionsWithIndex { (idx, iter) =>
211
208
val random = new Random(idx)
@@ -215,7 +212,6 @@ class IsotonicRegressionClusterSuite
215
212
// If we serialize data directly in the task closure, the size of the serialized task would be
216
213
// greater than 1MB and hence Spark would throw an error.
217
214
val model = IsotonicRegression .train(points, true )
218
-
219
- model.predict(0 )
215
+ val predictions = model.predict(points.map(_._2))
220
216
}
221
217
}
You can’t perform that action at this time.
0 commit comments