是的。这篇文章对此进行了介绍:
https://list.waikato.ac.nz/pipermail/wekalist/2009-April/043232.html
这也涵盖了您想要追加两个文件(添加实例)的情况。
这是在 Weka 命令行界面 (CLI) 中完成的。
一个技巧是似乎有一个行长限制,所以将你的文件移动到默认目录(这似乎是 Program Files/Weka-3-8),这样你就不会遇到长路径的问题。
假设我们的文件“merge A.arff”由
组成
@relation 'merge A'
@attribute UserID numeric
@attribute A1 {Joe,Bill,Larry}
@attribute A2 numeric
@attribute Aclass {pos,neg}
@data
1,Joe,17,pos
3,Joe,42,neg
5,Bill,8,neg
7,Larry,4,neg
和文件“merge B.arff”组成
@relation 'merge B'
@attribute BUserID numeric
@attribute Blong numeric
@attribute Blat numeric
@data
1,-180,42
3,-182,45
5,-179,36
7,-184,38
如果您打开 CLI 并在 > 提示符后键入以下内容
java weka.core.Instances merge "merge A.arff" "merge B.arff"
以下内容将转储到控制台:
@relation 'merge A_merge B'
@attribute UserID numeric
@attribute A1 {Joe,Bill,Larry}
@attribute A2 numeric
@attribute Aclass {pos,neg}
@attribute BUserID numeric
@attribute Blong numeric
@attribute Blat numeric
@data
1,Joe,17,pos,1,-180,42
3,Joe,42,neg,3,-182,45
5,Bill,8,neg,5,-179,36
7,Larry,4,neg,7,-184,38
由于某种原因,我无法将其直接传送到另一个文件,例如
java weka.core.Instances merge "merge A.arff" "merge B.arff" > "output.arff"
要么它没有创建文件,要么我找不到它在哪里创建它。但一次一个问题!