Train and test suite not compatible with weka bug?

I am trying to test my model with a new dataset. I took the same preprocessing step as for building my model. I compared two files, but no problem. I have all the attributes (train vs test dataset) in the same order, the same attribute names and data types. But still I can not solve the problem. Both files are trained and tested, it seems to be similar, but the weka researcher gives me an error saying that Train and the test suite are incompatible. How to resolve this error? Is there a way to make the test.arff file as train.arff? Please help me.

Here is the screenshot for file comparision

+7
machine-learning weka arff
source share
4 answers

Same thing with the comment I left after the problem statement:

All three attributes are nominal attributes, followed by all possible values ​​specified in '{}'. One of my assumptions is that the possible values ​​do not match. For example, for the RESOURCE attribute in the test file there is no 199, and in the training file -.

+6
source share

After struggling with the same problem during the day. I figured out two ways to make the trained model work with the installed test suite.

Method 1. Use the flow of knowledge. For example, something like below: CSVLoader (for a set of trains) β†’ classAssigner β†’ TrainingSetMaker β†’ (classifier of your choice) β†’ ClassfierPerformanceEvaluator - TextViewer. CSVLoader (for test suite) -> classAssigner -> TestgSetMaker -> (same class instance above) -> PredictionAppender -> CSVSaver. Then load data from CSVLoader or arffLoder for a set of workouts. The model will be trained. After that, data is loaded from the bootloader for the test suite. It will evaluate the model (for example, the classifier) ​​on the supplied test suite, and you can see the result from a text editor (connected to the ClassifierPerformanceEvaluator) and get the saved result from CSVSaver or arffSaver connected to the additional PredictionAppender column. "classfied as" will be added to the output file. In my case, I used "?" for the class column in the supplied test case, if class labels are not available.

Method 2. Combine the training and testing kit into one file. Then the same filter can be applied to both training and test sets. You can then separate the training set and test set by applying an instance filter. So how do I use "?" as a class label in a test case. It does not appear in instance filter indexes. Therefore, simply select the indexes that you can see in the attribute values ​​that you want to remove when applying the instance filter. You will receive only test data. Save it and load it into the test delivery kit on the classifier page. At this time, he will work. I think this is an attribute of a class that causes a non-compatible ride and test suite. Since many classfier requires a nominal class attribute. The value of which is converted into an index into the accessible values ​​of the class attribute according to http://weka.wikispaces.com/Why+do+I+get+the+error+message+%27training+and+test+set+are+not+compatible%27 % 3F

+3
source share

See the following answer , your train.arff and test.arff should have the same header. According to your comparison, they are similar but not the same.

+2
source share

See if there is a difference between similar and identical, your train.arrf and test.arrf should have the same heading, and if not, then you should copy the train.arrf heading and paste it into your test.arrf as a new heading.

0
source share

All Articles