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

    https://github.com/apache/spark/pull/1778#discussion_r17579690
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/linalg/distributed/RowMatrixSuite.scala
 ---
    @@ -95,6 +95,33 @@ class RowMatrixSuite extends FunSuite with 
LocalSparkContext {
         }
       }
     
    +  test("similar columns") {
    +    val colMags = Vectors.dense(Math.sqrt(126), Math.sqrt(66), 
Math.sqrt(94))
    +    val expected = BDM(
    +          (126.0, 54.0, 72.0),
    +          (54.0, 66.0, 78.0),
    +          (72.0, 78.0, 94.0))
    +
    +    for(i <- 0 until n) for(j <- 0 until n) {
    +      expected(i, j) /= (colMags(i) * colMags(j))
    +    }
    +
    +    for (mat <- Seq(denseMat, sparseMat)) {
    +      val G = mat.similarColumns(150.0)
    +      assert(closeToZero(G.toBreeze() - expected))
    +    }
    +
    +    for (mat <- Seq(denseMat, sparseMat)) {
    +      val G = mat.similarColumns()
    +      assert(closeToZero(G.toBreeze() - expected))
    +    }
    +
    +    for (mat <- Seq(denseMat, sparseMat)) {
    +      val G = mat.similarColumnsDIMSUM(colMags.toArray, 150.0)
    +      assert(closeToZero(G.toBreeze() - expected))
    +    }
    +  }
    +
    --- End diff --
    
    Does the test output only a subset of column pairs?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to