Graphics Reference
In-Depth Information
}
public void readClassificationSet(String datasetFile,
boolean train) throws IOException {
try IS.readSet(datasetFile, train);
nData = IS.getNumInstances();
nInputs = Attributes.getInputNumAttributes();
nVars = nInputs + Attributes.getOutputNumAttributes();
...
}
}
4. Algorithm : This class is devoted to storing the main variables of the algorithm
and naming the different procedures for the learning stage. It also contains the
functions for writing the obligatory output files.
public class Algorithm {
myDataset train, val, test;
String outputTr, outputTst;
private boolean somethingWrong = false;
public Algorithm(parseParameters parameters) {
train = new myDataset();
val = new myDataset();
test = new myDataset();
try { System.out.println(" \ nReading the training set:" +
parameters.getTrainingInputFile());
train.readClassificationSet(parameters.getTrainingInputFile(),
true);
System.out.println(" \ nReading the validation set:" +
parameters.getValidationInputFile());
val.readClassificationSet(parameters.getValidationInputFile(),
false);
System.out.println(" \ nReading the test set:" +
parameters.getTestInputFile());
test.readClassificationSet(parameters.getTestInputFile(),
false);
} catch (IOException e) {
System.err.println("There was a problem while reading
the input data sets:" + e);
somethingWrong = true;
}
outputTr = parameters.getTrainingOutputFile();
...
}
}
The template can be downloaded by clicking on the link http://www.keel.es/
software/KEEL_template.zip , which additionally supplies the user with the whole
API data set together with the classes for managing files and the random number
generator.
Most of the functions of the classes presented above are self-explanatory and
fully documented to help the developer understand their use. Nevertheless, in the
Search WWH ::




Custom Search