-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-4409][MLlib] Additional Linear Algebra Utils #3319
Conversation
Test build #23485 has started for PR 3319 at commit
|
Test build #23485 has finished for PR 3319 at commit
|
Test FAILed. |
Test build #23492 has started for PR 3319 at commit
|
Test build #23492 has finished for PR 3319 at commit
|
Test PASSed. |
@brkyvz Two comments on the API:
|
Test build #23863 has started for PR 3319 at commit
|
@mengxr: |
Test build #23863 has finished for PR 3319 at commit
|
Test PASSed. |
Test build #23900 has started for PR 3319 at commit
|
Test build #23900 has finished for PR 3319 at commit
|
Test PASSed. |
@brkyvz I didn't know MATLAB has If we want to use MATLAB operators, maybe we should also stick to lowercase method names. |
I checked MATLAB's webpage, I didn't see any copyright mentions for the method names. It's best to triple check though. Since numPy and sciPy share method names with MATLAB, I don't expect there to be problems. |
import breeze.linalg.{Matrix => BM, DenseMatrix => BDM, CSCMatrix => BSM} | ||
|
||
import java.util.{Random, Arrays} | ||
import scala.collection.mutable.ArrayBuffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
organize imports
} | ||
j += 1 | ||
} | ||
while (numCols > lastCol) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not necessary. At the end of the while (j < numCols)
loop, j = numCols + 1
. So it is colPtrs(j) = nnz
.
Test build #24668 has started for PR 3319 at commit
|
Test build #24668 has finished for PR 3319 at commit
|
Test PASSed. |
Some updates for linear algebra utilities
Test build #24774 has started for PR 3319 at commit
|
Test build #24775 has started for PR 3319 at commit
|
Test build #24774 has finished for PR 3319 at commit
|
Test FAILed. |
Test build #24775 has finished for PR 3319 at commit
|
Test PASSed. |
LGTM. Merged into master. Thanks!! |
Addition of a very limited number of local matrix manipulation and generation methods that would be helpful in the further development for algorithms on top of BlockMatrix (SPARK-3974), such as Randomized SVD, and Multi Model Training (SPARK-1486).
The proposed methods for addition are:
For
Matrix
Factory methods for
DenseMatrix
:*These methods already exist in the factory methods for
Matrices
, however for cases where we require aDenseMatrix
, you constantly have to add.asInstanceOf[DenseMatrix]
everywhere, which makes the code "dirtier". I propose moving these functions to factory methods forDenseMatrix
where the putput will be aDenseMatrix
and the factory methods forMatrices
will call these functions directly and output a genericMatrix
.Factory methods for
SparseMatrix
:Factory methods for
Matrices
:Matrix
rather thanSparseMatrix
orDenseMatrix
.The names for these methods were selected from MATLAB