Re: Generating training and test sets with supervised resample filter
2) The problem in your code is that the second time you apply useFilter() on the same
Resample object without applying setInputFormat() again to reinitialise the filter, it will simply pass through the data without modification. By design, the Resample filter will only modify the first batch of data it receives. This is so that the FilteredClassifier works correctly when applying this filter with it: we do not want the test data to be modified.
Try reinitialising the filter by calling setInputFormat() again before you apply useFilter() the second time. Alternatively, just create a new Resample filter object from scratch for the second application of useFilter.