<?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 Ankit on Medium]]></title>
        <description><![CDATA[Stories by Ankit on Medium]]></description>
        <link>https://medium.com/@ankitem745?source=rss-d109b81f20a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0I3s5HQdUFpowd0R</url>
            <title>Stories by Ankit on Medium</title>
            <link>https://medium.com/@ankitem745?source=rss-d109b81f20a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:17:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ankitem745/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[DMart: Most Successful Indian Chain of Hypermarkets(DMart -Case Study)]]></title>
            <link>https://medium.com/@ankitem745/dmart-most-successful-indian-chain-of-hypermarkets-dmart-case-study-c2089f3ceb30?source=rss-d109b81f20a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2089f3ceb30</guid>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[d-mart]]></category>
            <dc:creator><![CDATA[Ankit]]></dc:creator>
            <pubDate>Mon, 05 Sep 2022 04:29:10 GMT</pubDate>
            <atom:updated>2022-09-05T04:29:10.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*dg7IHoBUEtLvBazY.jpg" /></figure><p>D’Mart is an Indian chain of hypermarkets established by DMart owner Radhakishan Damani on May 15, 2002. DMart has 214 stores in 72 cities across 11 states in India including Maharashtra, Andhra Pradesh, Telangana, Gujarat, Madhya Pradesh, Chhattisgarh, Rajasthan, National Capital Region, Tamil Nadu, Karnataka, Uttar Pradesh, Daman, and Punjab. So, let’s get started with the D’mart case study.</p><p>Mumbai-headquartered DMart is owned and operated by Avenue Supermarts Ltd. (ASL). After the IPO posting (as Avenue Supermarts Ltd.), it made a record opening on the National Stock Exchange(NSE). DMart’s valuation rose to ₹39,988 crore after the close of the stock on 22 March 2017. This made DMart the 65th most significant Indian firm, followed by <a href="https://startuptalky.com/britannia-success-story/">Britannia Industries</a>, Marico, and Bank of Baroda. As of 21 November 2019, the market capitalization of DMart was around ₹114,000 crore, taking it to the 33rd position of all recorded organizations on the Bombay Stock Exchange.</p><p>This article will shed insights on the supply chain model of DMart, its business model, marketing strategies, How DMart was started, key financial highlights of DMart, growth, and future of DMart in India &amp; more.</p><blockquote>In this Dmart Case Study, we have discussed the -</blockquote><blockquote><a href="https://startuptalky.com/dmart-case-study/#DMart_-_Company_Highlights">DMart — Company Highlights</a><br><a href="https://startuptalky.com/dmart-case-study/#Foundation_of_DMart_&amp;_Why_Dmart_is_Successful?">Foundation of DMart &amp; Why DMart is Successful?</a><br><a href="https://startuptalky.com/dmart-case-study/#Strategic_&amp;_Organization_Structure_of_DMart">Strategic &amp; Organization Structure of DMart</a><br><a href="https://startuptalky.com/dmart-case-study/#DMart_-_Business_Model_&amp;_Supply_chain_Model">DMart — Business Model &amp; Supply chain Model</a><br><a href="https://startuptalky.com/dmart-case-study/#Marketing_Strategy_of_DMart">Marketing Strategy of DMart</a><br><a href="https://startuptalky.com/dmart-case-study/#Factors_Affecting_the_Profit_of_DMart">Factors Affecting the Profit of DMart</a><br><a href="https://startuptalky.com/dmart-case-study/#DMart_-_Important_Financial_Metrics">DMart — Important Financial Metrics</a><br><a href="https://startuptalky.com/dmart-case-study/#Growth_of_DMart_in_India">Growth of DMart in India</a><br><a href="https://startuptalky.com/dmart-case-study/#Future_of_DMart">Future of DMart</a></blockquote><h3>DMart — Company Highlights</h3><p>Company Name — D Mart Founder Radhakishan Damani</p><p>Founded — 15 May 2002 Headquarters, Mumbai</p><p>SubsidiariesAvenue- E-Commerce Limited, Avenue Food Plaza Private LimitedParent CompanyAvenue Supermarts Limited</p><h3>Foundation of DMart &amp; Why DMart is Successful?</h3><p>Unlike Flipkart was established by two 25-year-old youngsters toward the beginning of their professions, DMart’s establishing story couldn’t have been more extraordinary as DMart was established in 2002 by a then-45-year-old Radhakishan Damani at a moment that he’d effectively made his millions. When he established DMart, Damani was an incredible name in Indian securities exchanges. He had already got a few worth stocks that surpassed Gillette and HDFC Bank’s valuations.</p><p>Damani, who dropped out of a trade degree after the primary year, had first joined his dad’s metal rollers business, yet had begun putting resources into stocks when he was 32. He wound up getting to be one of the greatest stock financial specialists of the 90s, and current securities exchange bull Rakesh Jhunjhunwala believes him to be a tutor. In any case, after an effective financial exchange profession putting resources into shopper confronting organizations, Damani chose to begin his own.</p><p>On May 15, 2002, Damani established the grocery store chain DMart and embraced techniques that were one of a kind in Indian retail. Up to that point, most retail chains rented their stores, yet DMart picked carefully do its exploration and possessed its very own stores by and large. That technique appears to have worked as DMart has never needed to close down a store since it’s opened in every one of the long periods of its activity.</p><p>While other retail players forayed into different classifications, including hardware and design, DMart stayed focussed on its center sustenance and basic food item business. What’s more, when other store chains are on the whole propelling their very own private brands in an offer to improve edges, DMart still stocks just outsider items.</p><p>It’s this moderate methodology that has worked for DMart. Other retail chains were picking development, yet for the initial 15 years, Dmart just worked its stores in 4 states. Indeed, even today, the company has 214 stores in 72 cities across 11 states. DMart had a benefit-to-deals proportion of 3.7%.</p><p>In correlation, other significant Indian retailers don’t passage very also Future Group has a benefit to deals proportion of 0.21%, Spencer’s Retail had a negative benefit to deals proportion of — 8.9%, and Reliance Retail which works high-edge classifications including hardware and adornments and has more than double the incomes of DMart just dealt with a benefit to deals proportion of 1.6%.</p><p>DMart’s traditionalist yet beneficial approach is by all accounts demonstrated after its author. Damani is famously media-bashful and gives no meetings. He’s said to be modest, all things considered, also he doesn’t appear to talk much, yet is evidently a decent audience, engrossing a lot of data rapidly, and afterward following up on it.</p><p>And keeping in mind that Damani’s success has made him hugely rich because of the flood in DMart’s stock value, he’s currently worth $15.5 Billion (over Rs 116,200 Crores) regardless he wears a white shirt and white jeans to work, the dress he’s been wearing since the 80s. Despite everything, he goes for night strolls on Girgaum Chowpatty in Mumbai and unconditionally converses with the outsiders who approach him after his Dmart’s open achievement.</p><p>As time is limited further points will be discussed in the next chapter of this Case study. Stay connected………!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2089f3ceb30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Approach designing an A/B test]]></title>
            <link>https://medium.com/@ankitem745/approach-designing-an-a-b-test-7ed8ed97d7ce?source=rss-d109b81f20a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ed8ed97d7ce</guid>
            <dc:creator><![CDATA[Ankit]]></dc:creator>
            <pubDate>Mon, 29 Aug 2022 03:40:27 GMT</pubDate>
            <atom:updated>2022-08-29T03:40:27.799Z</atom:updated>
            <content:encoded><![CDATA[<p>When researchers test the efficacy of new drugs, they use a “split test.” Most research experiments could be considered a “split test,” complete with a hypothesis, a control, a variation, and a statistically calculated result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QmWLHMVZxjLoH2zY.jpg" /></figure><p>That’s it. For example, if you run a simple A/B test, it would be a 50/50 traffic split between the original page and a variation:</p><p>Essentially, A/B testing eliminates all the guesswork out of website optimization and enables experience optimizers to make data-backed decisions. In A/B testing, A refers to ‘control’ or the original testing variable. Whereas B refers to ‘variation’ or a new version of the original testing variable.</p><p>The version that moves your business metric(s) in the positive direction is known as the ‘winner.’ Implementing the changes of this winning variation on your tested page(s) / element(s) can help optimize your website and increase business ROI.</p><p>The metrics for conversion are unique to each website. For instance, in the case of eCommerce, it may be the sale of the products. Meanwhile, for B2B, it may be the generation of qualified leads.</p><blockquote><strong>The factors that we approach while designing an A/B test are:</strong></blockquote><ul><li>It is important to understand which statistical approach to adopt to successfully run an A/B test and draw the right business conclusion.</li><li>Ideally, there are two types of statistical approaches used by A/B experimenters across the globe: Frequentist and Bayesian. Each of these approaches has its pros and cons.</li></ul><p><strong>1) Frequentist approach:</strong></p><ul><li>The frequentist approach of probability defines the probability of an event with relation to how frequently (hence the name) a particular event occurs in a large number of trials/data points.</li><li>When applied to the world of A/B testing, one can see that anyone going with the frequentist approach would need more data (a function of more number of visitors tested and over longer durations) to come to the correct conclusions.</li><li>This is something that limits you from scaling up any A/B testing effort. According to the Frequentist approach, it is essential to define your A/B test’s duration based on sample size to reach the correct test conclusions. The tests are based on the fact that every experiment can be repeated infinite times.</li></ul><p><strong>2)Bayesian approach:</strong></p><ul><li>Bayesian statistics is a theory-based approach that deals with the Bayesian interpretation of probability, where probability is expressed as a degree of belief in an event.</li><li>In other words, the more you know about an event, the better and faster you can predict the end outcomes.</li><li>Rather than being a fixed value, probability under Bayesian statistics can change as new information is gathered. This belief may be based on past information such as the results of previous tests or other information about the event.</li><li>Unlike the frequentist approach, the Bayesian approach provides actionable results almost 50% faster while focusing on statistical significance.</li><li>At any given point, provided you have enough data at hand, the Bayesian approach tells you the probability of variation A having a lower conversion rate than variation B or the control.</li><li>It does not have a defined time limit attached to it, nor does it require you to have an in-depth knowledge of statistics.</li></ul><blockquote><strong>The significance level we would target in an A/B test</strong></blockquote><p>It depends on the statistic and the P-value itself</p><ul><li><strong>A/B testing statistics</strong></li></ul><p>Statistical knowledge is handy when analyzing A/B test results.</p><ul><li><strong>Why do you need to know statistics? Matt Gershoff likes to quote his college math professor: “How can you make cheese if you don’t know where milk comes from?!”</strong></li><li>There are three terms you should know before we dive into the nitty gritty of A/B testing statistics:</li><li><strong>Mean.</strong> We’re not measuring all conversion rates, just a sample. The average is representative of the whole.</li><li><strong>Variance</strong>. What is the natural variability of a population? That affects our results and how we use them.</li><li><strong>Sampling</strong>. We can’t measure the accurate conversion rate, so we select a sample that is (hopefully) representative.</li></ul><blockquote><strong>A/B testing with P-value</strong></blockquote><ul><li>A p-value is the measure of evidence against the null hypothesis (the control, in A/B testing parlance). A p-value does not tell us the probability that B is better than A.</li><li>Similarly, it doesn’t tell us the probability that we will make a mistake in selecting B over A. These are common misconceptions.</li><li>The p-value is the probability of seeing the current result or a more extreme one given that the null hypothesis is true. Or, “How surprising is this result?”</li></ul><blockquote><strong>How long should an A/B test run?</strong></blockquote><p>When someone asks how long should s/he run an A/B test, the ideal answer would be until eternity or till the time we get results (whichever is sooner). In an A/B test, we can never say with full confidence that we will get statistically significant results after running the test X number of days.</p><p>Instead, what we can say is that there is an 80% (or 95%, whatever you choose) probability of getting a statistically significant result (if it indeed exists) after X number of days. But, of course, it may also be the case that there is no difference in the performance of control and variation so no matter how long we wait, we will never get a statistically significant result.</p><p>we calculate the number of visitors needed to get significant results.</p><blockquote><strong>There are some common reasons A/B tests fail</strong></blockquote><p>A/B testing is one of the most effective ways to move business metrics in a positive direction and increase the inward flow of revenue. However, as stated above, A/B testing demands planning, patience, and precision. Making silly mistakes can cost our business time and money, which we can’t afford. To help avoid making blunders, here’s a list of some of the most common mistakes to remember when running an A/B test:</p><blockquote><strong>Not planning optimization Roadmap</strong></blockquote><ul><li><strong>Invalid hypothesis:</strong> In A/B testing, a hypothesis is formulated before conducting a test. All the next steps depend on it: what should be changed, why should it be changed, what the expected outcome is, and so on. If we start with the wrong hypothesis, the probability of the test succeeding decreases.</li><li><strong>Testing too many elements together</strong></li></ul><p>Testing too many elements of a website together makes it difficult to pinpoint which element influenced the test’s success or failure the most. The more the elements tested, the more needs to be the traffic on that page to justify statistically significant testing. Thus, prioritization of tests is indispensable for successful A/B testing.</p><ul><li><strong>Ignoring statistical significance</strong></li></ul><p>If we use gut feelings or personal opinions to find a way into hypothesis formulation or while we are setting the A/B test goals, it is most likely to fail. Irrespective of everything, whether the test succeeds or fails, we must let it run through its entire course so that it reaches its statistical significance.</p><ul><li><strong>Using unbalanced traffic</strong></li></ul><p>A/B testing should be done with the appropriate traffic to get significant results. Using lower or higher traffic than required for testing increases the chances of our campaign failing or generating inconclusive results</p><ul><li><strong>Testing for incorrect duration</strong></li></ul><p>Based on our traffic and goals, run A/B tests for a certain length of time to achieve statistical significance. Running a test for too long or too short a period can result in the test failing or producing insignificant results. Because one version of our website appears to be winning within the first few days of starting the test does not mean that we should call it off before time and declare a winner. Letting a campaign run for too long is also a common blunder that businesses commit. The duration for which we need to run our test depends on various factors like existing traffic, existing conversion rate, expected improvement, etc.</p><p>References</p><p><a href="https://youtu.be/eiIhTbFP0ls">https://youtu.be/eiIhTbFP0ls</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ed8ed97d7ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Explainability vs Interpretability]]></title>
            <link>https://medium.com/@ankitem745/machine-learning-explainability-vs-interpretability-aad7f3f26218?source=rss-d109b81f20a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/aad7f3f26218</guid>
            <dc:creator><![CDATA[Ankit]]></dc:creator>
            <pubDate>Sun, 21 Aug 2022 15:04:53 GMT</pubDate>
            <atom:updated>2022-08-21T15:04:53.173Z</atom:updated>
            <content:encoded><![CDATA[<p><em>We explain the key differences between explainability and interpretability and why they’re so important for machine learning and AI, before taking a look at several techniques and methods for improving machine learning interpretability.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*JgJYniBe8oAjG990U4685A.png" /><figcaption>A Venn Diagram of the relationship between Explainability, Interpretability and Transparency. Notice the centrality of Feature Analysis to 4 of the 5 interpretable elements.</figcaption></figure><p>It doesn’t take a data scientist to work out that the machine and deep learning algorithms built into automation and artificial intelligence systems lack transparency. It also doesn’t take a great deal of detective work to see that many of these systems contain an imprint of the unconscious biases of the engineers that helped to develop them.</p><p>Arguably, in the midst of what The Economist termed a <a href="https://www.economist.com/international/2017/08/10/internet-firms-face-a-global-techlash"><em>techlash</em></a>, this lack of transparency has only (ironically) become more visible. While many of the incidents that have contributed to the techlash are as many issues caused by a mixture of corporate self-interest and an alarming absence of governance and accountability, there’s no escaping the fact that the practice of data science and machine learning engineering naturally find their way hooked onto some of the year’s biggest business and politics stories.</p><p>It’s in this context that the concepts of explainability and interpretability <a href="https://hub.packtpub.com/improve-interpretability-machine-learning-systems/">have taken on new urgency</a>. It’s likely that they are only going to become more important in 2019, as discussions around the ethics of artificial intelligence continue.</p><p>But what are explainability and interpretability? And how what do they actually mean for those of us doing data mining, analysis, and science in 2019?</p><h3>The difference between machine learning explainability and interpretability</h3><p>In the context of machine learning and artificial intelligence, explainability and interpretability are often used interchangeably. While they are very closely related, it’s worth unpicking the differences, if only to see how complicated things can get once you start digging deeper into machine learning systems.</p><p>Interpretability is the extent to which a cause and effect can be observed within a system. Or, to put it another way, it is the extent to which you can predict what will happen, given a change in input or algorithmic parameters. It’s being able to look at an algorithm and go <em>yep, I can see what’s happening here.</em></p><p>Explainability, meanwhile, is the extent to which the internal mechanics of a machine or deep learning system can be explained in human terms. It’s easy to miss the subtle difference with interpretability but consider it like this: interpretability is about being able to discern the mechanics without necessarily knowing why. Explainability is being able to quite literally explain what is happening.</p><p>Think of it this way: say you’re doing a science experiment at school. The experiment might be interpretable insofar as you can see what you’re doing, but it is only really explainable once you dig into the chemistry behind what you can see happening.</p><p>That might be a little crude, but it is nevertheless a good starting point for thinking about how the two concepts relate to one another.</p><h3>Why are explainability and interpretability important in artificial intelligence and machine learning?</h3><p>If 2018’s techlash has taught us anything, it’s that although technology can certainly be put to dubious usage, there are plenty of ways in which it can produce poor — discriminatory — outcomes with no intention of causing harm.</p><p>As domains like healthcare look to deploy artificial intelligence and deep learning systems, where questions of accountability and transparency are particularly important, if we’re unable to properly deliver improved interpretability, and ultimately explainability, in our algorithms, we’ll seriously be limiting the potential impact of artificial intelligence. Which would be a shame.</p><p>But aside from the legal and professional considerations that need to be made, there’s also an argument that improving interpretability and explainability is important even in more prosaic business scenarios. Understanding how an algorithm is actually working can help to align better the activities of data scientists and analysts with the <a href="https://hub.packtpub.com/ux-designers-can-teach-machine-learning-engineers-start-model-interpretability/">key questions and needs of their organization</a>.</p><h3>Techniques and methods for improving machine learning interpretability</h3><p>While questions of transparency and ethics may feel abstract for the data scientist on the ground, there are, in fact, a number of practical things that can be done to improve an algorithm’s interpretability and explainability.</p><h4>Algorithmic generalization</h4><p>The first is to improve generalization. This sounds simple, but it isn’t that easy. When you think most machine learning engineering is applying algorithms in a very specific way to uncover a certain desired outcome, the model itself can feel like a secondary element — it’s simply a means to an end. However, by shifting this attitude to consider the overall health of the algorithm, and the data on which it is running, you can begin to set a solid foundation for improved interpretability.</p><h4>Pay attention to feature importance</h4><p>This should be obvious, but it’s easily missed. Looking closely at the way the various features of your algorithm have been set is a practical way to actually engage with a diverse range of questions, from business alignment to ethics. Debate and discussion over how each feature should be set might be a little time-consuming, but having that tacit awareness that different features have been set in a certain way is nevertheless an important step in moving towards interpretability and explainability.</p><h4>LIME: Local Interpretable Model-Agnostic Explanations</h4><p>While the techniques above offer practical steps that data scientists can take, LIME is an actual method developed by researchers to gain greater transparency on what’s happening inside an algorithm. The researchers explain that LIME can explain “the predictions of any classifier in an interpretable and faithful manner, by learning an interpretable model locally around the prediction.”</p><p>What this means in practice is that the LIME model develops an approximation of the model by testing it out to see what happens when certain aspects within the model are changed. Essentially it’s about trying to recreate the output from the same input through a process of experimentation.</p><h4>DeepLIFT (Deep Learning Important Features)</h4><p>DeepLIFT is a useful model in the particularly tricky area of deep learning. It works through a form of backpropagation: it takes the output, then attempts to pull it apart by ‘reading’ the various neurons that have gone into developing that original output.</p><p>Essentially, it’s a way of digging back into the feature selection inside of the algorithm (as the name indicates).</p><h4>Layer-wise relevance propagation</h4><p>Layer-wise relevance propagation is similar to DeepLIFT, in that it works backward from the output, identifying the most relevant neurons within the neural network until you return to the input (say, for example, an image). If you want to learn more about the mathematics behind the concept, <a href="http://danshiebler.com/2017-04-16-deep-taylor-lrp/">this post by Dan Shiebler is a great place to begin</a>.</p><h3>Adding complexity to tackle complexity: can it improve transparency?</h3><p>The central problem with both explainability and interpretability is that you’re adding an additional step in the development process. Indeed, you’re probably adding multiple steps. From one perspective, this looks like you’re trying to tackle complexity with even greater complexity.</p><p>And to a certain extent, this is true. What this means in practice is that if we’re to get really serious about interpretability and explainability, there needs to be a broader cultural change in the way in which data science and engineering are done, and how people <em>believe </em>it should be done.</p><p><strong>Resources:</strong></p><ul><li><a href="https://www.kdnuggets.com/education/online.html">Online and web-based: Analytics, Data Mining, Data Science, Machine Learning Education</a></li><li><a href="https://www.kdnuggets.com/software/index.html">Software for Analytics, Data Science, Data Mining, and Machine Learning</a></li></ul><p><strong>Related:</strong></p><ul><li><a href="https://www.kdnuggets.com/2018/12/four-approaches-ai-machine-learning.html">Four Approaches to Explaining AI and Machine Learning</a></li><li><a href="https://www.kdnuggets.com/2018/11/interpretability-trust-ai-machine-learning.html">Interpretability is crucial for trusting AI and machine learning</a></li><li><a href="https://www.kdnuggets.com/2018/11/using-uncertainty-interpret-model.html">Using Uncertainty to Interpret your Model</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aad7f3f26218" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recommendation System: NETFLIX Collaborative Filtering using Matrix Factorization]]></title>
            <link>https://medium.com/@ankitem745/recommendation-system-netflix-collaborative-filtering-using-matrix-factorization-2860ccd560c0?source=rss-d109b81f20a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2860ccd560c0</guid>
            <dc:creator><![CDATA[Ankit]]></dc:creator>
            <pubDate>Sun, 14 Aug 2022 15:27:32 GMT</pubDate>
            <atom:updated>2022-08-14T15:27:32.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGRVcVjdDDBrVzuGNaGuMw.png" /><figcaption>Netflix Movie Recommendation</figcaption></figure><p>Recommendation Systems are one of the most successful and fascinating applications of Machine Learning. Various sites like Netflix, YouTube, and Help use them to recommend movies, videos or services that we might like. Different businesses and product needs have enabled a variety of algorithms that could be used for recommender systems. Being extensively used in video streaming, music streaming or retail applications makes recommendation systems a must-know for Data Science enthusiasts.</p><p>Recommender systems typically produce a list of recommendations either through <strong><em>collaborative filtering </em></strong>or through<strong><em> content-based filtering</em></strong>. Modern recommenders combine both approaches. Collaborative filtering methods are based on similarity from user interaction and content-based filtering methods calculate the similarity of attributes of an item. In this article, we will focus on understanding <strong>Matrix Factorization </strong>— a collaborative filtering solution for recommendations, using simple examples.</p><p>In the rest of the article, we will introduce the recommendation task, briefly discuss the collaborative filtering technique for recommender systems and explain Matrix Factorization in detail.</p><h3>Recommendation Task</h3><p>We have a set of user <strong><em>U </em></strong>and a set of items <strong><em>I. </em></strong>The goal is to recommend items from <strong><em>I</em></strong> to the users based on their preferences. To solve this problem, we have to learn a function based on the past data that predicts how much each item <em>i</em><strong><em>∈I</em></strong> will be an appropriate recommendation for user <em>u</em><strong><em>∈U.</em></strong></p><h3>Collaborative Filtering</h3><blockquote><em>Collaborative filtering methods are based on collecting and analyzing a large amount of information on user behaviors, activities or preferences and predicting what users will like based on their similarity to other users.</em></blockquote><p>The fundamental assumption behind the collaborative filtering technique is that similar user preferences over the items could be exploited to recommend those items to a user who has not seen or used them before. In simpler terms, we assume that users who agreed in the past (purchased the same product or viewed the same movie) will agree in the future.</p><h3>Matrix Factorization</h3><p>Since the “<a href="https://www.netflixprize.com/">Netflix Price Challenge</a>”, Matrix Factorization has been one of the most famous and widely used Collaborative Filtering techniques. To explain Matrix Factorization, we will use a simple example of a movie recommendation.</p><p>Let&#39;s take the three tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZqrmqnV53Nv0yPgDhhgVfA.png" /><figcaption>How Do Humans Behave</figcaption></figure><p>There are three tables in the above image which do you think is the realistic Netflix table?</p><p>1 table contains different people and the different movies like M1, M2, M3…, and M5. I have assumed that all people have given the same kind of reviews which is not realistic data. The independent rows and columns of unrealistic data are filled in table 3. But table 2 dependent rows and columns has some realistic approaches to the data filled. How dependent let&#39;s see in the below diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtEt-kKcA5u5QlO5A-gSjQ.png" /><figcaption>See the first row and the 3 rows have similar reviews in terms of preferences</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q8Fu2qOjF980oFgTjrRbzA.png" /></figure><p>Take a look at other dependencies Since the M1 movie and M4 movies are not the same but they may have similarities in terms of comedy and Action. Overall they have some dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JifIYmwpfJK-v6M3eZKpvw.png" /></figure><p>They may also have some hidden dependencies you can see in the above diagram. there may have more dependencies depending on the data but these dependencies actually help us to guess the ratings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZN_Zv_U89DI1sijGvvpYQ.png" /></figure><p>Since A and C have the reviews so the recommended value for M5 by C is 1. This is for the simple example but for the difficult one or in the real world we have 1000 rows and 800 columns then how do we deal with that then Matrix factorization helps us to solve the problem.</p><blockquote>The aim is to find all these user and item dependencies in the Matrix.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*pPhdQ5RVJRIMhxSq.png" /><figcaption>Factorization</figcaption></figure><p>The solution to this problem is <strong>Matrix Factorization</strong>. So, what is factorization? In simpler terms, Factorization is the method of expressing something big as a product of smaller factors.</p><p>Similarly, Matrix Factorization finds two rectangular matrices with smaller dimensions to represent a big <strong><em>rating matrix </em></strong>(<em>RM</em>). These<strong> <em>factors </em></strong>retain the dependencies and properties of the rating matrix. One matrix can be seen as the <strong><em>user matrix</em></strong> (<em>UM</em>) where rows represent users and columns are <em>k latent factors</em>. The other matrix is the <strong><em>item matrix </em></strong>(<em>IM</em>)where rows are <em>k latent factors </em>and columns represent items. Here <em>k</em> &lt; number of items and <em>k &lt; </em>number of users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/0*g3oMHHrMdEon7dHi.jpeg" /></figure><p>The latent factors are otherwise called features. Features are characteristics of an item. In our case, features of the movies can be its genre, actors, plot, etc. The features chosen by the Matrix Factorization are irrelevant to the solution. Now the rating matrix is represented as a <strong>dot product </strong>of the user and item matrix.</p><p>We’ll now try to understand the features and the dot product of the factor matrices using the figure below. We will ignore other ratings in the rating matrix image for simplification. We’ll assume our factored matrices have only two features <strong>F1</strong> and <strong>F2. </strong>Having Ryan Reynolds in mind, we will assume <strong>F1</strong> to be “If its a movie with Marvel characters?” and <strong>F2</strong> to be “ If Ryan is there in the movie?”.</p><p><strong>User Matrix: </strong>According to Ryan, if it&#39;s a Marvel movie, he’ll give it 3 points and if he is in the movie, he’ll give it 2 more points (<em>Typical Ryan!</em>). <strong>Item Matrix: </strong>Item Matrix contains binary values where the value is 1 if conditions of features mentioned above are satisfied and 0 otherwise. By performing the dot product of the user matrix and item matrix,<em> Infinity War </em>gets 3 and <em>Deadpool </em>gets a 5. The latent factors are otherwise called features. Features are characteristics of an item. In our case, features of the movies can be its genre, actors, plot, etc. The features chosen by the Matrix Factorization are irrelevant to the solution. Now the rating matrix is represented as a <strong>dot product </strong>of the user and item matrix.</p><p>We’ll now try to understand the features and the dot product of the factor matrices using the figure below. We will ignore other ratings in the rating matrix image for simplification. We’ll assume our factored matrices have only two features <strong>F1</strong> and <strong>F2. </strong>Having Ryan Reynolds in mind, we will assume <strong>F1</strong> to be “If its a movie with Marvel characters?” and <strong>F2</strong> to be “ If Ryan is there in the movie?”.</p><p><strong>User Matrix: </strong>According to Ryan, if it&#39;s a Marvel movie, he’ll give it 3 points and if he is in the movie, he’ll give it 2 more points (<em>Typical Ryan!</em>). <strong>Item Matrix: </strong>Item Matrix contains binary values where the value is 1 if conditions of features mentioned above are satisfied and 0 otherwise. By performing the dot product of the user matrix and item matrix,<em> Infinity War </em>gets 3 and <em>Deadpool </em>gets a 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*SQ_V3BQKcesfvJLD.jpeg" /></figure><p>Now the important question here is:</p><blockquote><em>“HOW DO WE FIND THE RIGHT FACTORIZATION FOR A MATRIX?”</em></blockquote><p><strong>Machine Learning </strong>is the solution. The model learns to find latent factors to factorize the rating matrix. To arrive at the best approximation of the factors, <a href="https://en.wikipedia.org/wiki/Root-mean-square_deviation"><strong>RMSE</strong></a>(root mean squared error)<strong> </strong>is the cost function to be minimized. After Matrix factorization is done, the squared error is calculated for every movie rating in the rating matrix and the root value of the mean of squared error values is minimized. In order to minimize RMSE to learn the factors, <a href="https://en.wikipedia.org/wiki/Gradient_descent">Gradient Descent</a> and <a href="https://bugra.github.io/work/notes/2014-04-19/alternating-least-squares-method-for-collaborative-filtering/">Alternating Least Squares</a> are the two most used techniques.</p><blockquote><em>Voila! We have our </em><strong><em>USER Matrix </em></strong><em>and </em><strong><em>ITEM Matrix </em></strong><em>now.</em></blockquote><h3>How to use Matrix Factorization for Recommendation?</h3><p>I believe everyone will have a doubt about why we are creating this matrix. What is the use of these matrices we have spent so much time understanding?</p><p>In real-life scenarios, every user wouldn’t have seen all possible movies. So the rating matrix will look more empty — <strong>Sparse Matrix</strong>. In this case, the model still learns to factorize the sparse matrix, but RMSE will be calculated only for the ratings that are actually present in the matrix. After obtaining the best factors to approximate the ratings we have, we then perform the dot product of the factor matrices to fill in the missing entries in the rating matrix. These filled-in ratings are then used to provide recommendations to the users.</p><p>I believe that the above article was helpful to you in answering “What is Collaborative Filtering?”, “What is Matrix Factorization?” and “How to use Matrix Factorization for providing recommendations?”.</p><p>There is more to this topic like what algorithms to use to minimize the error function and other recommendation techniques. As mentioned earlier, we can minimize the error function using the Alternative Least Squares method for parallelization of the learning process or Gradient Descent. That information is for another blog post.</p><p><strong><em>R</em></strong><a href="https://youtu.be/ZspR5PZemcs"><strong><em>eferences</em></strong></a> -<a href="https://youtu.be/ZspR5PZemcs">https://youtu.be/ZspR5PZemcs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2860ccd560c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dimensionality Reduction using Principal Component Analysis(PCA)]]></title>
            <link>https://medium.com/@ankitem745/dimensionality-reduction-using-principal-component-analysis-pca-72fd88d51fd8?source=rss-d109b81f20a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/72fd88d51fd8</guid>
            <dc:creator><![CDATA[Ankit]]></dc:creator>
            <pubDate>Sun, 07 Aug 2022 14:23:26 GMT</pubDate>
            <atom:updated>2022-08-07T14:23:26.840Z</atom:updated>
            <content:encoded><![CDATA[<p>This is very interesting to know that while working on a project with features like 800 and above. And it isn&#39;t easy to deal with so many features so PCA plays a very interesting role to reduce the without losing much information of features. Let&#39;s unbox the black box of PCA step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8w2bnk6k9BlT30pG.jpg" /><figcaption>Conversion multi-dimension to 2-D dimension</figcaption></figure><blockquote><strong>TOPICS</strong><br>Introduction to PCA<br>PCA Process Steps<br>Data Standardization<br>Finding Covariance Matrix of our Dataset<br>Eigenvectors and Eigenvalues<br>Recast Data using new PCAs<br>Explained Variance Ratio and Scree Plot</blockquote><h3><strong>PCA — Definition</strong></h3><p><strong>PCA</strong> is an <strong>unsupervised dimensionality reduction algorithm</strong> to find<br>a <strong>more meaningful basis or coordinate system (axis)</strong> for our data<br>and <strong>works based on a covariance matrix to find the strongest<br>features of your samples</strong>.</p><p>It is used when <strong>we need to tackle the ’curse of dimensionality</strong><br>among data, i.e. where having too many dimensions (features) in<br>your data causes noise and difficulties (it can be sound, picture, or<br>context).</p><p>This specifically gets worst when features have different scales (e.g.<br>weight, length, area, speed, power, temperature, volume, time, cell<br>number, etc. )</p><blockquote><strong>• Higher Dimensional Data cases training process to be slow.<br>• Higher Dimensional Data cannot be Visualized.</strong></blockquote><h3><strong>When is PCA Used</strong></h3><p><strong>Better Perspective and Less Complexity:</strong> When we need a more realistic perspective and we have many features on a given data set and specifically when we have this intuitive knowledge that we don’t need this much number of features. Intuitively, modeling is much easier in 2D or 3D, rather than in 100D, isn’t it?</p><p><strong>Better Visualization:</strong> When we cannot get a good visualization due to a high number of dimensions we use PCA to reduce it into a shadow of 2D or 3D features.</p><p><strong>Reduce Size:</strong> When we have too much data due to too many features and we are going to use process-intensive algorithms (like many supervised algorithms) on the data so we need to get rid of redundancy.</p><p><strong>Different Perspective:</strong> Maybe we don’t have any of these motivations but merely need to improve our knowledge of the data. PCA can give us the best linearly independent and different combinations of features so you can use them to describe your data differently.</p><h3><strong>PCA Process Steps</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2agIhZuZepv0x7Eg1xocOw.png" /><figcaption>PCA Process Steps</figcaption></figure><h3><strong>Standardize Dataset Features</strong></h3><p>Standardization is a step that is performed as part of the Pre-processing before a number of Machine Learning processes.</p><p>The goal of Standardization is to bring uniformity to the scales of Continuous<br>Numeric Variables with a mean of 0.</p><p>Differences in scales in the values of different features in datasets are<br>natural due to the use of different units. However, Machine Learning<br>models such as Gradient Descent, K-Means, KNN, ANN, PCA, etc are<br>sensitive to varying scales with the dataset used in learning. Hence<br>Standardization is performed.</p><p><strong>The z-score method is the most popular for standardizing data.</strong></p><p><strong>It is done by subtracting the mean and dividing it by the standard<br>deviation for each value of each feature.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*OK7wA-gOrVdGTTyrU2GRJw.png" /><figcaption>Standardization</figcaption></figure><h3><strong>Derive Covariance Matrix</strong></h3><p>The<strong> covariance matrix </strong>is a p × p <strong>symmetric matrix</strong> (where p is the number of dimensions) that has as entries the covariances associated with all possible pairs of the initial variables. While the Variance (square of Standard Deviation) is an indication of how much variability is existing within a particular feature, Covariance is a value that is associated with a pair of features and is an indication of co-variability between these two features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*7jDcXs72mSOX-ECyO_agbg.png" /><figcaption>2 X 2 matrix</figcaption></figure><h3><strong>Calculation of Covariance Values</strong></h3><p>In the covariance formula, the values of both variables are multiplied by taking the difference from the mean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*jaN1EZ9jzEP_82DaiAxnuA.png" /><figcaption>Covariance formula</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*BOUQefdFHXUtLnH0Leiyvw.png" /><figcaption>Types of Covariance</figcaption></figure><h3><strong>Eigenvectors and Eigenvalues</strong></h3><ul><li><strong>Eigenvectors of the Covariance Matrix</strong>: Directions of the axes (or new basis vector) where there is the most variance (most information) and that we call <strong>Principal Components.</strong></li><li><strong>Eigenvalues</strong>: The coefficients attached to Eigenvectors, which give the amount of variance carried in each Principal Component.</li></ul><p><strong>By ranking our eigenvectors in order of their eigenvalues, highest to lowest, we get the principal components in order of significance.</strong></p><p><strong>The process of finding the Eigenvector and Eigenvalues is called the Eigen-Decomposition.</strong></p><p>Basically, for any square matrix A, its <strong>eigenvectors</strong> are all the vectors v which satisfy the following equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/167/1*AkQxhLplb1wVHzqQYWLe5g.png" /><figcaption>λ is some constant also known as the eigenvalue for<br>that particular eigenvector.</figcaption></figure><h3><strong>Explained Variance Ratio &amp; Ranking PCAs</strong></h3><p>The <strong>Eigenvalues</strong> are indicators of the variance explained by that particular<br><strong>eigenvector</strong>. So higher the <strong>eigenvalue</strong>, the higher the variance explained by that eigenvector, and hence that direction is more important for us.</p><p>Our goal was to find a new set of basis vectors where the covariance matrix gets <strong>diagonalized</strong>. The new set of basis vectors is in fact the eigenvectors of the <strong>Covariance Matrix</strong>. Therefore, these eigenvectors are the <strong>Principal Components</strong> of our original dataset.</p><p>In other words, these eigenvectors are the directions that capture maximum variance. When these Principal Components are listed based on the higher to lower values of their corresponding Eigenvalues, we get our list of Principal Components. With Eigenvalues indicating the amount of variance explained by them, we are then to decide how many of the top ones we should choose in order to bring down the number of dimensions retaining enough information.<br><strong>E.g. </strong>If the original Dataset had 70 dimensions and the top 6 Principal Components explain about 95% of the variance in the dataset, it might be enough to choose only the top 6 PCAs for our further Machine Learning processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*XNwjEMj5sDG4gFNFCGTYyw.png" /><figcaption>Scree Plot</figcaption></figure><h3><strong>Represent the data using the chosen PCAs</strong></h3><p>The last step of Principal Component Analysis is to recast the Original Dataset<br>using the new Principal Components found (say, we have chosen the top 6).<br>This process will give us the transformed dataset with 6 Features that retain 95% of the variance information from the original dataset.<br>This transformed dataset may then be used for further ML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oU0eLH84pw7q1Pf9acnY1g.png" /><figcaption>PCA Process revisited</figcaption></figure><p>Important link (Visualization of PCA by — Luis Serrano)</p><p><a href="https://www.youtube.com/watch?v=g-Hb26agBFg">https://www.youtube.com/watch?v=g-Hb26agBFg</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72fd88d51fd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>