What’s our plan for implementing Logistic Regression in NumPy?
Let’s first think of the underlying math that we want to use.
There are many ways to define a loss function and then find the optimal parameters for it, among them, here we will implement in our LogisticRegression
class the following 3 ways for learning the parameters:
In the above equations, X is the input matrix that contains observations on the row axis and features on the column axis; y is a column vector that contains the classification labels (0 or 1); f is the sum of squared errors loss function; h is the loss function for the MLE method.
#python #machine-learning #artificial-intelligence #data-science #logistic-regression