使用已保存模型 Weka 的过滤分类器进行属性选择
Attribute selection with Filtered classifier for saved model Weka
我在 Weka 中使用属性选择在 FilteredClassifier 上训练了我的模型。现在,我无法使用序列化模型进行测试数据class化,我搜索了很多但确实无法弄清楚。这就是我现在正在做的事情:
java -cp $CLASSPATH weka.filters.supervised.attribute.AddClassification\
-serialized Working.model \
-classification \
-remove-old-class \
-i full_data.arff \
-c last
它给我一个错误说
weka.core.WekaException: Training header of classifier and filter dataset don't match
但他们不应该对吗?由于测试数据不应该在 header 中包含 class。我应该如何使用它?另外希望选中的属性序列化保存在模型中,因为测试数据也需要做同样的属性选择。
我不喜欢使用 Batch classifier,因为它破坏了保存模型的功能,并且每次都需要我 运行 整个训练。
让它工作的一个简单方法是将名义 class 添加到您使用随机 class 和虚拟值创建的 ARFF 文件中,然后使用 -remove- 删除它旧-class 选项。
因此您的命令将保持不变,但您的 ARFF 文件这次将具有 class。
我在 Weka 中使用属性选择在 FilteredClassifier 上训练了我的模型。现在,我无法使用序列化模型进行测试数据class化,我搜索了很多但确实无法弄清楚。这就是我现在正在做的事情:
java -cp $CLASSPATH weka.filters.supervised.attribute.AddClassification\
-serialized Working.model \
-classification \
-remove-old-class \
-i full_data.arff \
-c last
它给我一个错误说
weka.core.WekaException: Training header of classifier and filter dataset don't match
但他们不应该对吗?由于测试数据不应该在 header 中包含 class。我应该如何使用它?另外希望选中的属性序列化保存在模型中,因为测试数据也需要做同样的属性选择。
我不喜欢使用 Batch classifier,因为它破坏了保存模型的功能,并且每次都需要我 运行 整个训练。
让它工作的一个简单方法是将名义 class 添加到您使用随机 class 和虚拟值创建的 ARFF 文件中,然后使用 -remove- 删除它旧-class 选项。
因此您的命令将保持不变,但您的 ARFF 文件这次将具有 class。