public class SOM extends Object implements Classifier, Parameterized
Modifier and Type | Field and Description |
---|---|
static KernelFunction |
DEFAULT_KF |
static DecayRate |
DEFAULT_LEARNING_DECAY |
static double |
DEFAULT_LEARNING_RATE |
static int |
DEFAULT_MAX_ITERS |
static DecayRate |
DEFAULT_NEIGHBOR_DECAY |
Constructor and Description |
---|
SOM(DistanceMetric dm,
int somHeight,
int somWeight)
Creates a new SOM using the given parameters
|
SOM(DistanceMetric dm,
int somHeight,
int somWeight,
VectorCollectionFactory<VecPaired<Vec,Integer>> vcFactory)
Creates a new SOM using the given parameters
|
SOM(int somHeight,
int somWeight)
Creates a new SOM using the given parameters using the
EuclideanDistance |
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
SOM |
clone() |
double |
getInitialLearningRate()
Returns the rate at which input is incorporated at each iteration of the SOM
|
DecayRate |
getLearningDecay()
The rate the SOM learns decays over each iteration, and this defines the
way in which the rate decays.
|
int |
getMaxIterations()
Returns the maximum number of iterations that will be used to converge
|
DecayRate |
getNeighborDecay()
The range of effect each data point has decays with each iteration, and
this defines the way in which the rate decays.
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
int |
getSomHeight()
Returns the height of the SOM lattice to create
|
int |
getSomWidth()
Returns the width of the SOM lattice to create
|
void |
setInitialLearningRate(double initialLearningRate)
Sets the rate at which input is incorporated at each iteration of the SOM
algorithm
|
void |
setLearningDecay(DecayRate learningDecay)
The rate the SOM learns decays over each iteration, and this defines the
way in which the rate decays.
|
void |
setMaxIterations(int maxIters)
Sets the maximum number of iterations that will be used to converge
|
void |
setNeighborDecay(DecayRate neighborDecay)
The range of effect each data point has decays with each iteration, and
this defines the way in which the rate decays.
|
void |
setSomHeight(int somHeight)
Sets the height of the SOM lattice to create
|
void |
setSomWidth(int somWidth)
Sets the width of the SOM lattice to create
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
trainC(ClassificationDataSet dataSet)
Trains the classifier and constructs a model for classification using the
given data set.
|
void |
trainC(ClassificationDataSet dataSet,
ExecutorService threadPool)
Trains the classifier and constructs a model for classification using the
given data set.
|
public static final int DEFAULT_MAX_ITERS
public static final KernelFunction DEFAULT_KF
public static final double DEFAULT_LEARNING_RATE
public static final DecayRate DEFAULT_LEARNING_DECAY
public static final DecayRate DEFAULT_NEIGHBOR_DECAY
public SOM(int somHeight, int somWeight)
EuclideanDistance
somHeight
- the height of the SOM latticesomWeight
- the weight of the SOM latticepublic SOM(DistanceMetric dm, int somHeight, int somWeight)
dm
- the distance metric to use when comparing pointssomHeight
- the height of the SOM latticesomWeight
- the weight of the SOM latticepublic SOM(DistanceMetric dm, int somHeight, int somWeight, VectorCollectionFactory<VecPaired<Vec,Integer>> vcFactory)
dm
- the distance metric to use when comparing pointssomHeight
- the height of the SOM latticesomWeight
- the weight of the SOM latticevcFactory
- the vector collection factory to use for containing pointspublic void setMaxIterations(int maxIters)
maxIters
- the max iterations of the algorithmpublic int getMaxIterations()
public void setSomWidth(int somWidth)
somWidth
- the width of the latticepublic void setSomHeight(int somHeight)
somHeight
- the height of the latticepublic int getSomHeight()
public int getSomWidth()
public void setInitialLearningRate(double initialLearningRate)
initialLearningRate
- the rate the SOM learns atpublic double getInitialLearningRate()
public void setLearningDecay(DecayRate learningDecay)
learningDecay
- the decay for the learning ratepublic DecayRate getLearningDecay()
public void setNeighborDecay(DecayRate neighborDecay)
neighborDecay
- the decay for the neighbor range.public DecayRate getNeighborDecay()
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainpublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.public void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public SOM clone()
clone
in interface Classifier
clone
in class Object
Copyright © 2017. All rights reserved.