Skip to content

Commit

Permalink
clean DecisionTreeSuite to use LocalSparkContext
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Apr 29, 2014
1 parent c81807f commit df34907
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import org.jblas.DoubleMatrix

import org.apache.spark.mllib.util.LocalSparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.Partitioner

object ALSSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,18 @@

package org.apache.spark.mllib.tree

import org.scalatest.BeforeAndAfterAll
import org.scalatest.FunSuite

import org.apache.spark.SparkContext
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.tree.impurity.{Entropy, Gini, Variance}
import org.apache.spark.mllib.tree.model.Filter
import org.apache.spark.mllib.tree.configuration.Strategy
import org.apache.spark.mllib.tree.configuration.Algo._
import org.apache.spark.mllib.tree.configuration.FeatureType._
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.util.LocalSparkContext

class DecisionTreeSuite extends FunSuite with BeforeAndAfterAll {

@transient private var sc: SparkContext = _

override def beforeAll() {
sc = new SparkContext("local", "test")
}

override def afterAll() {
sc.stop()
System.clearProperty("spark.driver.port")
}
class DecisionTreeSuite extends FunSuite with LocalSparkContext {

test("split and bin calculation") {
val arr = DecisionTreeSuite.generateOrderedLabeledPointsWithLabel1()
Expand Down

0 comments on commit df34907

Please sign in to comment.