[Java-ML-support] Read MCL result from SparseMatrix representation
Status: Beta
Brought to you by:
thomasabeel
From: Chris C. <chr...@ya...> - 2012-08-22 21:47:30
|
Dear all, I am investigating java-ml for its Markov CLustering implementation. In my current project, I have a in-memory model of 2D adjency matrix (a two-dimensional array of the double primitive type : double[][]). Note that this matrix is sparse in the sense that it is triangular superior (I am using a symetric distance, hence I don't fill the inferior triangle of my 2D matrix). Fortunately, I can convert it into a SparseMatrix using the associated constructor and then run the MCL algorithm. The code fragment from my program is as follows. double[][] adjencyMatrix; // omitted operations to fill adjencyMatrix SparseMatrix smatrix = new SparseMatrix(adjencyMatrix); MarkovClustering mcl = new MarkovClustering(); double maxResidual = 0.001; double gammaExp = 2.0; double loopGain = 0.; double zeroMax = 0.001; SparseMatrix matrix = mcl.run(smatrix, maxResidual, gammaExp, loopGain, zeroMax); From this point, I understand that "matrix" helds a "sparse matrix with row-major format" of my results, that is, a compressed version of the traditional 2D matrix resulting from MCL. I am able to read the MCL results from a traditional 2D data structure, yet I don't know to grasp how to unveil clusters from the resulting SparseMatrix. I have been unable to find the proper documentation to understand the SparseMatrix data structure used in java-ml. Can you point me to the paper or documentation that you may have used to create the data structure ? If no, is it possible to convert a SparseMatrix into a double[][] (which I suspect to be performance killing) ? Thanks you in advance for any help ! Best Regards, Chris |