<?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 Navjiwan Hira on Medium]]></title>
        <description><![CDATA[Stories by Navjiwan Hira on Medium]]></description>
        <link>https://medium.com/@navjiwanhira?source=rss-74c72a0fc3b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W7HtZad-cm92VetYJEqI1w.jpeg</url>
            <title>Stories by Navjiwan Hira on Medium</title>
            <link>https://medium.com/@navjiwanhira?source=rss-74c72a0fc3b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 20:36:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@navjiwanhira/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[Case Study 2: Neural Networks for Fashion Image Classification]]></title>
            <link>https://medium.com/@navjiwanhira/case-study-2-neural-networks-for-fashion-image-classification-898daae3863c?source=rss-74c72a0fc3b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/898daae3863c</guid>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Navjiwan Hira]]></dc:creator>
            <pubDate>Tue, 23 Aug 2022 11:31:17 GMT</pubDate>
            <atom:updated>2022-08-23T11:31:17.978Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Case Study 2: Neural Networks for Fashion Image Classification</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-WjZPcgfMBdB1heCQPD0w.png" /></figure><p><strong>Contents:-</strong></p><p><strong>1.</strong> <strong>Business Problem</strong></p><p><strong>2.</strong> <strong>Using Deep-Learning to solve the problem</strong></p><p><strong>3.</strong> <strong>Source of Data</strong></p><p><strong>4.</strong> <strong>Existing Approaches</strong></p><p><strong>5.</strong> <strong>Exploratory Data Analysis</strong></p><p><strong>6.</strong> <strong>Classification</strong></p><p><strong>7.</strong> <strong>Handling Data Imbalance</strong></p><p><strong>8.</strong> <strong>Models and Methodology</strong></p><p><strong>9.</strong> <strong>Results</strong></p><p><strong>10.</strong> <strong>References and</strong> <strong>Link to my profile (Linkedin)</strong></p><p><strong>1.</strong> <strong>Business Problem</strong></p><p>The ultimate power of e-commerce lies in providing a trouble-free buying experience as well as delivery to the user/buyer. Currently, there are two potentially challenging problems faced by e-commerce industry where one is from the seller’s perspective and the other is from the buyer’s perspective. The problem faced by sellers pertains to uploading the pictures of products on a particular platform for the purpose of selling and tag appropriate labels to each product which would render the product in search results. That also gives rise to mis-classifications of products if labeling is incorrect, thus, leading to the absence of product from the search results. Another problem from the buyer’s perspective occurs when a customer may not be aware of the appropriate key-words required to search a particular product but has a visual impression of the image in his/her device. Therefore, an image based search algorithm can tap into the true potential of ecommerce by enabling customers to take a picture of an object and search for related products without the need for typing the exact name of the product.</p><p><strong>2.</strong> <strong>Using Deep-Learning to solve the problem</strong></p><p>The dataset for solving the current business problem of e-commerce fashion industry is available on kaggle and it is a clean dataset but it is highly imbalanced for the purpose of using machine-learning algorithms which cannot enable image classification. Therefore, deep learning algorithms are used to solve the current problem.</p><p><strong>3.</strong> <strong>Source of Data</strong></p><p>The data for the present problem is obtained from kaggle from the following link:-</p><p><a href="https://www.kaggle.com/datasets/paramaggarwal/fashion-product-images-small">https://www.kaggle.com/datasets/paramaggarwal/fashion-product-images-small</a></p><p>To help us get started easily, kaggle has exposed some of the key product categories and it’s display name used is “styles.csv”. Each product is identified by an ID like 42431. Also, one can find a map to all the products in styles.csv. From there, it is possible to fetch an image for this product from images/42431.jpg. The styles.csv consists of 44424 images and image folder consists of 44441 images. The images are provided in jpg format with each image of size 80*60 pixels in 3 color channels. In addition to this, all the images are coloured images which makes it closer to a real life business problem.</p><p><strong>4.</strong> <strong>Existing Approaches</strong></p><p><strong>Fengzi Li et al., (2020) </strong>who worked on this problem earlier used transfer learning to solve the current problem of image classification. In order to balance the imbalanced dataset, they resorted to filtering of classes that have less than 500 images and further rebalancing was done via data augmentation technique with the help of ImageDataGenerator Class. As they used transfer learning, the models implemented by them were VGG-19 and Inception-V3, where they achieved higher accuracy from VGG-19, i.e. a test accuracy of 0.966.</p><p><strong>5.</strong> <strong>Exploratory Data Analysis</strong></p><p>Firstly, Exploratory Data Analysis (EDA) is conducted in an attempt to understand the dataset.</p><p>The styles.csv dataset which has 44424 images provides a description for each product as well as information about its attributes. The various categories for each product image are “gender”, “masterCategory”, “subcategory”, “articleType”, “baseColour”, “season”, “year” and “usage”. The categories are also shown below:-</p><p>a) On the basis of baseColour:</p><p>The dataset consists of 10 different colours for its images, where the colour “black” dominates over all other colours in its usage frequency (21.9%), followed by colour “White” (12.5%), “blue” (11.1%), “brown” (7.9%), “grey” (6.2%) and so on. The following code snippet was used to perform exploratory data analysis:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUwWWymC1E8ELwjvLzAanA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiegGs9D3mS9OYFy66yClw.png" /></figure><p>b) On the basis of usage:</p><p>The dataset consists of different attire styles for its product images, out of which “casual” dominates over all other styles by a great extent (78%), followed by “sports” style (9.1%), “ethnic” (7.3%) and “formal” style (5.3%) and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHM-4jz57xa29jKIamyMYg.png" /></figure><p><strong>c)</strong> <strong>On the basis of season:</strong></p><p>The dataset consists of different seasonal categories for each of its product image where the summer season collection (48.4%) dominates all other collections, followed by fall (25.7%), winter (19.2%) and spring (6.7%).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vmDMxo7fksKKP-99zqQ05g.png" /></figure><p><strong>6.Classification</strong></p><p>Each product image is identified by its numeric id and can be mapped to its metadata in styles.csv. Upon merger of the two, it is found that there are 44419 instances where image IDs are matched with the IDs in metadata file. Thereafter, three schemes are used for product classification as were used by Li Fengzi et al., (2020) and those are:- a concatenated Gender and Master Category, Sub Category and Article Type.</p><p>The Master Category has the following sub-categories as shown below:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*HiHPmaz2EZb-kj2vyk4yaQ.png" /></figure><p><strong>7.Handling Data Imbalance</strong></p><p>The technique used for handling imbalanced data is “data filtration”. There are a lot of classes consisting of very few images. For instance, articleType of wristbands has only 7 products while casual shoes have 2845 different products. So, in order to prevent data imbalance, the classes which have less than 500 images are removed. Below is a bar-chart of the categories remaining in master-category after selection of classes which have more than 500 images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zpzpLCFdV5yy5e88sDQ0Q.png" /></figure><p>Below is a bar-chart of the categories remaining in sub-category after selection of classes which have more than 500 images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7UbH3lqhi4c59PwZBhUikQ.png" /></figure><p>Below is a bar-chart of the categories remaining in article-type category after selection of classes which have more than 500 images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5E_cfBSQsFN70AAnEotHNQ.png" /></figure><p>Below is a bar-chart of categories remaining in concatenated Gender and Master Category after selection of classes which have more than 500 images:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SyuglvaSpyU8iLezqfNyw.png" /></figure><p>After the selection of classes, further rebalancing is done via data augmentation technique with the help of <em>ImageDataGenerator</em> Class function in keras which automatically augments the data while training a model. Below is a code snippet used for data augmentation:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUAINZSq1RRt9VFkG_ZgsQ.png" /></figure><p><strong>8. Models and Methodology</strong></p><p>For the current problem, the models are trained at three different levels of hierarchy in the product classification, viz. product categorization based on Gender and Master category combined, Sub-category and Article type. Since, training deep convolutional neural network model is computationally expensive when the dataset is large, we apply transfer learning using advanced pre-trained models such as VGG-19 and Inception-V3 for image classification. Transfer learning is a technique wherein we extract and re-use the model weights from previously trained models. The primary advantages of using transfer learning are that the time required to train the neural network is much lower and the model thus developed is more generalizable. In addition to this, in order to implement the visual search feature, i.e. to enable recommendation of products similar to the customer’s request, an auto-encoder based on CNN architecture is built.</p><p><strong>About VGG-19:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73s8822JfWTwTCjK-lewTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wGKTIDk_1Dod-Yx3azCRQ.png" /></figure><p><strong>About Inception-V3:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-Jhc7ZK_es_pQL0kmRikw.png" /></figure><p><strong>About CNN-based auto-encoder:</strong></p><p>Auto-encoders can be used to build similar images and are therefore useful for image-search and product recommendation. An encoder is used to generate embedding features. Once an auto-encoder model is trained, encoder function is used to predict embedding features for each image. After obtaining the embedding features from the encoder, cosine similarity scores are computed and most similar images are retrieved as per the score ranking.</p><p><strong>9. Results</strong></p><p><strong>VGG-19</strong></p><p>In the present work, the last five layers of VGG-19 are trained and the remaining layers are locked with pre-trained weights. In order to get the target number of classes, last layer using Softmax function is added to derive the class probability outputs. Also, regularization techniques like early-stopping and drop-outs are used to enable the construction of a deep and accurate neural network.</p><p>Below is a code snippet and image of the train and validation accuracy/loss obtained after implementing VGG-19:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aZxyLAIGnUAirIg6ZyPSHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UDb9kZlzM2dEmdH4GdfEg.png" /></figure><p><strong>Inception-V3</strong></p><p>The Inception-V3 was trained on Article-Type sub dataset. All the layers in the model were used except the last fully connected layer because it is specific to ImageNet competition. Since, the model has to predict classes, therefore categorical cross-entropy is used as a loss function.</p><p>Below is an image of the train and validation accuracy/loss obtained after implementing Inception-V3:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXSVZNwHGxHLt2XEzHh8FQ.png" /></figure><p><strong>CNN-based auto-encoder:</strong></p><p>On CNN-based auto-encoder, even after running 50 epochs, the accuracy obtained was quite low, the loss reduced to the extent that validation loss was 0.2318 and the train loss was 0.2328 and the recommended images produced by the auto-encoder gave poor results. The code snippet, the reduction in train and validation loss and the image results are shown below:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p89NQd2lUcSYQaIUJngBWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIrHPbqc7JFS_OM0jSwhgw.png" /></figure><p><strong>VGG-19 and Inception-V3 performance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*ZhAKIAK2roMkUz0IjsjTWw.png" /></figure><p>Thus, Inception-V3 gave the best accuracy.</p><p><strong>References:-</strong></p><p><a href="http://appliedaicourse.com/">appliedaicourse.com</a></p><p><a href="https://arxiv.org/abs/2005.08170">arXiv:2005.08170</a></p><p><strong>Link to my profile:-</strong> <a href="https://www.linkedin.com/in/navjiwan-hira-581a83181/">https://www.linkedin.com/in/navjiwan-hira-581a83181/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=898daae3863c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self Case Study: Santander Customer Satisfaction]]></title>
            <link>https://medium.com/@navjiwanhira/self-case-study-santander-customer-satisfaction-97a1f55335f2?source=rss-74c72a0fc3b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/97a1f55335f2</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Navjiwan Hira]]></dc:creator>
            <pubDate>Fri, 19 Aug 2022 13:41:07 GMT</pubDate>
            <atom:updated>2022-08-19T13:41:07.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xoOIpmyWPhwC6eQoV8rSQg.jpeg" /></figure><h3><strong><em>Contents :</em></strong></h3><blockquote><strong><em>1. Business Problem</em></strong></blockquote><blockquote><strong><em>2. Using Machine-Learning to solve the problem</em></strong></blockquote><blockquote><strong><em>3. Source of data</em></strong></blockquote><blockquote><strong><em>4. Existing Approaches</em></strong></blockquote><blockquote><strong><em>5. Exploratory Data Analysis</em></strong></blockquote><blockquote><strong><em>6. Handling data-imbalance using SMOTE</em></strong></blockquote><blockquote><strong><em>7. Featurization</em></strong></blockquote><blockquote><strong><em>8. My experiments with modeling</em></strong></blockquote><blockquote><strong><em>9. Summary of results and future work</em></strong></blockquote><blockquote><strong><em>10. Link to my profile (Github code and Linkedin)</em></strong></blockquote><h3><strong>1.</strong> <strong>Business Problem</strong></h3><p>Santander Customer Satisfaction — Which customers are happy customers?” is a Featured Prediction Competition hosted by Kaggle in 2016 on the behalf of “Banco Santander” Bank, which is a large Corporation focusing primarily on the market in the north-eastern part of United States.</p><p>Kaggle introduces the problem to its readers by harping on the significance of “customer satisfaction” as the key measure of a business success. They further impinge upon the fact that unhappy customers rarely express their dis-satisfaction before leaving. Therefore, it is expected of the participants in the competition to help identify dis-satisfied customers early on in the relationship so that proactive steps can be taken to improve customer satisfaction early on. The participants in the competition are expected to build a model that would help the prestigious Santander Bank to identify dis-satisfied customers as early as possible so that they may be in a position to take necessary action to retain those customers.</p><h3><strong>2.</strong> <strong>Using Machine-Learning to solve the problem</strong></h3><p>Santander Customer Satisfaction, being a “Classification-problem”, where it is to be predicted whether a customer is satisfied or not, therefore Machine-Learning is used to solve the above Classification problem. Various Machine-Learning algorithms are used to solve the above problem. In order to evaluate the Machine-Learning models, the evaluation metric used by Santander Bank is “AUC”. The top leadership score obtained on kaggle was 0.829072.</p><p>AUC is the area under the plot between True Positive Rate (TPR) and False Positive Rate(FPR) at different thresholds. AUC helps in determining whether a model is good at predicting classes. Higher the AUC, better the model is at predicting 0s and1s. AUC of 1 means that the model is a perfect classifier.</p><h3><strong>3. Source of data</strong></h3><p>Since “Santander Customer Satisfaction” is a kaggle problem, so data is obtained from the following kaggle link:</p><p><a href="https://www.kaggle.com/c/santander-customer-satisfaction/data">https://www.kaggle.com/c/santander-customer-satisfaction/data</a></p><p>The data is present in two files, i.e. train.csv and test.csv which contain 370 features each approximately and one dependent feature which we call the “Target-variable”. Each data-point in the train-set as well as test-set represents a customer where “1” in the Target-value represents a dis-satisfied customer and “0” represents a satisfied customer. But, the dataset is highly imbalanced. The data shared by Santander Bank constitutes of Train-set with 76020 observations, 370 features and one binary target, a Test-set with 75818 observations and 370 features and also a sample submission file. The data consists of hundreds of anonymized features, which are to be leveraged effectively to find an appropriate model and consequently enable prediction with respect to a client’s satisfaction/dis-satisfaction in the near future.</p><h3><strong>4.</strong> <strong>Existing Approaches</strong></h3><p><strong>van den Elsen, D. (2017)</strong> who worked on Santander Customer Satisfaction problem earlier used XG-Boost model. For preprocessing, they removed features with zero-variance, duplicated columns as well as sparse features. Also, they performed normalization and after that they removed all pairs of correlated features that had a high correlation value of 0.99 or higher. The AUC score obtained by them was 0.821777.</p><p>According to van (2017), the number of features in the Santander dataset is huge and therefore it is very difficult to individually analyze each and every feature. Therefore, he suggested grouping of similar features in the dataset. For example, the feature-names with substring “num” are grouped together, feature-names with sub-string “saldo” are grouped together. Also, according to them, some features are capable of being treated independently and they are not grouped together with any other feature.</p><p><em>As such, van (2017) has been very helpful in doing the “dataset column analysis” for the Santander Customer Satisfaction problem.</em></p><p><strong>Kaur et al., (2019):</strong> In a systematic literature review of 152 articles pertaining to data-imbalance challenges in Machine-Learning, Kaur et al., (2019), discuss different approaches of dealing with imbalanced data.</p><p>Firstly, the pre-processing approaches are discussed, which include “sampling-methods” and “feature-selection”. The various pros and cons of over-sampling and under-sampling methods which form a part of “sampling-methods” is discussed. According to them, over-sampling which basically increases minority class size, is flexible, free from classifier use but may cause over-fitting. On the other hand, under-sampling which basically deletes examples from majority class is domain specific, goal-oriented, is also free from classifier use but has chances of loosing useful information. Finally, they consider hybrid-sampling to be a combination of under-sampling and over-sampling methods and it ultimately reduces the limitations of both the previous methods (i.e. under-sampling and over-sampling).</p><p>Further, they proposed Synthetic Minority Over-Sampling Technique (SMOTE) in which synthetic samples are produced and suggested that SMOTE along with Random-Forest gives best results. SMOTE falls into the category of “hybrid sampling methods” because it uses a combination of under-sampling and over-sampling to overcome the issue of imbalanced data distribution.</p><p>Lastly, in the algorithm centered approaches, they discussed “Cluster based under-sampling” technique. Because there is a possibility of losing informative-instances with under-sampling, so to reduce the effect of under-sampling, cluster-based under-sampling technique is an alternative to random under-sampling.</p><p><em>As such, Kaur et al., (2019) has been very helpful in deciding the appropriate technique for handling class-imbalance in the “Santander Customer Satisfaction” problem.</em></p><h3><strong>5.</strong> <strong>Exploratory Data Analysis</strong></h3><p>Firstly, we check the data balance/imbalance of target-variable y.</p><p>We happen to find out that the dataset is highly imbalanced with only 3.96 percent dis-satisfied customers and 96.04 percent satisfied customers.</p><p><strong>a) Target: </strong>The dataset is highly imbalanced with only 3.96% dis-satisfied customers and 96.04% satisfied customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Mpb_pI6Tgwqy4XVgArXDPg.png" /></figure><p><strong>a) var15</strong>: As per literature, var15 represents “age” of customer as the minimum value of var15 is 5 and maximum value is 105. Var15 is a categorical feature with 100 categories. From the distributions below, we can see that both train and test set have similar distributions where most of the customers constitute “young-customers”, i.e. below the age of 40. With increase in age of customers, the frequency is decreasing, which means the bank has more young customers and less of old-aged customers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcyJGNjqDGCqM14-BJcP1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*VNokpkl8HVpqTLMyeID8Ag.png" /></figure><p>The minimum age of dis-satisfied customer is 23 and maximum age is 102.</p><p>From the bar-chart, we can see that most of the customers in different age-groups are satisfied. The number of dis-satisfied customers is very less as in the bar-chart, the frequency bar goes upto 800 only.</p><p><strong>b) var38:</strong> According to the Literature, var38 represents “Mortgage values”. The values of var38 are quite large numbers due to which the literature has documented that var38 represents mortgage values. The minimum value of feature-var38 is 5163 and maximum value of feature-var38 is 22034738. Number of unique values contained in var38 is 57736.</p><p><strong>c) var3: </strong>The literature reviewed assumes var3 to be representative of “nationality” of customers because var3 has 208 unique values. 208 seems to be a plausible number that the bank can supply. As such, var3 is a categorical feature with 208 categories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gd5KCCOwEsDRH5RSUpO6xQ.png" /></figure><p>The above plot shows higher frequency for lower values (values between 0 and 10) and then reducing frequency for the higher values. Which may be because the Bank might have set initial value numbers (like 1,2,3…10) for countries where it has bigger volume of operations as compared to other countries.</p><p><strong>d) num_var4: </strong>num_var4 is a categorical feature with 8 categories. As per literature, this variable-feature num_var4 represents the &quot;number of bank products&quot; held by each customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmGq7XCzd3j0cXbcsmtXLg.png" /></figure><p>From the bar-chart above, we can see that maximum customers of the bank hold one product. However, fewer people hold multiple products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*dNd1vyFCh1Vo7l3GFwHc-A.png" /></figure><p>The above distribution shows that fewer people have multiple products with the bank. Customers who have multiple products with the bank are more satisfied with the bank’s services as compared to customers with only one product.</p><p>e) <strong>Var21:</strong> var21 is a categorical feature with 24 categories. As per the literature, var21 is a highly imbalanced feature where non-zero values do not give off any likely meaning as their percentage count is very low. Even in analysis, it is observed that in var21, value “0” occurs way more frequently than any other value in the feature var21.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D0JSSbQ2EfKR7hxNrriTdA.png" /></figure><p><strong>e) Var36:</strong> var36 is a categorical feature with 5 categories. The Literature is unable to determine what does “var36” stand for. However, due to one value being so large (99) than rest of the values (0,1,2,3) — -it seems that value-99 may represent “missing-values”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vN8PUP8pCsSp3cQyDyUdWg.png" /></figure><p><strong>Features with key-words:-</strong> There are features with basically five types of key-words, i.e. “num”, “ind”, “imp”, “saldo”, “delta”. There were several features which had specific keywords in them such as ‘imp’. From Exploratory Data Analysis, we can observe that the maximum number of features exist with “num” keyword followed by “ind” and then “saldo” , “imp” and lastly by “delta”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*aM3kyMJ_gObcqqQhocF3xg.png" /></figure><p>From the bar chart on the left, we can observe that the maximum number of features exist with “num” keyword followed by “ind” and then “saldo” and lastly by “imp”.</p><h3><strong>6.</strong> Handling data-imbalance using <strong>SMOTE</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*LGBZM-LAw6Z6pGCL.jpg" /></figure><p>SMOTE which stands for Synthetic Minority Oversampling Technique, is an over-sampling technique that creates synthetic minority class data points to balance the dataset. SMOTE works using a k-nearest neighbor algorithm to create synthetic data-points. The steps of SMOTE algorithm are:</p><p>a. First, identify the minority class-vector.</p><p>b. Then, decide the number of nearest numbers(k), to consider.</p><p>c. Compute a line between the minority data-points and any of its neighbors and place a synthetic point.</p><p>d. Repeat step 3 for all minority data-points and their k-neighbors, till the data is balanced.</p><h3><strong>7.</strong> <strong>Featurization:</strong></h3><p>Firstly, we get those features which have less than or equal to 10 unique values. Such features are identified as “categorical features”. Then again we identify those features which have more than 10 unique values and we classify them as “numerical” features.</p><p>Thereafter, the numerical features are encoded using min-max scalar while the categorical features are encoded using one-hot encoding method.</p><h3><strong>8.</strong> <strong>My experiments with modelling:</strong></h3><p>Initially, the dataset was balanced using SMOTE technique. After that, the dataset was split randomly with stratification for ‘TARGET’ (which ensures equal proportion of ‘TARGET’ values in both train and test) with 80:20 split.</p><p>Then Logistic-Regression, k-nn, Naïve-Bayes, Random Forest, XGBoost, Cat Boost and Light-GBM and stacking-classifier models were created based on the <strong>dataset obtained after splitting</strong>. The best hyper-parameters are found using <strong>Random Search CV for some models and Grid-search CV for others.</strong></p><p>The best models obtained are then trained on the train dataset. A classifier is then trained on top of this dataframe (stacking). In this, the classifier used is Light GBM model.</p><h3><strong>9.</strong> <strong>Summary of results and future work:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*wFfN70zHyXX1jQjvwiwuFA.png" /><figcaption>Comparative-Analysis of different models</figcaption></figure><p>For future work, we can do more of Feature-Engineering and train some more models. We can also try to do an Exploratory Data Analysis on post training analysis and see which points are causing the issue.</p><p><strong>Link to my profile on Linkedin:</strong> <a href="https://www.linkedin.com/in/navjiwan-hira-581a83181/">https://www.linkedin.com/in/navjiwan-hira-581a83181/</a></p><p><strong>Link to my Github profile</strong>: <a href="https://github.com/Navjiwan15/Santander-Customer-Satisfaction-Case-study">https://github.com/Navjiwan15/Santander-Customer-Satisfaction-Case-study</a></p><p><strong>References:</strong></p><p><a href="http://appliedaicourse.com/">appliedaicourse.com</a></p><p><a href="https://towardsdatascience.com/stop-using-smote-to-handle-all-your-imbalanced-data-34403399d3be">https://towardsdatascience.com/stop-using-smote-to-handle-all-your-imbalanced-data-34403399d3be</a></p><p>Kaur, H., Pannu, H. S., &amp; Malhi, A. K. (2019). A systematic review on imbalanced data challenges in machine learning: Applications and solutions. <em>ACM Computing Surveys (CSUR)</em>, <em>52</em>(4), 1–36.</p><p>van den Elsen, D. (2017). Santander Customer Satisfaction.</p><p><a href="https://heartbeat.fritz.ai/hands-on-with-feature-engineering-techniques-transforming-variables-acea03472e24">https://heartbeat.fritz.ai/hands-on-with-feature-engineering-techniques-transforming-variables-acea03472e24</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97a1f55335f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>