<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ashim Maity on Medium]]></title>
        <description><![CDATA[Stories by Ashim Maity on Medium]]></description>
        <link>https://medium.com/@ashim.maity8?source=rss-77453502f6a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NY025UCrGD49hrFG.jpg</url>
            <title>Stories by Ashim Maity on Medium</title>
            <link>https://medium.com/@ashim.maity8?source=rss-77453502f6a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 13:05:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashim.maity8/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Customer Segmentation using KMeans Clustering]]></title>
            <link>https://medium.com/@ashim.maity8/customer-segmentation-using-kmeans-clustering-cd8edc0a8e87?source=rss-77453502f6a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd8edc0a8e87</guid>
            <dc:creator><![CDATA[Ashim Maity]]></dc:creator>
            <pubDate>Sat, 10 Oct 2020 12:01:00 GMT</pubDate>
            <atom:updated>2020-10-10T12:01:00.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*NK05ZMdXod4LR8tNc4r69Q.jpeg" /><figcaption>fig: 1.1</figcaption></figure><p><strong>Introduction</strong></p><p>Segmentation is the fact of grouping similar elements having the same characteristics into the same segment. The resulting segments split the concerned population into groups that share the same features, and so can be handled the same way.</p><p>Marketers are using this technique to better address and target their customers via personalization, when launching their ads and communication campaigns, when designing a new offer or promotion, and also for merchandising. Traditionally, the split is done based on 4 main criteria:</p><p><strong>. Demographic:</strong> E.g family with more than 3 kids</p><p><strong>. Behavioral: </strong>E.g customer waiting for promotions</p><p><strong>. Psychographic</strong>: E.g customers who are keen on cafe</p><p>. <strong>Geographic</strong>: E.g customers within 4 Km of our shop&#39;s</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*JAG-Ca30iiVU4jegzYc2WA.jpeg" /><figcaption>fig:1.2</figcaption></figure><p>But, this technique fails to detect hidden segments that are a mix of multiple features combination, especially with the development of the internet and big data, and here comes machine learning to bring its clustering solution, a set of unsupervised classification methods that allow recognizing patterns considering only the data distribution, based on the measure of <strong><em>similarity distance </em></strong>between the population elements regarding the two following rules:</p><p>· Homogeneity within clusters: data that belong to the same cluster should be as similar as possible</p><p>· Heterogeneity between clusters: data that belong to different clusters should be as different as possible.</p><p><strong>why we do segmentation?</strong></p><p>Because we can’t treat every customer the same way with the same content, same channel, same importance. They will find another option that understands them better.</p><p>Customers who use platforms have different needs and they have their own different profiles. We should adapt our actions depending on that.</p><p>we can do many different segmentations according to what we are trying to achieve. If you want to increase the retention rate, we can do a segmentation based on churn probability and take action. But there are very common and useful segmentation methods as well. Now we are going to implement one of them to our business: <strong>RFM.</strong></p><p><strong>RFM stands for Recency — Frequency — Monetary Value. Theoretically, we will have segments like below:</strong></p><p>· <strong>Low Value</strong>: Customers who are less active than others, not very frequent buyers/visitors and generates very low — zero — maybe negative revenue.</p><p>· <strong>Mid Value</strong>: In the middle of everything. Often using our platform (but not as much as our High Values), fairly frequent, and generates moderate revenue.</p><p>· <strong>High Value</strong>: The group we don’t want to lose. High Revenue, Frequency, and low Inactivity.</p><p>As the methodology, we need to calculate <em>Recency, Frequency, and Monetary Value</em> (we will call it Revenue from now on) and apply <em>unsupervised machine learning</em> to identify different groups (clusters) for each. Let’s jump into coding and see how to do<strong> RFM Clustering</strong>.</p><h4>Recency</h4><p>To calculate recency, we need to find out the most recent purchase date of each customer and see how many days they are inactive. After having no. of inactive days for each customer, we will apply K-means* clustering to assign customers a <em>recency score</em>.</p><h4><strong>Frequency</strong></h4><p>To create frequency clusters, we need to find the total number of orders for each customer.</p><h4><strong>Monetary</strong></h4><p>Let’s see how our customer database looks like when we cluster them based on revenue. We will calculate the revenue for each customer, plot a histogram, and apply the same clustering method.</p><p>For this example, we will continue using the same dataset which can be found <a href="https://www.kaggle.com/vijayuv/onlineretail">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*doHBGPklP7TJLWqQjOJF2A.png" /><figcaption>Fig:1.3</figcaption></figure><h3>RFM Modelling</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_WjSNo5QNTCZZ6mOhZPjA.png" /><figcaption>Fig 1.4</figcaption></figure><p>Convert column name Invoice Date: Recency, Invoice No: Frequency, Total Amount: Monetary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WxpyYM52nFvcaUYDHcRO8w.png" /><figcaption>Fig:1.5</figcaption></figure><p>Based on our columns distribution and Descriptive Statistics information of columns Recency, Frequency, Monetary are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*UVWCj697sPa7_JeCNj2tEA.png" /><figcaption>Fig:1.6</figcaption></figure><p>Now we will try to provide a score to the customer based on the recency, Frequency, Monetary columns values.</p><p>If the value of recency for customers is low we provide a score of 1 because it means the customer has purchased the product recently.</p><p>In the case of Frequency and Monetary, we will provide a score of 1 to the customer whose frequency of purchasing and amount spent is more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rv1d8dlWTm1hVpKUP9KXjg.png" /><figcaption>Fig:1.7</figcaption></figure><p>We will add the Recency, Frequency, Monetary score, and called it RFMscore, and based on RFMacore we will categorize customers into ‘Platinum’, ‘Gold’, ‘Silver’, ‘Bronze’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*65f9Wu7GZHGdQM7osJWEbQ.png" /><figcaption>Fig 1.8</figcaption></figure><p>Here I am trying to categorize customer into a different cluster based on the graph between feature like</p><ol><li>Recency Vs Frequency</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oqPgz4e9KY4dpFUdBENa8Q.png" /><figcaption>Fig 1.9</figcaption></figure><p>2. Frequency Vs Monetary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7rewjPQCUXGRStaeISfQnQ.png" /><figcaption>Fig 1.10</figcaption></figure><p>3 Recency Vs Monetary</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGEpEMeM3Ndg51S5gbSnIg.png" /><figcaption>Fig:1.11</figcaption></figure><p>Conclusion: From all of the above graphs, we are not able to categorize our customers into different clusters.</p><h3>K-Means Clustering</h3><p>Kmeans clustering is unsupervised classification methods that allow recognizing patterns considering only the data distribution, based on the measure of <strong><em>similarity distance </em></strong>between the population elements regarding the two following rules:</p><p>- Homogeneity within clusters: data that belong to the same cluster should be as similar as possible</p><p>-Heterogeneity between clusters: data that belong to different clusters should be as different as possible.</p><p><strong>Zoom on hierarchical clustering </strong>(Ex. <strong>K-Means</strong>):</p><p>K-means aims to partition N observations into K clusters <strong>Sj</strong> (K must be known), each observation belongs to the cluster with the nearest mean/centroid, by minimizing the sum of squares of distances (e.g., Euclidean) between data and the corresponding cluster centroid <strong>µj</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*11PJbNODmQl6jO2gv2-9DA.jpeg" /><figcaption>Fig: 1.12</figcaption></figure><p><strong>How to choose the number of clusters:</strong></p><p>Determining the optimal number of clusters for the input data is hard, usually, we want that the compactness of the clustering to be as small as possible, usually we use statistical methods like:</p><p>· <strong>Elbow method</strong> uses a total within-cluster sum of square (WSS) as a function of the number of clusters, which measures how to spread apart the clusters are from each other. So, the K-means algorithm is run for a set of value k (e.g k ϵ [0…10]), and WWS is calculated for each k and plotted (see figure below). The number of clusters is chosen in such a way that adding a new cluster does not improve the WSS.</p><p>· <strong>Average silhouette method</strong> measures the quality of a clustering which shows how well each object lies within its cluster. A high average silhouette width indicates a good clustering.</p><p>· <strong>Gap statistic method </strong>compares the total within intra-cluster variation for different values of k with their expected values under the null reference distribution of the data. The optimal clusters will be a value that maximizes the gap statistic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*a9cLd5hR9S9cYIttujAsig.jpeg" /><figcaption>Fig: 1.13</figcaption></figure><p>From Fig No:1.6 no we see that our data is left-skewed so it is required that we should make our data normally distributed and then we do data standardization so that our machine learning model will able to categorize our data accurately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*DARBZGapLwj5mXmnr_0zVw.png" /><figcaption>Fig:1.14</figcaption></figure><p>Now we apply our Machine learning model of k means to data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*0UmvhUt8GCTleDLAJl2AiA.png" /><figcaption>Fig:1.15</figcaption></figure><p>From the elbow method, we can see that if we use 3 clusters to segment our customers we will get maximum accuracy.</p><p>Now we will segment our customers based on 3 clusters as prescribed by our machine learning model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORzwOBKRWkcZnLvXS-6rcw.png" /></figure><p>We can start taking action with this segmentation. The main strategies are quite clear:</p><ul><li>High Value: Improve Retention</li><li>Mid Value: Improve Retention + Increase Frequency</li><li>Low Value: Increase Frequency</li></ul><p>You can find the jupyter notebook for this article <a href="https://colab.research.google.com/drive/1duH5nf1lA_BUsmzWwLn-RF730sWEPeYI">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd8edc0a8e87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predict if the client will subscribe a term deposit or not, using “Machine learning”]]></title>
            <link>https://medium.com/@ashim.maity8/predict-if-the-client-will-subscribe-a-term-deposit-or-not-using-machine-learning-c6e4024c7028?source=rss-77453502f6a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6e4024c7028</guid>
            <dc:creator><![CDATA[Ashim Maity]]></dc:creator>
            <pubDate>Sat, 21 Mar 2020 19:31:19 GMT</pubDate>
            <atom:updated>2020-03-21T19:31:19.493Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong><em>Machine learning</em></strong><em> is the key to success in the present business scenario.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*nobJEEOyTTPEi-Jk.jpg" /></figure><h3>Table of contents:</h3><p>1. Introduction:</p><p>2. Prerequisites</p><p>3. Business problem</p><p>4. Machine learning problem</p><p>5. Data Set Information:</p><p>6. EDA and Data Cleaning</p><p>7. Splitting of data</p><p>8. Data Imputation:</p><p>9. Standardizing the data</p><p>10 Applying Different ML Models</p><p>11. Summary</p><p>12. References</p><h3>1. Introduction:</h3><p>Can you imagine how difficult it is to get business from a new customer as compared to an old customer? A lot of human effort and resources are spent by the company to attract new customer, but still, the companies were not sure whether the customer will show their faith on them.so in place of focusing on the new customer it is wise to focus on our pre-existing customer base and come up with a product based on our pre-existing customers need, want, desire.</p><h3>2. Prerequisites</h3><p>This post assumes familiarity with basic knowledge of Machine Learning techniques, python syntax, some libraries like pandas, NumPy, sklearn, etc.</p><h3>3. Business problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*l9xxq7UHym0RliMfbUg98w.jpeg" /></figure><p>There has been a revenue decline for the Portuguese bank, and they would like to know what actions to take. After investigation, we found out that the root cause is that their clients are not depositing as frequently as before. Knowing that term deposits allow banks to hold onto a deposit for a specific amount of time, so banks can invest in higher gain financial products to make a profit. In addition, banks also hold a better chance to persuade term deposit clients into buying other products such as funds or insurance to further increase their revenues. As a result, the Portuguese bank would like to identify existing clients that have a higher chance to subscribe for a term deposit and focus marketing effort on such clients.</p><h3>4. Machine learning problem</h3><p>A<a href="https://towardsdatascience.com/machine-learning-classifiers-a5cc4e1b0623"> classification approach</a> to predict which clients are more likely to subscribe for term deposits.</p><h3>5. Data Set Information:</h3><p>Data is collected from UCI Machine learning Repository.</p><p>Link: <a href="https://archive.ics.uci.edu/ml/datasets/Bank+Marketing">https://archive.ics.uci.edu/ml/datasets/Bank+Marketing</a></p><p>The data is related to with direct marketing campaigns of a Portuguese banking institution. The marketing campaigns were based on phone calls. Often, more than one contact to the same client was required, to access if the product (bank term deposit) would be (‘yes’) or not (‘no’) subscribed.</p><p>The following categories of information are included in the data set:</p><p>1) Consumer data: Age, sex, job, and marital status, education, loan status, and so on.</p><p>2) Campaign activities: When and how to contact, times to contact, the outcome of previous campaigns.</p><p>3) Social and economic environment data: <a href="https://www.euribor-rates.eu/en/what-is-euribor/">Euribor 3 month rate</a>, <a href="https://www.quora.com/What-is-meant-by-employment-variation-rate-Does-it-affect-in-any-way-the-financial-decisions-that-an-individual-takes">employment variation rate</a>, <a href="https://www.investopedia.com/terms/c/consumerpriceindex.asp">consumer price index</a>, and <a href="https://en.wikipedia.org/wiki/Consumer_confidence_index">consumer confidence index</a>.</p><p>4)Outcome: A ‘yes’ for the bank if there is a term deposit subscribed, a ‘no’ for the other outcome</p><h3>6. EDA and Data Cleaning</h3><h4>Data Reading</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*eYVSaJ-kmWb0Nj4SBxNsuw.png" /><figcaption>Top 5 rows of data</figcaption></figure><h4>Data Overview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*AZ5hner212BTIAfVpdOUkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*7T1xMo7DMl6cYxNJ.png" /><figcaption>Data is highly imbalanced. the number of people saying no to term deposit is more than the people saying yes.</figcaption></figure><h4>Knowing the categorical variables</h4><ol><li>Job</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*0IiM9T1uz1btingUle_uvg.png" /><figcaption>Job — More Job types are Admin, Technician, and blue-collar and it means bank targeting high salaried people.</figcaption></figure><p>2. Marital status</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*iWPwytYtmFaV9dx7q4Jlfw.png" /></figure><p>3. Education</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*U9RY-Zk8AWf0tMZRym3C1A.png" /><figcaption>Education — more count in university. Degree people, of course, High salaried people should have university degrees expected. And the illiterate count is very less.</figcaption></figure><p>4. Housing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*A7ZhXiSXQ7LyqHhZ015U5g.png" /><figcaption>Housing — we must give more importance to people who have not taken any housing loan</figcaption></figure><h3>Visualize the relationship between feature category vs dependent variable y</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*Rwr1H4KpR0mAzXSKeCF_EQ.png" /><figcaption><em>Positive values imply this category favors clients that will subscribe and negative values categories that favour not buying.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*iTqlSX32FXqEL2LwSfDMLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*bL-Qz5MKuNfIe3dQPT4Kdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*lSU4JbENdcuDxIxGvJz_fA.png" /><figcaption>People who didn’t take the loan have applied for term deposits.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*rGopVidpFx_6ywExhPxEPQ.png" /><figcaption>People who have houses have applied for term deposits.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*AISo3pVm04rRQzq_jwVfjg.png" /><figcaption>The successful outcome of a previous marketing campaign has more chance of going for a term deposit.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*YJNQrnla3HslYMR32Fc8ZQ.png" /><figcaption>In month September, October, April, December, march people have more applied for a term deposit.</figcaption></figure><p>Inference and result drown from the previous results.</p><ol><li>There are unknown values for many variables in the Data set. There are many ways to handle missing data. One of the ways is to discard the row but that would lead to a reduction of data set and hence would not serve our purpose of building an accurate and realistic prediction model.</li><li>Another method is to smartly infer the value of the unknown variable from the other variables. This a way of doing an imputation where we use other independent variables to infer the value of the missing variable. This doesn’t guarantee that all missing values will be addressed but the majority of them will have a reason which can be useful in the prediction.</li><li>Variables with unknown/missing values are: ‘education’, ‘job’, ‘housing’, ‘loan’, ‘default’, and ‘marital’. But the significant ones are ‘education’, ‘job’, ‘housing’, and ‘loan’. The number of unknowns for ‘marital’ is very low. The unknown for the ‘default’ variable is considered to be recorded as unknown. It may be possible that the customer is not willing to disclose this information to the banking representative. Hence, the unknown value in ‘default’ is actually a separate value.</li><li>Therefore, we start with creating new variables for the unknown values in ‘education’, ‘job’, ‘housing’ and ‘loan’. We do this to see if the values are missing at random or is there a pattern in the missing values.</li></ol><h3>7. Splitting of data</h3><p>Here we split our data into train and test set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*TeFXnq4Dbxx9VaNbQ3uVjg.png" /></figure><p>We checked the distribution of class label in train data:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*CHfvN9c7XzWsvuLugW63cw.png" /><figcaption>The data is highly imbalanced. We have to keep in mind that the negative class might affect the prediction of the positive class.</figcaption></figure><p>We checked the distribution of class label in test data:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*jtil8_33uoBDmNtbm7Dt8g.png" /></figure><h3>8. Data Imputation:</h3><p>(here we try to data imputation in case of train data. But, not in case of test data)</p><p>Now, to infer the missing values in ‘job’ and ‘education’, we make use of the cross-tabulation between ‘job’ and ‘education’. Our hypothesis here is that ‘job’ is influenced by the ‘education’ of a person. Hence, we can infer ‘job’ based on the education of the person. Moreover, since we are just filling the missing values, we are not much concerned about the causal inference. We, therefore, can use the job to predict education.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*lRHY1wOvr9VoZjZ2q5JCvQ.png" /></figure><ul><li>Inferring education from jobs: From the cross-tabulation, it can be seen that people with management jobs usually have a university degree. Hence wherever ‘job’ = management and ‘education’ = unknown, we can replace ‘education’ with ‘university.degree’. Similarly, ‘job’ = ‘services’ → ‘education’ = ‘high.school’ and ‘job’ = ‘housemaid’ → ‘education’ = ‘basic.4y’.</li><li>Inferring jobs from education: If ‘education’ = ‘basic.4y’ or ‘basic.6y’ or ‘basic.9y’ then the ‘job’ is usually ‘blue-collar’. If ‘education’ = ‘professional.course’, then the ‘job’ = ‘technician’.</li><li>While imputing the values for job and education, we were cognizant of the fact that the correlations should make real-world sense. If it didn’t make real-world sense, we didn’t replace the missing values.</li></ul><p><strong>Inferring jobs from age</strong></p><p>As we see, if ‘age’ &gt; 60, then the ‘job’ is ‘retired,’ which makes sense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*UDfo8H0FPiiecQsLcBsYxA.png" /></figure><p>Imputation for house and loan</p><p>We are again using cross-tabulation between ‘house’ and ‘job’ and between ‘loan’ and ‘job.’ Our hypothesis is that housing loan status (Yes or No) should be in the proportion of each job category. Hence using the prior known distribution of the housing loan for each job category, the house loan for unknown people will be predicted such that the prior distribution (% House = Yes’s and No’s for each job category remains the same). Similarly, we have filled the missing values in the ‘loan’ variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*YXDz8Ij-ev7ZkTO16ypYxA.png" /></figure><h3>9. Standardizing the data</h3><p>We are Standardizing our data so that it becomes scale independent. We use MinMaxScalar() for normalizing our data. Now our data lies between [0,1].</p><p><a href="https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html"><strong><em>Click here</em></strong> </a>to know about the min-max Standardizing technique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*Tu4HfTW5J9h2m-MRQCnibw.png" /></figure><h4>Converting all categorical variable to numerical</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*rYShXicQ6I-30L3_4d2P_A.png" /></figure><h4>The heat map on the train data feature</h4><p><a href="https://blog.exploratory.io/quick-introduction-to-heatmap-c21a9f9e4644">Heat map </a>can be super useful when you want to see which intersections of the categorical values have a higher concentration of the data compared to the others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*s74Oayuv59y3g65IURN6sA.png" /><figcaption>Inferences: From the above heat map we can see that ‘y’ (our target variable) has a good correlation with ‘previous’, ‘emp.var.rate’, ‘euribor3m’, ‘nr.employed’, ‘pdays_missing’, ‘poutcome_success’ , ‘poutcome_nonexistent’and ‘pdays_bet_5_15’. We expect to see these independent variables as significant while building the models.</figcaption></figure><h3>10 Applying Different ML Models</h3><h3>Training Random Forest Classifier</h3><p>We found that n_estimator=100 is working well on train data. With AUC = 0.65</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*rNlX6tZJIiMfhlhrkkmmpA.png" /></figure><p>from the above, we try to derive the most important feature</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*eB6dc8fo8guTr0nskCyLvg.png" /></figure><h4>SVM classifier</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*rjNATYt9X7wiZnDDKCtNiw.png" /></figure><h4>Testing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*2PwLBU9NqwV6zKgbp75Rgw.png" /></figure><h4>Important feature</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*-LPZfgz6gCaAcD6naMZwEQ.png" /></figure><h3>11. Summary</h3><p>We have applied a bunch of classifiers, Let’s have a summary table of all the experiments done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*Umr_rYHXKXvJjS93DkWGCw.png" /></figure><p>I have shared only the best result here, for full code and experiment analysis with different models please visit my <a href="https://github.com/maityashim/Machine-Learning-Project-on-Bank-Marketing-Data-Set/blob/master/Bank_Marketing.ipynb"><strong><em>GitHub page</em></strong></a><strong><em>.</em></strong></p><p>Thanks a lot for reading.</p><h3>12. References</h3><p><a href="https://archive.ics.uci.edu/ml/datasets/bank+marketing">https://archive.ics.uci.edu/ml/datasets/bank+marketing</a></p><p><a href="https://www.kaggle.com/yufengsui/portuguese-bank-marketing-data-set">https://www.kaggle.com/yufengsui/portuguese-bank-marketing-data-set</a></p><p><a href="https://github.com/HegdeChaitra/Bank-Marketing-Campaign-Analysis/blob/master/predicting-bank-marketing.pdf">https://github.com/HegdeChaitra/Bank-Marketing-Campaign-Analysis/blob/master/predicting-bank-marketing.pdf</a></p><h3>You can reach me at:-</h3><p><a href="http://www.linkedin.com/in/ashim-maity">www.linkedin.com/in/ashim-maity</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6e4024c7028" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>