seldonian.models.models.MultiClassLogisticRegressionModel

class MultiClassLogisticRegressionModel

Bases: BaseLogisticRegressionModel

__init__()

Implements multi-class 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 each class label for each data point in X. Let:

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

Parameters:
  • theta (array of shape (j,k)) – The parameter weights

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

Returns:

predictions for each class each observation

Return type:

array of shape (i x k)