public final class Parameter
extends java.lang.Object
Constructor and Description |
---|
Parameter(SolverType solverType,
double C,
double eps) |
Modifier and Type | Method and Description |
---|---|
double |
getC() |
double |
getEps() |
int |
getNumWeights()
the number of weights
|
SolverType |
getSolverType() |
int[] |
getWeightLabels() |
double[] |
getWeights() |
void |
setC(double C)
C is the cost of constraints violation.
|
void |
setEps(double eps)
eps is the stopping criterion.
|
void |
setSolverType(SolverType solverType) |
void |
setWeights(double[] weights,
int[] weightLabels)
nr_weight, weight_label, and weight are used to change the penalty
for some classes (If the weight for a class is not changed, it is
set to 1).
|
public Parameter(SolverType solverType, double C, double eps)
public void setWeights(double[] weights, int[] weightLabels)
nr_weight, weight_label, and weight are used to change the penalty for some classes (If the weight for a class is not changed, it is set to 1). This is useful for training classifier using unbalanced input data or with asymmetric misclassification cost.
Each weight[i] corresponds to weight_label[i], meaning that the penalty of class weight_label[i] is scaled by a factor of weight[i].
If you do not want to change penalty for any of the classes, just set nr_weight to 0.
public double[] getWeights()
setWeights(double[], int[])
public int[] getWeightLabels()
setWeights(double[], int[])
public int getNumWeights()
setWeights(double[], int[])
public void setC(double C)
public double getC()
public void setEps(double eps)
public double getEps()
public void setSolverType(SolverType solverType)
public SolverType getSolverType()