Package com.heatonresearch.aifh.learning.score

Examples of com.heatonresearch.aifh.learning.score.ScoreFunction


            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);
            queryEquilateral(network, trainingData, species, 0, 1);

View Full Code Here


            final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 3);

            final RBFNetwork network = new RBFNetwork(4, 4, 3);
            network.reset(new MersenneTwisterGenerateRandom());

            final ScoreFunction score = new ScoreRegressionData(trainingData);
            final TrainAnneal train = new TrainAnneal(network, score);
            performIterations(train, 100000, 0.01, true);
            queryOneOfN(network, trainingData, species);
            System.out.println(Arrays.toString(network.getLongTermMemory()));
View Full Code Here

        }

        /**
         * Setup the scoring function.
         */
        ScoreFunction score = new ScoreTitanic(training);
        ScoreFunction scoreValidate = new ScoreTitanic(validation);

        /**
         * Setup particle swarm.
         */
        boolean done = false;
        TrainPSO train = new TrainPSO(particles, score);
        int iterationNumber = 0;
        StringBuilder line = new StringBuilder();

        do {
            iterationNumber++;

            train.iteration();

            RBFNetwork best = (RBFNetwork) train.getBestParticle();

            double trainingScore = train.getLastError();
            double validationScore = scoreValidate.calculateScore(best);

            if (validationScore > bestScore) {
                System.arraycopy(best.getLongTermMemory(), 0, this.bestNetwork.getLongTermMemory(), 0, best.getLongTermMemory().length);
                this.bestScore = validationScore;
            }
View Full Code Here

                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);

            performIterations(train, 100000, 0.05, true);
View Full Code Here

            RBFNetwork network = new RBFNetwork(4, 4, 3);

            final List<BasicData> trainingData = ds.extractSupervised(0, 4, 4, 3);

            ScoreFunction score = new ScoreRegressionData(trainingData);

            ContinuousACO train = new ContinuousACO(network, score, 30);

            performIterations(train, 100000, 0.05, true);
View Full Code Here

        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new IntegerArrayGenomeFactory(10));

        // Create a trainer with a very simple score function.  We do not care
        // about the calculation of the score, as they will never be calculated.
        EvolutionaryAlgorithm train = new BasicEA(pop, new ScoreFunction() {
            @Override
            public double calculateScore(MLMethod method) {
                return 0;
            }
View Full Code Here

        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new IntegerArrayGenomeFactory(10));

        // Create a trainer with a very simple score function.  We do not care
        // about the calculation of the score, as they will never be calculated.
        EvolutionaryAlgorithm train = new BasicEA(pop, new ScoreFunction() {
            @Override
            public double calculateScore(MLMethod method) {
                return 0;
            }
View Full Code Here

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a trainer with a very simple score function.  We do not care
        // about the calculation of the score, as they will never be calculated.
        // We only care that we are maximizing.
        EvolutionaryAlgorithm train = new BasicEA(pop, new ScoreFunction() {
            @Override
            public double calculateScore(MLMethod method) {
                return 0;
            }
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.learning.score.ScoreFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.