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

Module LogisticRegression

source code

Code for doing logistic regressions.

Classes:
Functions:
Classes [hide private]
  LogisticRegression
Holds information necessary to do logistic regression classification.
Functions [hide private]
 
train(xs, ys, update_fn=None, typecode=None)
Train a logistic regression classifier on a training set.
source code
 
calculate(lr, x)
Calculate the probability for each class.
source code
 
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=None, typecode=None)

source code 

Train a logistic regression classifier on a training set.

Argument 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.

calculate(lr, x)

source code 

Calculate the probability for each class.

Arguments:
  • lr is a LogisticRegression object.
  • x is the observed data.

Returns a list of the probability that it fits each class.