final InputStream istream = this.getClass().getResourceAsStream("/iris.csv");
if( istream==null ) {
System.out.println("Cannot access data set, make sure the resources are available.");
System.exit(1);
}
final DataSet ds = DataSet.load(istream);
// The following ranges are setup for the Iris data set. If you wish to normalize other files you will
// need to modify the below function calls other files.
ds.normalizeRange(0, 0, 1);
ds.normalizeRange(1, 0, 1);
ds.normalizeRange(2, 0, 1);
ds.normalizeRange(3, 0, 1);
final Map<String, Integer> species = ds.encodeEquilateral(4);
istream.close();
final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 2);
final RBFNetwork network = new RBFNetwork(4, 4, 2);
final ScoreFunction score = new ScoreRegressionData(trainingData);
final TrainGreedyRandom train = new TrainGreedyRandom(true, network, score);
performIterations(train, 100000, 0.01, true);