Package pyliblinear :: Module _liblinear :: Class Solver
[frames] | no frames]

Class Solver

object --+
         |
        Solver

Solver container
Instance Methods
dict
weights(self)
Return the configured weights as a dict (label -> weight).

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
Solver
__new__(cls, type=None, C=None, eps=None, p=None, weights=None)
Construct new solver instance.
Properties
float C
The configured C parameter.
float eps
The configured eps parameter.
float p
The configured p parameter.
str type
The configured solver type.

Inherited from object: __class__

Method Details

__new__(cls, type=None, C=None, eps=None, p=None, weights=None)
Static Method

 
Construct new solver instance.
Parameters:
  • type (str or int) - The solver type. One of the keys or values of the SOLVER_TYPES dict. If omitted or None, the default solver type is applied (L2R_L2LOSS_SVC_DUAL == 1)
  • C (float) - Cost parameter, if omitted or None, it defaults to 1. C > 0.
  • eps (float) - Tolerance of termination criterion. If omitted or None, a default is applied, depending on the solver type. eps > 0
  • p (float) - Epsilon in loss function of epsilon-SVR. If omitted or None it defaults to 0.1. p >= 0.
  • weights (mapping) - Iterator over label weights. This is either a dict, mapping labels to weights ({int: float, ...}) or an iterable of 2-tuples doing the same ([(int, float), ...]). If omitted or None, no weight is applied.
Returns: Solver
New Solver instance
Raises:
  • ValueError - Some invalid parameter
Overrides: object.__new__

weights(self)

 
Return the configured weights as a dict (label -> weight).
Returns: dict
The weights (maybe empty)

Property Details

C

The configured C parameter.
Type:
float

eps

The configured eps parameter.
Type:
float

p

The configured p parameter.
Type:
float

type

The configured solver type.
Type:
str