Class Parameter
java.lang.Object
de.bwaldvogel.liblinear.Parameter
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionParameter(SolverType solver, double C, double eps) Parameter(SolverType solverType, double C, double eps, double p) Parameter(SolverType solverType, double C, double eps, int max_iters, double p) Parameter(SolverType solver, double C, int max_iters, double eps) -
Method Summary
Modifier and TypeMethodDescriptionclone()doublegetC()doublegetEps()double[]intdoublegetNu()intthe number of weightsdoublegetP()int[]double[]booleanvoidsetC(double C) C is the cost of constraints violation.voidsetEps(double eps) eps is the stopping criterion.voidsetInitSol(double[] init_sol) voidsetMaxIters(int iters) voidsetNu(double nu) voidsetP(double p) set the epsilon in loss function of epsilon-SVR (default 0.1)voidvoidsetRegularizeBias(boolean regularizeBias) voidsetSolverType(SolverType solverType) voidsetWeights(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).
-
Constructor Details
-
Parameter
-
Parameter
-
Parameter
-
Parameter
-
-
Method Details
-
setWeights
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.
-
getWeights
public double[] getWeights()- See Also:
-
getWeightLabels
public int[] getWeightLabels()- See Also:
-
getNumWeights
public int getNumWeights()the number of weights- See Also:
-
setC
public void setC(double C) C is the cost of constraints violation. (we usually use 1 to 1000) -
getC
public double getC() -
setEps
public void setEps(double eps) eps is the stopping criterion. (we usually use 0.01). -
getEps
public double getEps() -
setMaxIters
public void setMaxIters(int iters) -
getMaxIters
public int getMaxIters() -
setSolverType
-
getSolverType
-
setP
public void setP(double p) set the epsilon in loss function of epsilon-SVR (default 0.1) -
getP
public double getP() -
setInitSol
public void setInitSol(double[] init_sol) -
getInitSol
public double[] getInitSol() -
setNu
public void setNu(double nu) -
getNu
public double getNu() -
setRegularizeBias
public void setRegularizeBias(boolean regularizeBias) -
isRegularizeBias
public boolean isRegularizeBias() -
setRandom
-
clone
-