public class DCDLearningAlgorithm extends Object implements LinearMethod, ClassificationLearningAlgorithm, BinaryLearningAlgorithm
Constructor and Description |
---|
DCDLearningAlgorithm() |
DCDLearningAlgorithm(double cp,
double cn,
DCDLoss dcdLoss,
boolean useBias,
int maxIterations,
String representationName) |
DCDLearningAlgorithm(double cp,
double cn,
int maxIterations,
String representationName)
This constructor uses the L2 loss and ignores the bias of the hyper-plane
|
DCDLearningAlgorithm(Label label,
double cp,
double cn,
DCDLoss dcdLoss,
boolean useBias,
int maxIterations,
String representationName) |
Modifier and Type | Method and Description |
---|---|
DCDLearningAlgorithm |
duplicate()
Creates a new instance of the LearningAlgorithm initialized with the same parameters
of the learningAlgorithm to be duplicated.
|
double |
getCn() |
double |
getCp() |
DCDLoss |
getDcdLoss() |
Label |
getLabel() |
List<Label> |
getLabels()
Returns the labels representing the concept to be learned.
|
int |
getMaxIterations() |
BinaryLinearClassifier |
getPredictionFunction()
Returns the classifier learned during the training process
|
String |
getRepresentation()
Returns the representation this learning algorithm exploits
|
long |
getSeed() |
boolean |
isFairness() |
boolean |
isUseBias() |
void |
learn(Dataset dataset)
It starts the training process exploiting the provided
dataset |
void |
reset()
Resets all the learning process, returning to the default state.
|
void |
setCn(double cn) |
void |
setCp(double cp) |
void |
setDcdLoss(DCDLoss dcdLoss) |
void |
setFairness(boolean fairness) |
void |
setLabel(Label label) |
void |
setLabels(List<Label> labels)
Sets the labels representing the concept to be learned.
|
void |
setMaxIterations(int maxIterations) |
void |
setRepresentation(String representation)
Sets the representation this learning algorithm will exploit
|
void |
setSeed(long seed) |
void |
setUseBias(boolean useBias) |
public DCDLearningAlgorithm()
public DCDLearningAlgorithm(Label label, double cp, double cn, DCDLoss dcdLoss, boolean useBias, int maxIterations, String representationName)
label
- The label to be learnedcp
- The regularization parameter for positive examplescn
- The regularization parameter for negative examplesdcdLoss
- The Loss functionuseBias
- Set the use of biasmaxIterations
- The maximum number of iterationsrepresentationName
- The identifier of the representation to be considered for the
training steppublic DCDLearningAlgorithm(double cp, double cn, DCDLoss dcdLoss, boolean useBias, int maxIterations, String representationName)
label
- The label to be learnedcp
- The regularization parameter for positive examplescn
- The regularization parameter for negative examplesdcdLoss
- The Loss functionuseBias
- Set the use of biasmaxIterations
- The maximum number of iterationsrepresentationName
- The identifier of the representation to be considered for the
training steppublic DCDLearningAlgorithm(double cp, double cn, int maxIterations, String representationName)
label
- The label to be learnedcp
- The regularization parameter for positive examplescn
- The regularization parameter for negative examplesmaxIterations
- The maximum number of iterationsrepresentationName
- The identifier of the representation to be considered for the
training steppublic DCDLearningAlgorithm duplicate()
LearningAlgorithm
duplicate
in interface LearningAlgorithm
public double getCn()
public double getCp()
public DCDLoss getDcdLoss()
public Label getLabel()
getLabel
in interface BinaryLearningAlgorithm
public List<Label> getLabels()
LearningAlgorithm
getLabels
in interface BinaryLearningAlgorithm
getLabels
in interface LearningAlgorithm
public int getMaxIterations()
public BinaryLinearClassifier getPredictionFunction()
ClassificationLearningAlgorithm
getPredictionFunction
in interface ClassificationLearningAlgorithm
getPredictionFunction
in interface LearningAlgorithm
public String getRepresentation()
LinearMethod
getRepresentation
in interface LinearMethod
public long getSeed()
public boolean isFairness()
public boolean isUseBias()
public void learn(Dataset dataset)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
dataset
- the training datapublic void reset()
LearningAlgorithm
reset
in interface LearningAlgorithm
public void setCn(double cn)
public void setCp(double cp)
public void setDcdLoss(DCDLoss dcdLoss)
public void setFairness(boolean fairness)
public void setLabel(Label label)
setLabel
in interface BinaryLearningAlgorithm
public void setLabels(List<Label> labels)
LearningAlgorithm
setLabels
in interface BinaryLearningAlgorithm
setLabels
in interface LearningAlgorithm
labels
- the labels representing the concept to be learnedpublic void setMaxIterations(int maxIterations)
public void setRepresentation(String representation)
LinearMethod
setRepresentation
in interface LinearMethod
representation
- the representation to setpublic void setSeed(long seed)
public void setUseBias(boolean useBias)
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.