Package Bio :: Module LogisticRegression
[hide private]
[frames] | no frames]

Module LogisticRegression

source code

Code for doing logistic regressions.


Classes:
LogisticRegression    Holds information for a LogisticRegression classifier.


Functions:
train        Train a new classifier.
calculate    Calculate the probabilities of each class, given an observation.
classify     Classify an observation into a class.

Classes [hide private]
  LogisticRegression
Holds information necessary to do logistic regression classification.
Functions [hide private]
LogisticRegression

train(xs, ys, update_fn=...)
Train a logistic regression classifier on a training set.
source code
list of probabilities

calculate(lr, x)
Calculate the probability for each class.
source code
1 or 0

classify(lr, x)
Classify an observation into a class.
source code
Variables [hide private]
  __package__ = 'Bio'
Function Details [hide private]

train(xs, ys, update_fn=...)

source code 
Train a logistic regression classifier on a training set.  xs is a
list of observations and ys is a list of the class assignments,
which should be 0 or 1.  xs and ys should contain the same number
of elements.  update_fn is an optional callback function that
takes as parameters that iteration number and log likelihood.

Returns:
LogisticRegression

calculate(lr, x)

source code 
Calculate the probability for each class.  lr is a
LogisticRegression object.  x is the observed data.  Returns a
list of the probability that it fits each class.

Returns:
list of probabilities