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, wait
duplicate
protected 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)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
dataset
- the training datapublic BinaryMarginClassifierOutput learn(Example example)
OnlineLearningAlgorithm
learn
in interface OnlineLearningAlgorithm
example
- the instance to be exploited in the learning processexample
before the updating steppublic void reset()
LearningAlgorithm
reset
in interface LearningAlgorithm
public BinaryClassifier getPredictionFunction()
ClassificationLearningAlgorithm
getPredictionFunction
in interface ClassificationLearningAlgorithm
getPredictionFunction
in interface LearningAlgorithm
public void setLabels(List<Label> labels)
LearningAlgorithm
setLabels
in interface BinaryLearningAlgorithm
setLabels
in interface LearningAlgorithm
labels
- the labels representing the concept to be learnedpublic List<Label> getLabels()
LearningAlgorithm
getLabels
in interface BinaryLearningAlgorithm
getLabels
in interface LearningAlgorithm
public Label getLabel()
getLabel
in interface BinaryLearningAlgorithm
public void setLabel(Label label)
setLabel
in interface BinaryLearningAlgorithm
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.