System.exit(1);
}
GenerateRandom rnd = new MersenneTwisterGenerateRandom();
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, -1, 1);
ds.normalizeRange(1, -1, 1);
ds.normalizeRange(2, -1, 1);
ds.normalizeRange(3, -1, 1);
final Map<String, Integer> species = ds.encodeOneOfN(4);
istream.close();
RBFNetwork[] particles = new RBFNetwork[PARTICLE_COUNT];
for (int i = 0; i < particles.length; i++) {
particles[i] = new RBFNetwork(4, 4, 3);
particles[i].reset(rnd);
}
final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 3);
ScoreFunction score = new ScoreRegressionData(trainingData);
TrainPSO train = new TrainPSO(particles, score);