Learn practical skills, build real-world projects, and advance your career

Predict if a customer/visitor will click a Facebook advertisement or not

Ad based marketing is a very common approach to catch eyes of many prospective customers through social media channels like Facebook, Twitter, Instagram, etc. Making a customer click a specific advertisement will depend on various situations. Some of those situations could be -

  • Customer first must be served with the advertisements of services which might interest them and this will depend on studying customer behavior, interests and past purchases.
  • Customer might spend time on say facebook ads but might not click any advsertisements
  • Ad content and infographics

In this project we will have a small dataset using which we will attempt to predict if a customer will click an advertisement or not.

What type of Machine Learning Problem is this ?

This is a classification based ML problem, where we want figure out two possible values, i.e. "Yes" or "No"

Steps to follow to get a working Machine Learning Model on Logistic Regression (classification)

  • #Step 1 - Install and import housekeeping libraries (Jovian and opendatasets are housekeeping libraries in case of this project. jovian will allow us to save our notebook in jovian.ai environment and opendatasets will allow us to download the dataset from Kaggle. This step can be ignored if you are not using jovian and have manually downloaded the Kaggle dataset

  • #Step 2 - Download dataset from Kaggle or import manually in your workspace

  • #Step 3 - Import dataset and do basic analysis to see how features are impacting the label(target column) which we want to predict.

  • #Step 4 - Perform data wrangling which will include - removing columns of no use, removing and replacing NAN, empty and null values, converting categorical columns to numeric columns, scaling the data to fit between 0 and 1, etc.

  • #Step 5 - Split train, validation and test data from the dataset using either direct propertion of 70/30 or 80/20 or using stratification to have right propertion of all types of data in three categories

  • #Step 6 - Train the model using sklearn

  • #Step 7 - Predict using train, validation and test data and get the confusion matrix outcome

Step 1 - Installing housekeeping libraries

!pip install jovian opendatasets --upgrade --quiet
import jovian