-
- Downloads
[SPARK-8314][MLlib] improvement in performance of MLUtils.appendBias
MLUtils.appendBias method is heavily used in creating intercepts for linear models. This method uses Breeze's vector concatenation which is very slow compared to the plain System.arrayCopy. This improvement is to change the implementation to use System.arrayCopy. I saw the following performance improvements after the change: Benchmark with mnist dataset for 50 times: MLUtils.appendBias (SparseVector Before): 47320 ms MLUtils.appendBias (SparseVector After): 1935 ms MLUtils.appendBias (DenseVector Before): 5340 ms MLUtils.appendBias (DenseVector After): 4080 ms This is almost a 24 times performance boost for SparseVectors. Author: Roger Menezes <rmenezes@netflix.com> Closes #6768 from rogermenezes/improve-append-bias and squashes the following commits: 4e42f75 [Roger Menezes] address feedback e999d79 [Roger Menezes] first commit
Showing
- examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala 2 additions, 2 deletions.../apache/spark/examples/ml/LogisticRegressionExample.scala
- mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala 2 additions, 2 deletions...b/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala
- mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala 21 additions, 5 deletions.../src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
Please register or sign in to comment