The Importance Of Orthopedic Doctors

Having the ability to walk is something that many people take for granted. They don’t appreciate being able to get up and walk freely around their homes or to the refrigerator for a glass of milk or…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Trying to predict who would accept a coupon while driving

We will to to find whether a driver will accept a coupon depending on the answers that the person will give on the questions that were asked.

I found this dataset on kaggle. This data was collected via a survey on Amazon Mechanical Turk. The survey describes different driving scenarios including the destination, current time, weather, passenger, etc., and then ask the person whether he will accept the coupon if he is the driver. For more information about the dataset, please refer to the paper: Wang, Tong, Cynthia Rudin, Finale Doshi-Velez, Yimin Liu, Erica Klampfl, and Perry MacNeille. ‘A bayesian framework for learning rule sets for interpretable classification.’ The Journal of Machine Learning Research 18, no. 1 (2017): 2357–2393.
The attributes of this data set are :
gender: male, female

Data Importing and Initial Analysis
First we will import all the Library and Packages that we will need for our program.

Now we will import our Dataset and take a initial look at our data.

Once the data was loaded in I ran an automated exploratory data analysis with pandas profiling.

As you can see we have to do a fair bit work on our data to wrangle before we make a model on it.

Now that I have access to the pandas profiling report we can start cleaning our data more efficiently.

The wrangle function that I use

Now, I’m going to taking a look at my target, Which is Y (that is whether a person accepts the coupons or not (1,0)).

Now just checking the shape of my cleaned dataframe.

Splitting my data on my target variable Y, and then splitting that into my train, val and test split.

Now, we get to modelling but before that I want to see the Baseline Mean Absolute Error and Baseline Accuracy

Very good Baseline

Since this is clearly a categorical dataset with some feature engineering we go back to the wrangle function and convert some other attributes to categorical data for a higher score and we will only use a Classifier pipeline since it makes the most sense in this case. The results are:
Random Forest Classifier-

So, clearly since we have such a high accuracy score with Random Forest Classifier.

Add a comment

Related posts:

A Scary Incident in the Apartment Above Me

Let me tell you about a very dubious thing that happened a few weeks ago. I wanted to post about her since then, but I still haven’t found my peace. I was at home on a Friday evening with a friend…

ConversationBufferMemory

Este notebook mostra como usar arquivos ConversationBufferMemory. Esta memória permite o armazenamento de mensagens e depois extrai as mensagens em uma variável. Também podemos obter o histórico como…

Milky Beauty Song Promo From Bholaa Shankar Out Now

Milky Beauty Song Promo From Bholaa Shankar Out Now. Check Out The Promo Song Of Milky Beauty Out Now On Charvitha Official Website. Telugu Latest New Movie Bholaa Shankar Released A New Song Named…