public class PerceptronModel extends Object implements Serializable
Constructor and Description |
---|
PerceptronModel() |
PerceptronModel(PerceptronModel model) |
Modifier and Type | Method and Description |
---|---|
Object[] |
classify(double[] features)
Classify the feature set into class
|
int |
getFeatureSize()
Get model's feature set size
|
void |
initWeights(int size)
Initialize model's weights
|
void |
setBias(double bias)
Set a bias for the model
|
void |
setLearningRate(double learningRate)
Set a learning rate to the model
|
void |
setThreshold(double threshold)
Set a threshold to the model
|
double[] |
update(Boolean label,
double[] features)
Mehod to update weight of perceptron model
|
public PerceptronModel()
public PerceptronModel(PerceptronModel model)
public double[] update(Boolean label, double[] features)
label
- target class/label valuefeatures
- array of feature attributes to trainpublic Object[] classify(double[] features)
features
- set of feature attributedpublic void initWeights(int size)
size
- public int getFeatureSize()
public void setBias(double bias)
bias
- bias to shift the decision boundarypublic void setThreshold(double threshold)
threshold
- boundary for the predictionpublic void setLearningRate(double learningRate)
learningRate
- To avoid the local optimaCopyright © 2018 WSO2. All rights reserved.