I am trying to convert instances that are read from arff file to dataset but
I could not because the dataset did not accept the type instances. The
following code is used
ArffLoader loader = new ArffLoader();
loader.setSource(new File("aldlon.arff"));
input_data = loader.getDataSet();
input_data.setClassIndex(input_data.numAttributes()-1);
String[] options = new String[2];
options[0] = "-R";
options[1] = AllBestfeatures;
Remove remove = new Remove();
remove.setOptions(options);
remove.setInvertSelection(new Boolean(true).booleanValue());
remove.setInputFormat(input_data);
Instances newData2 = Filter.useFilter(input_data, remove);
Dataset newdata1 = new DefaultDataset();
for (int i =0; i <newData2.numInstances(); ++i) {
// System.out.println("the training data " + newData2.instance(i));
newdata1.add(newData2.instance(i));
}
the error in the last line of the code in which the newdata1 did not accept
type of dataset.
any help please
--
Sent from:
https://weka.8497.n7.nabble.com/_______________________________________________
Wekalist mailing list --
[hidden email]
Send posts to: To unsubscribe send an email to
[hidden email]
To subscribe, unsubscribe, etc., visit
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nzList etiquette:
http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html