All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.classifiers.neural.lvq.LvqAlgorithmAncestor Maven / Gradle / Ivy

Go to download

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.lvq;

import weka.classifiers.neural.common.Constants;
import weka.classifiers.neural.common.learning.LearningKernelFactory;
import weka.classifiers.neural.lvq.initialise.InitialisationFactory;
import weka.classifiers.neural.lvq.initialise.ModelInitialiser;
import weka.classifiers.neural.lvq.model.LvqModel;
import weka.core.Instances;
import weka.core.Option;
import weka.core.SelectedTag;
import weka.core.Utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;


/**
 * Description: Represents a common ancestor for specific LVQ algorithm
 * implementations. Provides common functionality shared between all LVQ
 * implementations. Provides a framwork to be implemented by specific LVQ
 * implementations for consistent validation, model construction and
 * instance classification.
 * 

*
* Copyright (c) Jason Brownlee 2004 *

* * @author Jason Brownlee */ public abstract class LvqAlgorithmAncestor extends AlgorithmAncestor { private final static int PARAM_INITIALISATION = 0; private final static int PARAM_CODEBOOK_VECTORS = 1; private final static int PARAM_TRAINING_ITERAITONS = 2; private final static int PARAM_LEARNING_FUNCTION = 3; private final static int PARAM_LEARNING_RATE = 4; private final static int PARAM_RANDOM_SEED = 5; private final static int PARAM_USE_VOTING = 6; private final static String[] PARAMETERS = { "M", // initialisation mode "C", // total codebook vectors "I", // training iterations "L", // learning function "R", // learning rate "S", // random number seed "G" // use voting }; private final static String[] PARAMETER_NOTES = { "", // initialisation mode "", // total codebook vectors "", // training iterations "", // learning function "", // learning rate "", // random number seed "" // use voting }; /** * Descriptions of common LVQ algorithm parameters */ private final static String[] PARAM_DESCRIPTIONS = { Constants.DESCRIPTION_INITIALISATION, Constants.DESCRIPTION_CODEBOOK_VECTORS, Constants.DESCRIPTION_TRAINING_ITERATIONS, Constants.DESCRIPTION_LEARNING_FUNCTION, Constants.DESCRIPTION_LEARNING_RATE, Constants.DESCRIPTION_RANDOM_SEED, Constants.DESCRIPTION_USE_VOTING }; protected int totalCodebookVectors; protected int trainingIterations; protected int learningFunction; protected double learningRate; public LvqAlgorithmAncestor() { // set default values totalCodebookVectors = 20; initialisationMode = InitialisationFactory.INITALISE_TRAINING_PROPORTIONAL; useVoting = false; seed = 1; trainingIterations = (totalCodebookVectors * 50); learningFunction = LearningKernelFactory.LEARNING_FUNCTION_LINEAR; learningRate = 0.3; } protected abstract Collection




© 2015 - 2025 Weber Informatics LLC | Privacy Policy