Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Become a Python Data Analyst

You're reading from   Become a Python Data Analyst Perform exploratory data analysis and gain insight into scientific computing using Python

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789531701
Length 178 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alvaro Fuentes Alvaro Fuentes
Author Profile Icon Alvaro Fuentes
Alvaro Fuentes
Arrow right icon
View More author details
Toc

Building a regression model using scikit-learn

The previous section showed us an example of a classification model using scikit-learn. In this section, we will train a random forest model and use it to make predictions. We will also be building a classification model as the target variable in this scenario. This will be a categorical value that depicts the drinking habits of teenagers.

To do this, we first load the students dataset from the previous chapter. We will then train a logistic regression model and take a look at how to evaluate the classification model at a very basic level.

To begin, we load the libraries and import the students dataset and make some transformations to it, just as we did in the previous section. Our goal is to use the features of the students to predict the level of alcohol. These features are categorical values that can either be high or low. The...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime