public class SimplePerceptron extends Object implements OnlineLearner<double[],Integer>, org.openimaj.math.model.EstimatableModel<double[],Integer>
| Constructor and Description |
|---|
SimplePerceptron() |
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateError(List<? extends org.openimaj.util.pair.IndependentPair<double[],Integer>> pts) |
SimplePerceptron |
clone() |
double[] |
computeHyperplanePoint(double[] x)
Compute NaN-coordinate of a point on the hyperplane given
non-NaN-coordinates.
|
boolean |
estimate(List<? extends org.openimaj.util.pair.IndependentPair<double[],Integer>> data) |
double[] |
getWeights() |
int |
numItemsToEstimate() |
Integer |
predict(double[] x) |
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)
predict in interface org.openimaj.math.model.Model<double[],Integer>predict in interface OnlineLearner<double[],Integer>public boolean estimate(List<? extends org.openimaj.util.pair.IndependentPair<double[],Integer>> data)
estimate in interface org.openimaj.math.model.EstimatableModel<double[],Integer>public int numItemsToEstimate()
numItemsToEstimate in interface org.openimaj.math.model.EstimatableModel<double[],Integer>protected double calculateError(List<? extends org.openimaj.util.pair.IndependentPair<double[],Integer>> pts)
public double[] computeHyperplanePoint(double[] x)
x - the coordinates, only one may be NaN, all others must be
providedpublic SimplePerceptron clone()
public double[] getWeights()