weka.classifiers.neural.common.WekaAlgorithmAncestor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wekaclassalgos Show documentation
Show all versions of wekaclassalgos Show documentation
Fork of the following defunct sourceforge.net project: https://sourceforge.net/projects/wekaclassalgos/
The newest version!
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package weka.classifiers.neural.common;
import weka.classifiers.AbstractClassifier;
import weka.classifiers.neural.common.learning.LearningKernelFactory;
import weka.classifiers.neural.common.training.NeuralTrainer;
import weka.classifiers.neural.common.training.TrainerFactory;
import weka.classifiers.neural.common.transfer.TransferFunctionFactory;
import weka.core.Capabilities;
import weka.core.Capabilities.Capability;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.Option;
import weka.core.WeightedInstancesHandler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
/**
* Title: Weka Neural Implementation
* Description: ...
* Copyright: Copyright (c) 2003
* Company: N/A
*
* @author Jason Brownlee
* @version 1.0
*/
public abstract class WekaAlgorithmAncestor extends AbstractClassifier
implements WeightedInstancesHandler {
private final static int PARAM_TRAINING_ITERATIONS = 0;
private final static int PARAM_LEARNING_RATE = 1;
private final static int PARAM_BIAS_CONSTANT = 2;
private final static int PARAM_RANDOM_SEED = 3;
// param flags
private final static String[] PARAMETERS =
{
"I", // iterations
"L", // learning rate
"B", // bias constant
"R" // random seed
};
// param flags
private final static String[] PARAMETER_NOTES =
{
"", // iterations
"", // learning rate
"", // bias constant
"" // random seed
};
// descriptions for all parameters
private final static String[] PARAM_DESCRIPTIONS =
{
"Number of training iterations (anywhere from a few hundred to a few thousand)",
"Learning Rate - between 0.05 and 0.75 (recommend 0.1 for most cases)",
"Bias constant input, (recommend 1.0, use 0.0 for no bias constant input)",
Constants.DESCRIPTION_RANDOM_SEED
};
// the model
protected NeuralModel model;
protected RandomWrapper rand;
// random number seed
protected long randomNumberSeed = 0;
// learning rate
protected double learningRate = 0.0;
// learning rate function
protected int learningRateFunction = 0;
// bias input constant
protected double biasInput = 0.0;
// transfer function
protected int transferFunction = 0;
// training mode
protected int trainingMode = 0;
// number of training iterations
protected int trainingIterations = 0;
// stats on the dataset used to build the model
protected int numInstances = 0;
protected int numClasses = 0;
protected int numAttributes = 0;
protected boolean classIsNominal = false;
public abstract String globalInfo();
protected abstract void validateArguments() throws Exception;
protected abstract NeuralModel prepareAlgorithm(Instances instances) throws Exception;
protected abstract Collection © 2015 - 2025 Weber Informatics LLC | Privacy Policy