User login

question regarding the development of a new node

3 posts / 0 new
Last post
kamna
Offline
Joined: 05/05/2012
question regarding the development of a new node

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();

kamna
Offline
Joined: 05/05/2012

how i can give the content of the current column?

kamna
Offline
Joined: 05/05/2012

I have  find the solution

 

int h=0;

        for (DataRow currRow : inData[INPORT]) {

        for (int j = 0; j < 4; j++) {

       {if (inData[INPORT].getDataTableSpec().getColumnSpec(j).getType().isCompatible(DoubleValue.class)) { double currValue = ((DoubleValue) currRow.getCell(j)).getDoubleValue();

      Ary[h][j]= new  Z(currValue);

      test=currValue;

       }

       }

     

      }h++;

        }

 

   int h=0;

        for (DataRow currRow : inData[INPORT]) {

        for (int j = 0; j < 4; j++) {

       {if (inData[INPORT].getDataTableSpec().getColumnSpec(j).getType().isCompatible(DoubleValue.class)) { double currValue = ((DoubleValue) currRow.getCell(j)).getDoubleValue();

      Ary[h][j]= new  Z(currValue);

      test=currValue;

       }

       }

     

      }h++;

        }