Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Predictive Analytics with Python

You're reading from  Hands-On Predictive Analytics with Python

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789138719
Pages 330 pages
Edition 1st Edition
Languages
Author (1):
Alvaro Fuentes Alvaro Fuentes
Profile icon Alvaro Fuentes

Table of Contents (11) Chapters

Preface 1. The Predictive Analytics Process 2. Problem Understanding and Data Preparation 3. Dataset Understanding – Exploratory Data Analysis 4. Predicting Numerical Values with Machine Learning 5. Predicting Categories with Machine Learning 6. Introducing Neural Nets for Predictive Analytics 7. Model Evaluation 8. Model Tuning and Improving Performance 9. Implementing a Model with Dash 10. Other Books You May Enjoy

Regressing with neural networks

We will again use our diamonds dataset. Although this is a small dataset and MLP is perhaps a model that is too complicated for this problem, there is no reason we could not use an MLP to solve it; in addition to this, remember that back when we defined the hypothetical problem, we established that the stakeholders wanted a model that was as accurate as possible in their predictions, so let's see how accurate we can get with an MLP. As always, let's import the libraries we will use:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
%matplotlib inline

Now, since we are beginning from scratch, load and prepare the dataset:

DATA_DIR = '../data'
FILE_NAME = 'diamonds.csv'
data_path = os.path.join(DATA_DIR, FILE_NAME)
diamonds = pd.read_csv(data_path)
## Preparation done from Chapter...
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 $15.99/month. Cancel anytime}