Package mekano :: Package ml :: Module logreg :: Class LogisticRegressionClassifier
[hide private]
[frames] | no frames]

Class LogisticRegressionClassifier

object --+
         |
        LogisticRegressionClassifier

A logistic regression classifier trained using CG. Supports prior mean on 'w'.

>>> lr = LogisticRegressionClassifier()
>>> lr.maxiter = 100
>>> lr.epsilon = 1e-8
>>> lr.c = 1.0             # How much more to weigh the +ve examples than -ve examples.
>>> lr.train(ds)           # see help for train()
>>> s = lr.score(av)
Instance Methods [hide private]
 
__init__(...)
Initialize the LR classifier.
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(x)
repr(x)
 
score(...)
 
train(...)
Train the model.

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

Properties [hide private]
  LAMBDA
  b
  c
  epsilon
  maxiter
  mu
  w

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 
Initialize the LR classifier.

        mu can be a double value, or a list of values (at least as many as #features+1)
lambda is a double value that controls the strength of the prior.
        

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

train(...)

 

Train the model.

Parameters:
  • ds - A Dataset that contains docs as a list of AtomVectors and labels as a list of true/false objects.