0

I want to modify tfidf matrix in stringtowordvector filter's output Weka . how can i access to this matrix in java code ?is there any way to change it?

MSepehr
  • 890
  • 2
  • 13
  • 36

1 Answers1

1

Look into Stringtowordvector code, method convertInstancewoDocNorm i think that matrix is not stored.

//Doing IDFTransform
    if(m_IDFTransform==true) {
      Iterator it = contained.keySet().iterator();
      for(int i=0; it.hasNext(); i++) {
        Integer index = (Integer)it.next();
        if( index.intValue() >= firstCopy ) {
          double val = ((Double)contained.get(index)).doubleValue();
          val = val*Math.log( m_NumInstances /
            (double) m_DocsCounts[index.intValue()] );
          contained.put(index, new Double(val));
        }
      }        
    }
Krystian Lieber
  • 481
  • 3
  • 10