File tree Expand file tree Collapse file tree 6 files changed +10
-19
lines changed
main/scala/org/apache/spark/mllib/tree
test/scala/org/apache/spark/mllib/tree Expand file tree Collapse file tree 6 files changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ object DecisionTree extends Serializable with Logging {
245
245
new DecisionTree (strategy).train(input : RDD [LabeledPoint ])
246
246
}
247
247
248
- val InvalidBinIndex = - 1
248
+ private val InvalidBinIndex = - 1
249
249
250
250
/**
251
251
* Returns an array of optimal splits for all nodes at a given level
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .mllib .tree .impurity
19
19
20
- import javax . naming . OperationNotSupportedException
20
+ import java . lang . UnsupportedOperationException
21
21
22
22
/**
23
23
* Class for calculating [[http://en.wikipedia.org/wiki/Binary_entropy_function entropy ]] during
@@ -45,5 +45,5 @@ object Entropy extends Impurity {
45
45
}
46
46
47
47
def calculate (count : Double , sum : Double , sumSquares : Double ): Double =
48
- throw new OperationNotSupportedException (" Entropy.calculate" )
48
+ throw new UnsupportedOperationException (" Entropy.calculate" )
49
49
}
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .mllib .tree .impurity
19
19
20
- import javax . naming . OperationNotSupportedException
20
+ import java . lang . UnsupportedOperationException
21
21
22
22
/**
23
- * Class for calculating the [[http://en.wikipedia.org/wiki/Gini_coefficient Gini
24
- * coefficent ]] during binary classification
23
+ * Class for calculating the [[http://en.wikipedia
24
+ * .org/wiki/Decision_tree_learning#Gini_impurity ]] during binary classification
25
25
*/
26
26
object Gini extends Impurity {
27
27
@@ -43,6 +43,6 @@ object Gini extends Impurity {
43
43
}
44
44
45
45
def calculate (count : Double , sum : Double , sumSquares : Double ): Double =
46
- throw new OperationNotSupportedException (" Gini.calculate" )
46
+ throw new UnsupportedOperationException (" Gini.calculate" )
47
47
48
48
}
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .mllib .tree .impurity
19
19
20
- import javax .naming .OperationNotSupportedException
21
- import org .apache .spark .Logging
20
+ import java .lang .UnsupportedOperationException
22
21
23
22
/**
24
23
* Class for calculating variance during regression
25
24
*/
26
- object Variance extends Impurity with Logging {
25
+ object Variance extends Impurity {
27
26
def calculate (c0 : Double , c1 : Double ): Double
28
- = throw new OperationNotSupportedException (" Variance.calculate" )
27
+ = throw new UnsupportedOperationException (" Variance.calculate" )
29
28
30
29
/**
31
30
* variance calculation
Original file line number Diff line number Diff line change 18
18
package org .apache .spark .mllib .tree .model
19
19
20
20
import org .apache .spark .Logging
21
- import org .apache .spark .mllib .regression .LabeledPoint
22
21
import org .apache .spark .mllib .tree .configuration .FeatureType ._
23
22
24
23
/**
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .spark .mllib .tree
19
19
20
- import scala .util .Random
21
-
22
20
import org .scalatest .BeforeAndAfterAll
23
21
import org .scalatest .FunSuite
24
22
25
23
import org .apache .spark .SparkContext
26
- import org .apache .spark .SparkContext ._
27
-
28
- import org .jblas ._
29
- import org .apache .spark .rdd .RDD
30
24
import org .apache .spark .mllib .regression .LabeledPoint
31
25
import org .apache .spark .mllib .tree .impurity .{Entropy , Gini , Variance }
32
26
import org .apache .spark .mllib .tree .model .Filter
33
27
import org .apache .spark .mllib .tree .configuration .Strategy
34
28
import org .apache .spark .mllib .tree .configuration .Algo ._
35
- import scala .collection .mutable
36
29
import org .apache .spark .mllib .tree .configuration .FeatureType ._
37
30
38
31
class DecisionTreeSuite extends FunSuite with BeforeAndAfterAll {
You can’t perform that action at this time.
0 commit comments