liblinear
Class Parameter

java.lang.Object
  extended by liblinear.Parameter

public final class Parameter
extends java.lang.Object


Constructor Summary
Parameter(SolverType solverType, double C, double eps)
           
 
Method Summary
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(SolverType solverType,
                 double C,
                 double eps)
Method Detail

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:
setWeights(double[], int[])

getWeightLabels

public int[] getWeightLabels()
See Also:
setWeights(double[], int[])

getNumWeights

public int getNumWeights()
the number of weights

See Also:
setWeights(double[], int[])

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()

setSolverType

public void setSolverType(SolverType solverType)

getSolverType

public SolverType getSolverType()


Copyright © 2010. All Rights Reserved.