spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhengruifeng <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14340][DOC] Add Scala Example and User ...
Date Sat, 07 May 2016 01:05:10 GMT
Github user zhengruifeng commented on the pull request:

    https://github.com/apache/spark/pull/11844#issuecomment-217595289
  
    @MLnick @sethah @yanboliang 
    
    There is something wrong:
    ```
    val dataset = spark.read.format("libsvm").load("data/mllib/sample_libsvm_data.txt")
    val kmeans = new KMeans().setK(2).setFeaturesCol("features")
    val model = kmeans.fit(dataset)
    val WSSSE = model.computeCost(dataset)
    ```
    The WSSSE is always `0`, and the `model.clusterCenters` only contains empty zero-length
vectors `Array[org.apache.spark.mllib.linalg.Vector] = Array([], [])`.
    
    and if I run `dataset.select("features").show`, it fails
    ```
    java.lang.RuntimeException: Error while decoding: scala.MatchError: 31 (of class java.lang.Byte)
    createexternalrow(if (isnull(input[0, vector])) null else newInstance(class org.apache.spark.mllib.linalg.VectorUDT).deserialize,
StructField(features,org.apache.spark.mllib.linalg.VectorUDT@f71b0bce,true))
    +- if (isnull(input[0, vector])) null else newInstance(class org.apache.spark.mllib.linalg.VectorUDT).deserialize
       :- isnull(input[0, vector])
       :  +- input[0, vector]
       :- null
       +- newInstance(class org.apache.spark.mllib.linalg.VectorUDT).deserialize
          :- newInstance(class org.apache.spark.mllib.linalg.VectorUDT)
          +- input[0, vector]
    ```


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


Mime
View raw message