Github user sethah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8675#discussion_r39110298
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala
 ---
    @@ -166,6 +167,7 @@ private[ml] object DecisionTreeClassificationModel {
             s" DecisionTreeClassificationModel (new API).  Algo is: 
${oldModel.algo}")
         val rootNode = Node.fromOld(oldModel.topNode, categoricalFeatures)
         val uid = if (parent != null) parent.uid else 
Identifiable.randomUID("dtc")
    -    new DecisionTreeClassificationModel(uid, rootNode, -1)
    +    // Can't infer number of features from old model, so default to -1
    +    new DecisionTreeClassificationModel(uid, rootNode, -1, -1)
    --- End diff --
    
    There isn't a way to infer the number of features from an old MLlib model 
since we only have access to the DT root node. I give it a dummy value of -1 
here, but would appreciate feedback to see if there is a better way.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to