seldonian.models.models.BinaryLogisticRegressionModel

class BinaryLogisticRegressionModel

Bases: BaseLogisticRegressionModel

__init__()

Implements binary logistic regression

__repr__()

Return repr(self).

Methods

fit(X, Y)

Train the model using features and labels. Let:

i = number of datapoints j = number of features (including bias term, if provied) k = number of classes

Parameters:
  • X (array of shape (i,j)) – The features

  • Y (array of shape (i,k)) – The labels

Returns:

fitted model weights

Return type:

array of shape (j,k)

predict(theta, X)

Predict the probability of having the positive class label for each data point in X. Let:

i = number of datapoints j = number of features (including bias term, if provied)

Parameters:
  • theta (array of length j or shape (j,1)) – The parameter weights

  • X (array of shape (i,j)) – The features

Returns:

predictions for each class each observation

Return type:

array of length i or shape (i,1)