You are on page 1of 3

Neural Networks

Week-2 Practice Project

Predicting Discount Coupon for customers


Domain:
E-commerce,Retail

Objective:

Predicting coupon discount for the customers of happy-mart with the help of a neural
network.
This is a continuation of the previous week’s project.

Problem Statement:
Happy-Mart.com is one of the famous online grocery stores operating all over Europe.
They have grown their business exponentially during the pandemic. They now want to
offer some discount to their customers who have ordered groceries online most
frequently. They have thought of offering a 25% discount(through a coupon) to their
customers who are ordering groceries online from their stores frequently.As a data
scientist we have to analyze the data and train a neural network model and check the
accuracy.

Dataset Description:
Income: Customer's yearly household income

Kidhome: Number of children in customer's household

Teenhome: Number of teenagers in customer's household

Recency: Number of days since customer's last purchase

MntWines: Amount spent on wine in the last 2 years

MntFruits: Amount spent on fruits in the last 2 years

Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 1
MntMeatProducts: Amount spent on meat in the last 2 years

MntFishProducts: Amount spent on fish in the last 2 years

Coupon: Eligible for coupon (Target)

and so on..

● Data Loading and Exploration (OLD STEPS)

1. Import all the necessary libraries.

2. Read the customer_data.csv and show a sample of five rows.

3. Check the basic information about the dataframe using the info() method.

4. Check the number of missing values in each column.

5. Plot a pairplot by taking Coupon as a hue parameter.

6. Plot a heatmap to show the correlation between all the columns of the
dataframe.

7. Store the target column (i.e.Coupon) in the y variable and the rest of the
columns in the X variable.

8. Split the dataset into two parts (i.e. 80% train and 20% test) using
random_state=42.

9. Normalize the data X using MinMaxScaler.

10. Convert the target to one-hot encoded vectors.(hint: use to_categorical)

Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 2
● Model Training and Evaluation:
1. Build three neural network models having below parameters. (Hint:Set the
neurons of the input layer and output layers correctly. You can play with
number of layers and number of neurons)
a. Model 1:- a deep neural network without dropouts and batch
normalization.
b. Model 2:- a deep neural network with dropout layers.
c. Model 3:- a deep neural network with batch normalization layers.

2. Compile the above models with adam optimizer and with


categorical_crossentropy loss. Set the metrics as accuracy.

3. Train the above models with a batch size of 32 and no. of epochs=30.

4. Print the confusion matrix for these three models.

5. Plot the accuracy and loss of both train and validation set.

6. Compare the accuracy of these three models and write your findings.

Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 3

You might also like