我想将实例重新采样到统一的类分布。为此,我使用以下代码。
import weka.core.Instances;
import weka.filters.supervised.instance.*;
...
String Fliteroptions="-B 1.0";
sampler.setOptions(weka.core.Utils.splitOptions(Fliteroptions));
sampler.setRandomSeed((int)System.currentTimeMillis());
data = // ... Instances leaded from ARFF file ...
data = Resample.useFilter(data, sampler);
但得到以下错误:
Zero Weights processed. Default weights will be used
java.lang.IllegalStateException: No input instance format defined
at weka.filters.supervised.instance.Resample.input(Resample.java:443)
at weka.filters.Filter.useFilter(Filter.java:655)
at WekaClassify.main(WekaClassify.java:84)
有没有人知道这里发生了什么,我怎样才能让它工作?