Package com.heatonresearch.aifh.randomize

Examples of com.heatonresearch.aifh.randomize.GenerateRandom


     */
    public static void mutateShuffle() {
        System.out.println("Mutate shuffle");

        // Create a random number generator
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a new population.
        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new IntegerArrayGenomeFactory(5));

View Full Code Here


     * gene.
     */
    public static void mutatePeterb() {
        System.out.println("Mutate Perturb");

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a new population.
        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new DoubleArrayGenomeFactory(5));

View Full Code Here

            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);
            }
            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);
View Full Code Here

            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);
            }
            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);
View Full Code Here

        final DataSet ds = DataSet.load(istream);
        // Extract supervised training.
        List<BasicData> training = ds.extractSupervised(0, 1, 1, 1);


        GenerateRandom rnd = new MersenneTwisterGenerateRandom();
        EvaluateExpression eval = new EvaluateExpression(rnd);
        Population pop = initPopulation(rnd, eval);
        ScoreFunction score = new ScoreSmallExpression(training,30);

        EvolutionaryAlgorithm genetic = new BasicEA(pop, score);
View Full Code Here

     * @param high    The high value.
     * @param distort The distortion factor.
     * @return The data set.
     */
    public DataHolder generate(final int seed, final int rows, final int cols, final double low, final double high, final double distort) {
        final GenerateRandom rnd = new MersenneTwisterGenerateRandom(seed);

        final double[][] ideal = new double[rows][cols];
        final double[][] actual = new double[rows][cols];

        for (int row = 0; row < rows; row++) {
            for (int col = 0; col < cols; col++) {
                ideal[row][col] = rnd.nextDouble(low, high);
                actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);
            }
        }

        final DataHolder result = new DataHolder();
        result.setActual(actual);
View Full Code Here

        // Get the training and cross validation sets.
        List<BasicData> training = fold.getTrainingSet();
        List<BasicData> validation = fold.getValidationSet();

        // Create random particles for the RBF.
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();
        RBFNetwork[] particles = new RBFNetwork[TitanicConfig.ParticleCount];
        for (int i = 0; i < particles.length; i++) {
            particles[i] = new RBFNetwork(TitanicConfig.InputFeatureCount, TitanicConfig.RBF_COUNT, 1);
            particles[i].reset(rnd);
        }
View Full Code Here

     */
    public void process(File dataPath) {
        File trainingPath = new File(dataPath, TitanicConfig.TrainingFilename);
        File testPath = new File(dataPath, TitanicConfig.TestFilename);

        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        try {

            // Generate stats on the titanic.
            TitanicStats stats = new TitanicStats();
View Full Code Here

            if (istream == null) {
                System.out.println("Cannot access data set, make sure the resources are available.");
                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);
View Full Code Here

     */
    public static void splice() {
        System.out.println("Crossover Splice");

        // Create a random number generator
        GenerateRandom rnd = new MersenneTwisterGenerateRandom();

        // Create a new population.
        Population pop = new BasicPopulation();
        pop.setGenomeFactory(new IntegerArrayGenomeFactory(10));

View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.randomize.GenerateRandom

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.