Package com.heatonresearch.aifh.learning

Examples of com.heatonresearch.aifh.learning.RegressionAlgorithm


     */
    @Override
    public double calculateScore(final MLMethod algo) {
        ErrorCalculation ec = this.errorCalc.create();

        final RegressionAlgorithm ralgo = (RegressionAlgorithm) algo;
        final Genome genome = (Genome)ralgo;

        if( genome.size()>this.maxLength ) {
            return Double.POSITIVE_INFINITY;
        }

        // evaulate
        ec.clear();
        for (final BasicData pair : this.trainingData) {
            final double[] output = ralgo.computeRegression(pair.getInput());
            ec.updateError(output, pair.getIdeal(), 1.0);
        }

        return ec.calculate();
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    @Override
    public double calculateScore(final MachineLearningAlgorithm algo) {
        final RegressionAlgorithm ralgo = (RegressionAlgorithm) algo;
        // evaulate
        errorCalc.clear();
        for (final BasicData pair : this.trainingData) {
            final double[] output = ralgo.computeRegression(pair.getInput());
            errorCalc.updateError(output, pair.getIdeal(), 1.0);
        }

        return errorCalc.calculate();
    }
View Full Code Here

    @Override
    public double calculateScore(final MLMethod algo) {
        int incorrectCount = 0;
        int totalCount = 0;

        final RegressionAlgorithm alg = (RegressionAlgorithm) algo;

        for (final BasicData aTrainingData : this.trainingData) {
            totalCount++;
            boolean predictSurvive = alg.computeRegression(aTrainingData.getInput())[0] > 0.5;
            boolean idealSurvive = aTrainingData.getIdeal()[0] > 0.5;

            if (predictSurvive == idealSurvive) {
                incorrectCount++;
            }
View Full Code Here

     */
    @Override
    public double calculateScore(final MLMethod algo) {
        ErrorCalculation ec = this.errorCalc.create();

        final RegressionAlgorithm ralgo = (RegressionAlgorithm) algo;
        // evaulate
        ec.clear();
        for (final BasicData pair : this.trainingData) {
            final double[] output = ralgo.computeRegression(pair.getInput());
            ec.updateError(output, pair.getIdeal(), 1.0);
        }

        return ec.calculate();
    }
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.learning.RegressionAlgorithm

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.