Hello,
I am trying to integrate into a new node"singular value decomposition" KNIME, but I have a problem.
I have not figured out how to get in execute (), the value of the input column in order to apply the SVD
here is my source code
if (columnSpec.getType().isCompatible(DoubleValue.class)) {
// found one numeric column
c++;
}
}
double[][] vals= new double[inData[INPORT].getRowCount()][c];
for (DataRow currRow : inData[INPORT]) {
for (int i = 0; i < inData[INPORT].getRowCount(); i++) {
for (int j = 0; j < c; j++)
{ // here i want to get the input value , the value of this cell
vals[i][j]=;
}
}
}
Matrix A = new Matrix(vals);
SingularValueDecomposition S = new SingularValueDecomposition(A);
double[][] U= S.getU().getArray();
double[][] V= S.getV().getArray();
double[] SD=S.getSingularValues();
i want to fill vals[i][j] with the cell(i), the cell of input data table.
if (columnSpec.getType().isCompatible(DoubleValue.class)) {
// found one numeric column
c++;
}
}
double[][] vals= new double[inData[INPORT].getRowCount()][c];
for (DataRow currRow : inData[INPORT]) {
for (int i = 0; i < inData[INPORT].getRowCount(); i++) {
for (int j = 0; j < c; j++)
{ double currValue = ((DoubleValue) currRow.getCell(j)).getDoubleValue();
vals[i][j]= i*j;
}
}
}
Matrix A = new Matrix(vals);
SingularValueDecomposition S = new SingularValueDecomposition(A);
double[][] U= S.getU().getArray();
double[][] V= S.getV().getArray();
double[] SD=S.getSingularValues();
if (columnSpec.getType().isCompatible(DoubleValue.class)) {
// found one numeric column
c++;
}
}
double[][] vals= new double[inData[INPORT].getRowCount()][c];
for (DataRow currRow : inData[INPORT]) {
for (int i = 0; i < inData[INPORT].getRowCount(); i++) {
for (int j = 0; j < c; j++)
{ double currValue = ((DoubleValue) currRow.getCell(j)).getDoubleValue();
vals[i][j]= i*j;
}
}
}
Matrix A = new Matrix(vals);
SingularValueDecomposition S = new SingularValueDecomposition(A);
double[][] U= S.getU().getArray();
double[][] V= S.getV().getArray();
double[] SD=S.getSingularValues();