|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.discriminative.LinearModel
public class LinearModel
Classifies a data point using a hyperplane.
Constructor Summary | |
---|---|
LinearModel(Vector hyperplane)
Init a linear model with zero displacement and a threshold of 0.5. |
|
LinearModel(Vector hyperplane,
double displacement,
double threshold)
Init a linear model with a hyperplane, distance and displacement. |
Method Summary | |
---|---|
void |
addDelta(Vector delta)
Update the hyperplane by adding delta. |
boolean |
classify(Vector dataPoint)
Classify a point to either belong to the class modeled by this linear model or not. |
void |
shiftBias(double factor)
Shift the bias of the model. |
void |
timesDelta(int index,
double delta)
Multiply the weight at index by delta. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinearModel(Vector hyperplane, double displacement, double threshold)
public LinearModel(Vector hyperplane)
Method Detail |
---|
public boolean classify(Vector dataPoint)
dataPoint
- the data point to classify.
public void addDelta(Vector delta)
delta
- the delta to add to the hyperplane vector.public String toString()
toString
in class Object
public void shiftBias(double factor)
factor
- factor to multiply the bias by.public void timesDelta(int index, double delta)
index
- the index of the element to update.delta
- the delta to multiply the element with.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |