how to add instances data into test arff file with the same attribute and relation with training file I have training arff file, and also I have instances data at hand. Now I want to add the instances data onto another file, called test file, and this test file has the same relation header and attribute with previous training file. How to realize that?
 A: If you use R, you can read the training and testing sets into a single data.frame, and then rewrite the training and testing arff files from the single data.frame.  Since the data.frame stores the possible factor levels common between the training and testing set, all possible values will show up in the header of both arff files.  See the code below for an example.  Here, I assume you have the current training and testing sets saved as "trainingInput.arff" and "testingInput.arff", which have 1000 and 2000 instances respectively.  This will generate "trainingOutput.arff" and "testingOutput.arff" which will agree with each other in terms of possible factor values.
# install and load the foreign package
library(foreign)

# read in your training data -- assume we have 1000 instances here
train = read.arff("trainingInput.arff")

# read in your testing data -- assume we have 2000 instances here
test = read.arff("testingInput.arff")

# combine training and testing into single data.frame
combined = rbind(train, test)

# then nrow(train) == 1000 and nrow(test) == 2000 and nrow(combined) == 3000

# write the new training and testing sets from the combined dataset
write.arff(combined[1:1000,], "trainingOutput.arff")
write.arff(combined[1001:3000,], "trainingOutput.arff")

I hope this helps.
