In this section, we will walk through the implementation of logistic regression in Python within the packtml package. We will start off with a brief recap of what logistic regression seeks to accomplish and then go over the source code and look at an example.
Recall that logistic regression seeks to classify a sample into a discrete category, also known as classification. The logistic transformation allows us to transform the log odds that we get from the inner product of our parameters and X.
Notice that we have three Python files open. One is extmath.py, from within the utils directory inside of packtml; another is simple_logistic.py, from within the regression library in packtml; and the final one is an example_logistic_regression.py file, inside the examples directory and regression.
We will dive right into the code base...