|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjml.data.Data
public class Data
All indices of docTermCountArray start from 1.
Constructor Summary | |
---|---|
Data()
|
Method Summary | |
---|---|
static org.apache.commons.math.linear.RealMatrix |
docTermCountArray2Matrix(java.util.ArrayList<java.util.TreeMap<java.lang.Integer,java.lang.Integer>> docTermCountArray)
|
static org.apache.commons.math.linear.RealMatrix |
loadDenseMatrix(java.lang.String dataMatrixFilePath)
Read a dense matrix from a text file. |
static org.apache.commons.math.linear.RealMatrix |
loadMatrix(java.lang.String dataMatrixFilePath)
Read a matrix from a text file. |
static org.apache.commons.math.linear.RealMatrix |
loadMatrixFromDocTermCountFile(java.lang.String docTermCountFilePath)
Load a RealMatrix from a doc-term-count file located at
String docTermCountFilePath. |
static org.apache.commons.math.linear.RealMatrix |
loadSparseMatrix(java.lang.String dataMatrixFilePath)
Load a RealMatrix from a text file located at String dataMatrixFilePath. |
static void |
main(java.lang.String[] args)
|
static org.apache.commons.math.linear.RealMatrix |
mapArray2Matrix(java.util.ArrayList<java.util.TreeMap<java.lang.Integer,java.lang.Double>> featureArray)
|
static void |
saveDenseMatrix(java.lang.String dataMatrixFilePath,
org.apache.commons.math.linear.RealMatrix A)
Write a dense matrix into a text file. |
static void |
saveMatrix(java.lang.String dataMatrixFilePath,
org.apache.commons.math.linear.RealMatrix A)
Write a matrix into a text file. |
static void |
saveSparseMatrix(java.lang.String dataMatrixFilePath,
org.apache.commons.math.linear.RealMatrix A)
Write a sparse matrix into a text file. |
static org.apache.commons.math.linear.RealMatrix |
TwoDimArray2Matrix(java.util.ArrayList<double[]> denseArr)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Data()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- public static void saveMatrix(java.lang.String dataMatrixFilePath, org.apache.commons.math.linear.RealMatrix A)
dataMatrixFilePath
- file path to write a matrix intoA
- a real matrixpublic static org.apache.commons.math.linear.RealMatrix loadMatrix(java.lang.String dataMatrixFilePath)
dataMatrixFilePath
- file path to read a matrix from
public static void saveSparseMatrix(java.lang.String dataMatrixFilePath, org.apache.commons.math.linear.RealMatrix A)
dataMatrixFilePath
- file path to write a sparse matrix intoA
- a sparse matrixpublic static org.apache.commons.math.linear.RealMatrix loadMatrixFromDocTermCountFile(java.lang.String docTermCountFilePath)
RealMatrix
from a doc-term-count file located at
String
docTermCountFilePath.
docTermCountFilePath
- a String
specifying the location of the doc-term-count
file holding matrix data. Each line is an entry with the format
(sampleID,[whitespace]featureID):[whitespace]value". sampleID
and featureID start from 1.
public static org.apache.commons.math.linear.RealMatrix loadSparseMatrix(java.lang.String dataMatrixFilePath)
RealMatrix
from a text file located at String
dataMatrixFilePath.
dataMatrixFilePath
- a String
specifying the location of the text file holding matrix data.
Each line is an entry with the format (without double quotes)
"(rowIdx,[whitespace]colIdx):[whitespace]value". rowIdx and colIdx
start from 1 as in MATLAB.
public static org.apache.commons.math.linear.RealMatrix mapArray2Matrix(java.util.ArrayList<java.util.TreeMap<java.lang.Integer,java.lang.Double>> featureArray)
public static void saveDenseMatrix(java.lang.String dataMatrixFilePath, org.apache.commons.math.linear.RealMatrix A)
dataMatrixFilePath
- file path to write a dense matrix intoA
- a dense matrixpublic static org.apache.commons.math.linear.RealMatrix loadDenseMatrix(java.lang.String dataMatrixFilePath)
dataMatrixFilePath
- file path to read a dense matrix from
public static org.apache.commons.math.linear.RealMatrix TwoDimArray2Matrix(java.util.ArrayList<double[]> denseArr)
public static org.apache.commons.math.linear.RealMatrix docTermCountArray2Matrix(java.util.ArrayList<java.util.TreeMap<java.lang.Integer,java.lang.Integer>> docTermCountArray)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |