gpt4 book ai didi

java - 我如何在java代码中修改weka中的tfidf矩阵?

转载 作者:行者123 更新时间:2023-12-01 13:39:35 25 4
gpt4 key购买 nike

我想修改 stringtowordvector 过滤器输出 Weka 中的 tfidf 矩阵。我如何在java代码中访问这个矩阵?有什么方法可以改变它吗?

最佳答案

查看Stringtowordvector代码,方法convertInstancewoDocNorm我认为矩阵没有存储。

//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));
}
}
}

关于java - 我如何在java代码中修改weka中的tfidf矩阵?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20936306/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com