public class SimplePerceptron extends Object implements OnlineLearner<double[],Integer>, EstimatableModel<double[],Integer>
Constructor and Description |
---|
SimplePerceptron() |
Modifier and Type | Method and Description |
---|---|
protected double |
calculateError(List<? extends IndependentPair<double[],Integer>> pts) |
SimplePerceptron |
clone()
Clone the model
|
double[] |
computeHyperplanePoint(double[] x)
Compute NaN-coordinate of a point on the hyperplane given
non-NaN-coordinates.
|
boolean |
estimate(List<? extends IndependentPair<double[],Integer>> data)
Estimates the model from the observations in the list of data.
|
double[] |
getWeights() |
int |
numItemsToEstimate() |
Integer |
predict(double[] x)
Uses the model to predict dependent data from an independent value.
|
void |
process(double[] pt,
Integer clazz) |
public SimplePerceptron()
public void process(double[] pt, Integer clazz)
process
in interface OnlineLearner<double[],Integer>
public Integer predict(double[] x)
Model
public boolean estimate(List<? extends IndependentPair<double[],Integer>> data)
EstimatableModel
EstimatableModel.numItemsToEstimate()
pairs of dependent
and independent data. It may contain more, in which case the estimate
method may choose to make use of this data for validation, or obtaining a
better model by a least squares method for example.estimate
in interface EstimatableModel<double[],Integer>
data
- Data with which to estimate the modelEstimatableModel.numItemsToEstimate()
public int numItemsToEstimate()
numItemsToEstimate
in interface EstimatableModel<double[],Integer>
protected double calculateError(List<? extends IndependentPair<double[],Integer>> pts)
public double[] computeHyperplanePoint(double[] x)
x
- the coordinates, only one may be NaN, all others must be
providedpublic SimplePerceptron clone()
EstimatableModel
clone
in interface EstimatableModel<double[],Integer>
clone
in class Object
public double[] getWeights()