You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hhbyyh <gi...@git.apache.org> on 2017/03/22 20:12:35 UTC

[GitHub] spark pull request #17014: [SPARK-18608][ML] Fix double-caching in ML algori...

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

    https://github.com/apache/spark/pull/17014#discussion_r107515202
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/DecisionTreeClassifier.scala ---
    @@ -110,12 +111,17 @@ class DecisionTreeClassifier @Since("1.4.0") (
         val oldDataset: RDD[LabeledPoint] = extractLabeledPoints(dataset, numClasses)
         val strategy = getOldStrategy(categoricalFeatures, numClasses)
     
    -    val instr = Instrumentation.create(this, oldDataset)
    +    val handlePersistence = storageLevel == StorageLevel.NONE
    +    if (handlePersistence) oldDataset.persist(StorageLevel.MEMORY_AND_DISK)
    --- End diff --
    
    `storageLevel == StorageLevel.NONE` could be a function defined in `Predictor` to avoid code duplicates.
    
    I'm not sure if we always want to use `StorageLevel.MEMORY_AND_DISK`, but it will be good to have some flexibility. How about adding a field to represent `StorageLevel.MEMORY_AND_DISK`?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org