Package com.heatonresearch.aifh

Examples of com.heatonresearch.aifh.AIFHError


        } else {
            try {
                x = this.numberFormatter.parse(obj[column].toString()).doubleValue();
                obj[column] = x;
            } catch (ParseException e) {
                throw new AIFHError(e);
            }
        }

        return x;
    }
View Full Code Here


            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

            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

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

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

            case OPCODE_SQRT:
                return "sqrt";
            default:
                int index = opcode - OPCODE_VAR_CONST;
                if (index >= (this.constValues.length + varCount)) {
                    throw new AIFHError("Invalid opcode: " + opcode);
                }
                if (index < this.varCount) {
                    return "" + ((char) ('a' + index));
                } else {
                    return String.format(Locale.US, "%.8f", this.constValues[index - varCount]);
View Full Code Here

            case OPCODE_SQRT:
                return Math.sqrt(evaluate(node.getChildren().get(0), varValues));
            default:
                int index = node.getOpcode() - OPCODE_VAR_CONST;
                if (index >= (this.constValues.length + varCount)) {
                    throw new AIFHError("Invalid opcode: " + node.getOpcode());
                }
                if (index < this.varCount) {
                    return varValues[index];
                } else {
                    return this.constValues[index - this.varCount];
View Full Code Here

     * @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

     * @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

        } else {
            try {
                x = this.numberFormatter.parse(obj[column].toString()).doubleValue();
                obj[column] = x;
            } catch (ParseException e) {
                throw new AIFHError(e);
            }
        }

        return x;
    }
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.AIFHError

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.