title: Cannot call DecisionTreeClassifier.train()
body: <p>I am trying to use DecisionTreeClassifier.train() but it comes out to such error report:</p>
  
  <blockquote>
    <p>Error:(218, 41) method train in class DecisionTreeClassifier cannot be accessed in org.apache.spark.ml.classification.DecisionTreeClassifier
     Access to protected method train not permitted because
     enclosing object FeatureSelection in package core is not a subclass of 
     class DecisionTreeClassifier in package classification where target is defined
    val dt = decisionTreeClassifier.train(trainRdd)</p>
  </blockquote>
  
  <p>It reports that my object <code>FeatureSelection</code> is not a subclass of package classification so it's unable to call a potected method of the package.But actually train() is a function with public type in official documents.</p>
  
  <p>Surroundings: Scala 2.10.6 Spark 2.10:1.6.1 jdk 1.8</p>
  
  <p>Here are the codes attached:</p>
  
  <pre class="lang-scala prettyprint-override"><code>import org.apache.spark.ml.classification.DecisionTreeClassifier
  
  object FeatureSelection {
    def selectFeatureGreedyDTNoLimit(){
      val selectfeature=ArrayBuffer[String]()
      val selectsize=selectfeature.size
      val tempfeature=selectfeature++ArrayBuffer(line)
  
      val vectorDF = new VectorAssembler()
        .setInputCols(tempfeature.toArray)
        .setOutputCol("features")
        .transform(tempdf)
        .select("label", "features")
  
      val Array(trainRdd, testRdd) =
        vectorDF
        .rdd
        .map(row =&gt;  LabeledPoint(Common.any2Double(row.get(0)).get, row.getAs[Vector](1)))
        .randomSplit(Array(0.5, 0.5), 0L)
  
      val numClasses = 2
      val categoricalFeaturesInfo = Map[Int, Int]()
  
      val dt = decisionTreeClassifier.train(trainRdd, categoricalFeaturesInfo, numClasses)
    }
  }
  </code></pre>
  
  <p>Hoping for someone to help me solve this problem.</p>