Examples of AIFHError


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

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

            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

Examples of com.heatonresearch.aifh.AIFHError

            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

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

        } 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
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.