Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-8479] [MLlib] Add numNonzeros and numActives to linalg.Matrices #6904

Closed
wants to merge 4 commits into from

Conversation

MechCoder
Copy link
Contributor

Matrices allow zeros to be stored in values. Sometimes a method is handy to check if the numNonZeros are same as number of Active values.

@SparkQA
Copy link

SparkQA commented Jun 19, 2015

Test build #35267 has finished for PR 6904 at commit b421696.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 19, 2015

Test build #35282 has finished for PR 6904 at commit d4741cf.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -176,6 +176,12 @@ object MimaExcludes {
ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.PostgresQuirks"),
ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.NoQuirks"),
ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.MySQLQuirks")
) ++ Seq(
// SPARK-8479 Add numNonzeros and numActives to Matrix.
ProblemFilters.exclude[MissingClassProblem](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be "MissingMethodProblem" instead?

@MechCoder
Copy link
Contributor Author

@mengxr Sorry about that. Btw, when is a foreach preferred as compared to a while loop.

@SparkQA
Copy link

SparkQA commented Jun 19, 2015

Test build #35286 has finished for PR 6904 at commit c0259fc.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 19, 2015

Test build #35291 has finished for PR 6904 at commit f3127f5.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@MechCoder
Copy link
Contributor Author

ping @srowen Could you please help me figure out the compatibility problems here? I've added it to the filters but it does not seem to work.

@@ -592,6 +614,19 @@ class SparseMatrix(
def toDense: DenseMatrix = {
new DenseMatrix(numRows, numCols, toArray)
}

override def numNonzeros: Int = {
var nnz = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this not be values.count(_ != 0)?

@srowen
Copy link
Member

srowen commented Jul 1, 2015

I think the failure is indeed because you're adding methods to a trait, but it's a sealed trait, so probably fine to override. I think you put it in the wrong place? it shoudl go under 1.5

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36277 has finished for PR 6904 at commit 71b951d.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36278 has finished for PR 6904 at commit e2390f5.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@MechCoder
Copy link
Contributor Author

Thanks for the comments but Vector is a sealed trait as well but that seems to work fine.

@mengxr
Copy link
Contributor

mengxr commented Jul 1, 2015

MiMa doesn't know it. So we still need to add the exclusion rules explicitly, otherwise it won't pass Jenkins.

@MechCoder
Copy link
Contributor Author

Have I done it correctly?

@SparkQA
Copy link

SparkQA commented Jul 1, 2015

Test build #36288 has finished for PR 6904 at commit 252c6b7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@asfgit asfgit closed this in 34d448d Jul 2, 2015
@mengxr
Copy link
Contributor

mengxr commented Jul 2, 2015

LGTM. Merged into master. Thanks!

@MechCoder MechCoder deleted the nnz_matrix branch July 3, 2015 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants