spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request: Minor optimizations. Use safer take, tail meth...
Date Wed, 23 Apr 2014 07:29:05 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/473#discussion_r11889136
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala ---
    @@ -1120,7 +1120,7 @@ object DecisionTree extends Serializable with Logging {
         sc.textFile(dir).map { line =>
           val parts = line.trim().split(",")
           val label = parts(0).toDouble
    -      val features = Vectors.dense(parts.slice(1,parts.length).map(_.toDouble))
    +      val features = Vectors.dense(parts.tail.map(_.toDouble))
    --- End diff --
    
    by two arrays, i meant one in parts, and the other for the tail, and the map. We should
be able to skip 2 of them.


---
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.
---

Mime
View raw message