Member-only story
Logistic Regression in Python
Step-by-step follow along | Data Series | Episode 7.2
5 min readOct 17, 2020
Please consider watching this video if any section of this article is unclear.
Consider reading Episode 7.1 before continuing, which explains how logistic regression works.
How to set up your programming environment can be found at the start of :
Episode 4.3
You can view and use the code and data used in this episode here: Link
Objective
Predict whether it will rain tomorrow in Albury, Australia given the following data:
Importing our Data
- We store our data in the variable df short for data frame.
- df.shape gives the number of rows and columns in our data.
- df.head displays the first few rows of data on our notebook.
# Read the data
import pandas as pd
df = pd.read_csv("D:\ProjectData\weatherAlbury.csv")
print('Size of weather data frame is :',df.shape)
df.head()