From the course: Machine Learning with Python: Logistic Regression
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
How to prepare data for logistic regression in Python - Python Tutorial
From the course: Machine Learning with Python: Logistic Regression
How to prepare data for logistic regression in Python
- [Instructor] In this video, you will learn how to split data into training and test sets prior to training a logistic regression model in Python. Note that this video is the second in a four-video sequence that also teaches you how to import and explore data, train a logistic regression model, evaluate the model, and interpret the model in Python. If you have not done so, watch the previous video for a detailed explanation of the prior code. Before we begin, let's run the code we created in that video to get our environment up to speed. So I'm going to go to the top here and click on run all. All right. So our code is done running the previous code. So our primary objective in this step is to split our data into training and test sets. The training set will be used to train the model, while the test set will be used to evaluate the model. Before we split the data, we first need to separate the dependent variable…