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 {
245245    new  DecisionTree (strategy).train(input : RDD [LabeledPoint ])
246246  }
247247
248-   val  InvalidBinIndex  =  - 1 
248+   private   val  InvalidBinIndex  =  - 1 
249249
250250  /**  
251251   * Returns an array of optimal splits for all nodes at a given level 
Original file line number Diff line number Diff line change 1717
1818package  org .apache .spark .mllib .tree .impurity 
1919
20- import  javax . naming . OperationNotSupportedException 
20+ import  java . lang . UnsupportedOperationException 
2121
2222/** 
2323 * Class for calculating [[http://en.wikipedia.org/wiki/Binary_entropy_function entropy ]] during 
@@ -45,5 +45,5 @@ object Entropy extends Impurity {
4545   }
4646
4747  def  calculate (count : Double , sum : Double , sumSquares : Double ):  Double  = 
48-     throw  new  OperationNotSupportedException (" Entropy.calculate"  )
48+     throw  new  UnsupportedOperationException (" Entropy.calculate"  )
4949}
Original file line number Diff line number Diff line change 1717
1818package  org .apache .spark .mllib .tree .impurity 
1919
20- import  javax . naming . OperationNotSupportedException 
20+ import  java . lang . UnsupportedOperationException 
2121
2222/** 
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 
2525 */  
2626object  Gini  extends  Impurity  {
2727
@@ -43,6 +43,6 @@ object Gini extends Impurity {
4343  }
4444
4545  def  calculate (count : Double , sum : Double , sumSquares : Double ):  Double  = 
46-     throw  new  OperationNotSupportedException (" Gini.calculate"  )
46+     throw  new  UnsupportedOperationException (" Gini.calculate"  )
4747
4848}
Original file line number Diff line number Diff line change 1717
1818package  org .apache .spark .mllib .tree .impurity 
1919
20- import  javax .naming .OperationNotSupportedException 
21- import  org .apache .spark .Logging 
20+ import  java .lang .UnsupportedOperationException 
2221
2322/** 
2423 * Class for calculating variance during regression 
2524 */  
26- object  Variance  extends  Impurity  with   Logging   {
25+ object  Variance  extends  Impurity  {
2726   def  calculate (c0 : Double , c1 : Double ):  Double 
28-    =  throw  new  OperationNotSupportedException (" Variance.calculate"  )
27+    =  throw  new  UnsupportedOperationException (" Variance.calculate"  )
2928
3029  /**  
3130   * variance calculation 
Original file line number Diff line number Diff line change 1818package  org .apache .spark .mllib .tree .model 
1919
2020import  org .apache .spark .Logging 
21- import  org .apache .spark .mllib .regression .LabeledPoint 
2221import  org .apache .spark .mllib .tree .configuration .FeatureType ._ 
2322
2423/** 
Original file line number Diff line number Diff line change 1717
1818package  org .apache .spark .mllib .tree 
1919
20- import  scala .util .Random 
21- 
2220import  org .scalatest .BeforeAndAfterAll 
2321import  org .scalatest .FunSuite 
2422
2523import  org .apache .spark .SparkContext 
26- import  org .apache .spark .SparkContext ._ 
27- 
28- import  org .jblas ._ 
29- import  org .apache .spark .rdd .RDD 
3024import  org .apache .spark .mllib .regression .LabeledPoint 
3125import  org .apache .spark .mllib .tree .impurity .{Entropy , Gini , Variance }
3226import  org .apache .spark .mllib .tree .model .Filter 
3327import  org .apache .spark .mllib .tree .configuration .Strategy 
3428import  org .apache .spark .mllib .tree .configuration .Algo ._ 
35- import  scala .collection .mutable 
3629import  org .apache .spark .mllib .tree .configuration .FeatureType ._ 
3730
3831class  DecisionTreeSuite  extends  FunSuite  with  BeforeAndAfterAll  {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments