TECHNIQUES UNDER DATA MINING
-Avantika Deb
We will take up a dataset and conduct a case study to understand the importance and application of the various techniques of data mining listed before.
BANK MARKETING CAMPAIGN
Some of the important attributes that the dataset has as its columns are as follows:
Age: (numeric)
Job : type of job (categorical)
Marital : marital status (categorical)
Education (categorical)
Default: has credit in default? (categorical)
Housing: has housing loan? (categorical)
Loan: has personal loan? (categorical)
Contact: contact communication type (categorical)
Cons.price.idx: consumer price index - monthly indicator (numeric)
y - has the client subscribed a term deposit? (binary: 'yes', 'no')
DATA PREPROCESSING
Loading of the dataset
An overview of the dataset’s attributes
dataset contains no null values.
DETECTION AND REMOVAL OF OUTLIERS
We plot a boxplot of all the attributes but focus on the age because it is the only relevant numeric variable and observe that the age distribution is positively skewed with a couple of outliers at age>=70
Since our data distribution is skewed, we use IQR based
filtering to remove the outliers. The new boxplot shows the
successful removal of outliers.
EXPLORATORY DATA ANALYSIS
The distribution is positively skewed with maximum clients
belonging to the age group of 29-35 years.
respect to the number of contacts performed
during this campaign and for this client
We observe that as the frequency of contacts increases, the number of clients converted reduces which makes sense as the clients might tend to get irritated after too many calls leading to non-conversion of calls.
term deposit
Maximum clients were converted in the month of
May whereas the the least number of clients were
converted in the month of December.
a term deposit
Maximum clients who opted for a term deposit in the
bank did a job of the administration or technical type whereas the least no. of clients were housemaids which is understandable
given the low amount of savings they tend to have.
the basis of their education we observe that maximum
of them have a university degree whereas illiterate
clients are rare. This is obvious because the more educated
people are aware of banking habits and its benefits.
who subscribed to a term deposit were married.
RELATIONSHIP B/W THE VARIABLES AND ‘Y’(ASSOCIATION)
A small snippet from the entire code
CLASSIFICATION ANALYSIS
We will also evaluate which model is the best fit for this dataset.
This is what the dataset looks like after one hot encoding. Everything has been converted
into numeric values and the dataset is now ready for predictive modelling.
1) LOGISTIC REGRESSION
2) NAÏVE BAYES
3) DECISION TREE
4) RANDOM FOREST
5) SVM
6) K NEAREST NEIGHBOURS
VISUALIZATION OF CLASSIFICATION TECHNIQUES
Logistic Regression
The two classes are neatly demarcated with a straight line
Naïve Bayes
A smooth demarcation is observed between the two classes
Characteristic horizontal and vertical
demarcation lines throughout the graph
Decision Tree
VISUALISATION OF CLASSIFICATION TECHNIQUES
Random Forest
Similar to decision tree, exhibits
vertical and horizontal lines of demarcation b/w the two classes
SVM
KNN
Line of demarcation is jagged
SVM with linear kernel has
a linear demarcation
INFERENCES FROM THE ANALYSIS
SUGGESTIONS FOR BANK CAMPAIGN
DATA MINING TOOLS
The most popular data mining tools are as follows: