public abstract class Perceptron extends Object implements ClassificationLearningAlgorithm, OnlineLearningAlgorithm, BinaryLearningAlgorithm
[Rosenblatt1957] F. Rosenblatt. The Perceptron – a perceiving and recognizing automaton. Report 85-460-1, Cornell Aeronautical Laboratory (1957)
| Modifier and Type | Field and Description |
|---|---|
protected float |
alpha |
protected BinaryClassifier |
classifier |
protected Label |
label |
protected float |
margin |
protected boolean |
unbiased |
| Constructor and Description |
|---|
Perceptron() |
| Modifier and Type | Method and Description |
|---|---|
float |
getAlpha()
Returns the learning rate, i.e.
|
Label |
getLabel() |
List<Label> |
getLabels()
Returns the labels representing the concept to be learned.
|
float |
getMargin()
Returns the desired margin, i.e.
|
BinaryClassifier |
getPredictionFunction()
Returns the classifier learned during the training process
|
boolean |
isUnbiased()
Returns whether the bias, i.e.
|
void |
learn(Dataset dataset)
It starts the training process exploiting the provided
dataset |
BinaryMarginClassifierOutput |
learn(Example example)
Applies the learning process on a single example, updating its current model
|
void |
reset()
Resets all the learning process, returning to the default state.
|
void |
setAlpha(float alpha)
Sets the learning rate, i.e.
|
void |
setLabel(Label label) |
void |
setLabels(List<Label> labels)
Sets the labels representing the concept to be learned.
|
void |
setMargin(float margin)
Sets the desired margin, i.e.
|
void |
setUnbiased(boolean unbiased)
Sets whether the bias, i.e.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitduplicateprotected BinaryClassifier classifier
protected Label label
protected float alpha
protected float margin
protected boolean unbiased
public float getAlpha()
public void setAlpha(float alpha)
alpha - the learning rate to setpublic float getMargin()
public void setMargin(float margin)
margin - the margin to setpublic boolean isUnbiased()
public void setUnbiased(boolean unbiased)
unbiased - the unbiased to setpublic void learn(Dataset dataset)
LearningAlgorithmdatasetlearn in interface LearningAlgorithmdataset - the training datapublic BinaryMarginClassifierOutput learn(Example example)
OnlineLearningAlgorithmlearn in interface OnlineLearningAlgorithmexample - the instance to be exploited in the learning processexample before the updating steppublic void reset()
LearningAlgorithmreset in interface LearningAlgorithmpublic BinaryClassifier getPredictionFunction()
ClassificationLearningAlgorithmgetPredictionFunction in interface ClassificationLearningAlgorithmgetPredictionFunction in interface LearningAlgorithmpublic void setLabels(List<Label> labels)
LearningAlgorithmsetLabels in interface BinaryLearningAlgorithmsetLabels in interface LearningAlgorithmlabels - the labels representing the concept to be learnedpublic List<Label> getLabels()
LearningAlgorithmgetLabels in interface BinaryLearningAlgorithmgetLabels in interface LearningAlgorithmpublic Label getLabel()
getLabel in interface BinaryLearningAlgorithmpublic void setLabel(Label label)
setLabel in interface BinaryLearningAlgorithmCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.