From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock this course with a free trial

Join today to access over 25,400 courses taught by industry experts.

Determining trends for logistic regression with Python code

Determining trends for logistic regression with Python code

- [Instructor] We are going to use the logistic regression function from the linear model section of SK Learn and the standard scaler function from the pre-processing section of the same library in addition to Pandas and NumPy. In Excel, we already imported all the libraries we're using in this course at once through the libraries sheet. Let's note in the blue cell the libraries we're using specifically for logistic regression. In Codespace, we create a data frame object stored in variable df that's exactly the same as the data table referenced in the logistic regression model in Excel. In Excel, let's create a Python code cell for the data frame object to reference the cells B2 through C12 directly on the same sheet. Now let's create our logistic regression model in Python. We'll create a logit variable and instead it equal to the logistic regression function, where we'll set the fit intercept penalty and class weight parameters inside it. Now let's scale the X values in our logistic…

Contents