Examples of AIFHError


Examples of com.heatonresearch.aifh.AIFHError

            final FileInputStream fis = new FileInputStream(filename);
            final DataSet ds = load(fis);
            fis.close();
            return ds;
        } catch (IOException ex) {
            throw (new AIFHError(ex));
        }
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

            String[] nextLine;
            while ((nextLine = csv.readNext()) != null) {
                if (nextLine.length <= 1) {
                    continue;
                } else if (nextLine.length != result.getHeaderCount()) {
                    throw new AIFHError("Found a CSV line with "
                            + nextLine.length + " columns, when expecting " + result.getHeaderCount());
                }
                final Object[] obj = new Object[result.getHeaderCount()];
                System.arraycopy(nextLine, 0, obj, 0, nextLine.length);
                result.add(obj);
            }
            csv.close();
        } catch (IOException ex) {
            throw (new AIFHError(ex));
        }

        return result;
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

        try {
            final FileOutputStream fos = new FileOutputStream(filename);
            save(fos, ds);
            fos.close();
        } catch (IOException ex) {
            throw (new AIFHError(ex));
        }
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

                }
                csv.writeNext(items2);
            }
            csv.close();
        } catch (IOException ex) {
            throw new AIFHError(ex);
        }
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

     * @param low   The high value for the outputs.
     * @param high  The low value for the outputs.
     */
    public Equilateral(final int count, final double low, final double high) {
        if (count < MIN_EQ) {
            throw new AIFHError("Must have at least three classes.");
        }
        this.matrix = equilat(count, low, high);
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

     * @param set The set to determine the activations for.
     * @return The activations for the specified sets.
     */
    public final double[] encode(final int set) {
        if (set < 0 || set > this.matrix.length) {
            throw new AIFHError("Class out of range for equilateral: " + set);
        }
        return this.matrix[set];
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

     * @param theObservations The observations.
     * @return The number of dimensions.
     */
    private int findDimensions(final List<BasicData> theObservations) {
        if (theObservations.size() == 0) {
            throw new AIFHError("No observations provided to cluster, array zero length.");
        }

        if (theObservations.size() < this.k) {
            throw new AIFHError("There are fewer observations ("
                    + theObservations.size() + ") than k (" + this.k + ").");
        }

        final int dimensions = theObservations.get(0).getInput().length;

        if (dimensions == 0) {
            throw new AIFHError("Observations have no dimensions.");
        }

        return dimensions;
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

     *
     * @return True, if we are done, no new assignments.
     */
    public boolean iteration() {
        if (this.clusters.size() == 0) {
            throw new AIFHError("Must call one of the init methods first.");
        }

        final boolean done = assignmentStep();

        if (!done) {
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

        taskExecutor.shutdown();
        try {
            taskExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            throw new AIFHError(e);
        }
    }
View Full Code Here

Examples of com.heatonresearch.aifh.AIFHError

     */
    public void addSpeciesMember(final Species species, final Genome genome) {

        if (this.owner.isValidationMode()) {
            if (species.getMembers().contains(genome)) {
                throw new AIFHError("Species already contains genome: "
                        + genome.toString());
            }
        }

        if (this.owner.getSelectionComparator().compare(genome,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.