You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/06 07:07:15 UTC
[GitHub] [spark] zhengruifeng edited a comment on issue #27473:
[SPARK-30699][ML][PYSPARK] GMM blockify input vectors
zhengruifeng edited a comment on issue #27473: [SPARK-30699][ML][PYSPARK] GMM blockify input vectors
URL: https://github.com/apache/spark/pull/27473#issuecomment-582765435
data: `a9a`: numFeatures=123, numInstances=32,561
testCode:
```scala
import org.apache.spark.ml.clustering._
import org.apache.spark.storage.StorageLevel
import org.apache.spark.ml.linalg._
val df = spark.read.format("libsvm").load("/data1/Datasets/a9a/a9a")
df.persist(StorageLevel.MEMORY_AND_DISK)
df.count
new GaussianMixture().fit(df)
val results = Seq(2, 8, 32).map { k => val start = System.currentTimeMillis; val model = new GaussianMixture().setK(k).setSeed(0).setTol(0).setMaxIter(20).fit(df); val dur = System.currentTimeMillis - start; (model, dur) }
results.map(_._2)
results.map(_._1.summary.numIter)
results.map(_._1.summary.logLikelihood)
results.map(t => t._2.toDouble / t._1.summary.numIter)
```
result:
|Impl| This PR(k=2) | This PR(k=8) | This PR(k=32) | Master(k=2) | Master(k=8) | Master(k=32) |
|------|----------|------------|----------|------------|----------|----------|
|numIter|3|3|5|3|8|4|
|logLikelihood|2814835.470027733|2817523.6371536762|2820228.372200876|2814835.4700277536|2817523.6371535994|2820228.3722007386|
|dur per iteration| 950.0 | 2744.3333333333335 | 9780.6 | 1192.6666666666667 | 3446.375| 15724.75 |
With NativeBLAS with OPENBLAS_NUM_THREADS=1:
|Impl| This PR(k=2) | This PR(k=8) | This PR(k=32) | Master(k=2) | Master(k=8) | Master(k=32) |
|------|----------|------------|----------|------------|----------|----------|
|numIter|3|3|20|3|20|8|
|logLikelihood|2814835.4700277243 | 2817523.6371536693 | 2820228.372200879|2814835.4700277452|2817523.6371535957|2820228.372200736|
|dur per iteration| 780.0| 2356.3333333333335 | 8192.95 | 1183.0 | 3022.1 | 13073.75 |
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org