Package com.heatonresearch.aifh.error

Examples of com.heatonresearch.aifh.error.ErrorCalculation


    /**
     * {@inheritDoc}
     */
    @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


    @Test
    public void testGeneral() {
        final List<BasicData> training = BasicData.convertArrays(TEST_INPUT, TEST_IDEAL);
        final ScoreRegressionData score = new ScoreRegressionData(training);
        final ErrorCalculation ec = new ErrorCalculationSSE();
        score.setErrorCalc(ec);
        assertEquals(ec, score.getErrorCalc());
    }
View Full Code Here

     */
    public void process() {

        final NumberFormat nf = NumberFormat.getInstance();

        final ErrorCalculation calcESS = new ErrorCalculationSSE();
        final ErrorCalculation calcMSE = new ErrorCalculationMSE();
        final ErrorCalculation calcRMS = new ErrorCalculationRMS();

        final DataHolder smallErrors = generate(SEED, ROWS, COLS, LOW, HIGH, 0.1);
        final DataHolder mediumErrors = generate(SEED, ROWS, COLS, LOW, HIGH, 0.5);
        final DataHolder largeErrors = generate(SEED, ROWS, COLS, LOW, HIGH, 1.0);
        final DataHolder hugeErrors = generate(SEED, ROWS, COLS, LOW, HIGH, 10.0);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @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.error.ErrorCalculation

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.