<?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[Machine Learning and Artificial Intelligence - Medium]]></title>
        <description><![CDATA[Machine Learning and Artificial Intelligence Tutorials - Medium]]></description>
        <link>https://medium.com/machine-learning-and-artificial-intelligence?source=rss----1cb8742383ec---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Machine Learning and Artificial Intelligence - Medium</title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence?source=rss----1cb8742383ec---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 18:10:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/machine-learning-and-artificial-intelligence" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[3.4) Association Rule Mining using ECLAT Algorithm]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/3-4-association-rule-mining-using-eclat-algorithm-b6e50aab2147?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/b6e50aab2147</guid>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Fri, 25 Sep 2020 12:00:11 GMT</pubDate>
            <atom:updated>2020-09-25T12:27:30.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><p>In the <a href="https://medium.com/machine-learning-and-artificial-intelligence/3-2-association-rule-mining-using-apriori-and-eclat-algorithms-b834fe2cf3da">previous article</a> we discussed the Apriori algorithm, now we will study the Eclat algorithm and main differences between them.</p><h3>Types of Association Rule Mining Algorithms</h3><h4>Horizontal vs Vertical Data Format</h4><p>Existing mining algorithm of association rules can be broadly divided into two main categories: — Horizontal format mining algorithms and Vertical format mining algorithms. We have a matrix which shows transactions with items, these kind of matrix can be represented a horizontal or a vertical way.</p><p>The most commonly used layout is the horizontal data layout. That is, each transaction has a transaction identifier (TID) and a list of items occurring in that transaction, i.e., {TID:itemset}. Another commonly used layout is the vertical data layout n which the database consists of a set of items, each followed by the set of transaction identifiers containing the item, i.e., {item:TID_set}. Table 1 shows the horizontal layout and table 2 shows the vertical layout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*evR4YVxNe0y6tb3lbWR3ag.png" /><figcaption><strong>Table 2. Horizontal Layout</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*zCQuZ6pnW3sGF8I6UqXAxA.png" /><figcaption><strong>Table 2. Vertical Layout</strong></figcaption></figure><p>Apriori algorithm uses horizontal format while Eclat can be used only for vertical format data sets. A number of vertical mining algorithms have been proposed recently for association mining, which has shown to be very effective and usually outperform horizontal approaches.</p><h3>The Intuition of ECLAT Algorithm</h3><p>Eclat algorithm is data mining algorithm which is used to find frequent items. As we already know, some association rule mining algorithm uses horizontal data format and some of them uses a vertical data format for generation of frequent itemsets. Eclat can not use horizontal database. If there is any horizontal database, then we need to convert into vertical database.</p><p>This vertical approach of the ECLAT algorithm makes it a faster algorithm than the Apriori (but sometimes when intermediate results of vertical tid lists become too large for memory, thus affecting the algorithm scalability). In Apriori algorithm we need to scan database again and again for finding frequent itemsets, this limitation is reduced by using vertical dataset in Eclat. Eclat needs to scan the database only once.</p><p>While the Apriori algorithm works in a horizontal sense imitating the Breadth-First Search of a graph, the ECLAT algorithm works in a vertical manner just like the Depth-First Search of a graph which is usually more fast than Breadth-First search.</p><p>We already discuss Breadth-First Search in Apriori, but the itemset lattice can also be traversed in a depth-first manner as shown in the picture below. The algorithm can start from, say, node a and counts its support to determine whether it is frequent. If so the algorithm progressively expands to the next level of nodes i.e ab, abc, and so on, until an infrequent node is reached , say abcd. It then backtracks to another branch, say abce, and continues the search from here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*mhaxrV6nL1QVc1MIBOAHLQ.png" /><figcaption><strong>Generating candidate itemsets using the depth-first approach</strong></figcaption></figure><p>Eclat uses a purely vertical transaction representation. No subset tests and no subset generation are needed to compute the support. Generally, Transaction Id sets which are also called as tidsets are used to calculate the value of Support value. The support of item sets is determined by intersecting transaction lists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*woDqhjIc6bCo_8bM932ssQ.png" /><figcaption><strong>Eclat: Calculate support count for an itemset by intersecting tid-lists of two of its (k-1) subsets</strong></figcaption></figure><p>In the first call of function, all single items or data are used along with their respective tidsets. Then the function is called recursive, in each recursive call, each item in tidsets pair is verified and combined with other item in tidsets pairs. This process is repeated until no candidate item in tidsets pairs can be combined.</p><p>The main advantage of the vertical format is support for fast frequency counting via intersection operations on transaction ids (tids) and automatic pruning of irrelevant data. The main problem with these approaches is when intermediate results of vertical tid lists become too large for memory, thus affecting the algorithm scalability.</p><p><strong>Let’s see an example of how Eclat works on vertical database</strong>:</p><p>Note: Using Eclat we only count support, because we only have item-sets and their supports. While we are not creating the rules, we do not need to calculate the confidence.</p><ol><li>Vertical data format. It is important to note that an item should not be appear more than once in the same transaction and also the items are assumed to be sorted by lexicographical order in a transaction.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*44EdA8HgGqru18_k0CvsVg.png" /><figcaption><strong>Here we have our transactions data represented in a vertical format in a right side{item:TID_set}</strong></figcaption></figure><p>2. Here is the first call of function and all single items or data are used along with their respective tidsets. Each frequent itemset is marked with its corresponding support value. The support of an itemset is given by number of times the itemset appears in the transaction database. Let’s say min_support=2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*iT-bCPqpoQOBEz1xTeDPTw.png" /><figcaption><strong>2) Frequent 1-itemsets. We have itemsets with lenght=1 and their supports. Itemsets whose support ≤ min_support will be filtered out</strong></figcaption></figure><p>3) Here is recursive call of function (now k=2) and itemsets are generated. Let’s say min_support=2. So all itemsets whose support&lt;min_support will be filtered out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*XBeTymJq1Yw9htPACcEVPQ.png" /><figcaption><strong>3) Frequent 2-itemsets. Generate itemsets (k=2) from previous frequent item-sets</strong></figcaption></figure><p>4)Here is recursive call of function (now k=3) and frequent itemsets are generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*B6QkBFAiGlvDqPqQoAa3kQ.png" /><figcaption>4) Frequent 4-itemset</figcaption></figure><p>This process repeats, with k incremented by 1 each time, until no frequent items or no candidate itemsets can be found.</p><p>The end result of Eclat algorithm is frequent item-sets with their support. We are not creating the rules with calculating confidence. We assume that frequent itemset is important and support is enough information to generate recommendations.</p><h4>Advantages of Eclat:</h4><ol><li>Since the Eclat algorithm uses a Depth-First Search approach, it consumes less memory than the Apriori algorithm</li><li>The Eclat algorithm does not involve in the repeated scanning of the data in order to calculate the individual support values</li><li>Eclat algorithm scans the currently generated dataset unlike Apriori which scans the original dataset</li></ol><h4>Eclat vs Apriori Use Case:</h4><p>The Eclat algorithm is naturally faster compared to the Apriori algorithm while the size of data set is small or medium, in case of large dataset there is a chance that Apriori performs more faster, because intermediate Tidsets which are created in Eclat algorithm consumes more space in memory than Apriori and when we lave a large dataset intermediate results of vertical tid lists become too large for memory, thus affecting the algorithm scalability. So Eclat algorithm is better suited for small and medium datasets where as Apriori algorithm is used for large datasets.</p><p>Note: If you want to master different techniques of data mining and association rules in general you can read this articles: <a href="https://www-users.cs.umn.edu/~kumar001/dmbook/ch6.pdf">link0</a>, <a href="http://sersc.org/journals/index.php/IJAST/article/view/3272/2243">link</a>1 and <a href="https://www.slideshare.net/wanaezwani/apriori-and-eclat-algorithm-in-association-rule-mining">link2</a>.</p><h3>Congratulations!</h3><p>You have completed non-personalized recommendations and the final part is the implementation of Apriori and Eclat algorithms using Python which we will discuss in the next article. You can find the python codes <a href="https://medium.com/p/5292ecb9ff3d/edit">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Nx7P61MrUMYu-1nGA0Wt6A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6e50aab2147" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-4-association-rule-mining-using-eclat-algorithm-b6e50aab2147">3.4) Association Rule Mining using ECLAT Algorithm</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3.3) Implementing Apriori Algorithm using Python Programming]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/3-3-implementing-apriori-algorithm-for-association-rules-using-python-5292ecb9ff3d?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/5292ecb9ff3d</guid>
            <category><![CDATA[association-rule]]></category>
            <category><![CDATA[association-rule-mining]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[apriori]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 21:31:47 GMT</pubDate>
            <atom:updated>2020-09-18T10:43:23.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><h4>Sharing the data set and code using GitHub</h4><p>Here I am sharing with you the data set containing market basket transactions and Jupyter Notebook:</p><ul><li>Here is the link of the data set: Click <a href="https://github.com/AnaMakharadze/Recommendation-Systems/blob/master/Apriori%20_%20Market_Basket_Optimisation.csv">here</a></li><li>Here is the link of my Jupyter Notebook: Click <a href="https://github.com/AnaMakharadze/Recommendation-Systems/blob/master/Apriori%20Implementation.ipynb">here</a></li></ul><p>I have made comments in my notebook where I have explained the steps. After seeing these codes try to do the same thing on your own. If you aren’t familiar with GitHub leave your e-mail address in the comments section and I will send you the files.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a3ba48a14a72f002183f54aed934f61/href">https://medium.com/media/5a3ba48a14a72f002183f54aed934f61/href</a></iframe><p><strong>Congrats!</strong> Now you know how to generate association rules using Apriori algorithm. Next, we will study about personalized recommendation systems and it’s types. This article will be added soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5292ecb9ff3d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-3-implementing-apriori-algorithm-for-association-rules-using-python-5292ecb9ff3d">3.3) Implementing Apriori Algorithm using Python Programming</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3.2) Association Rule Mining using Apriori Algorithm]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/3-2-association-rule-mining-using-apriori-and-eclat-algorithms-b834fe2cf3da?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/b834fe2cf3da</guid>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[association]]></category>
            <category><![CDATA[association-rule-mining]]></category>
            <category><![CDATA[apriori]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 21:23:43 GMT</pubDate>
            <atom:updated>2020-09-30T23:11:18.220Z</atom:updated>
            <content:encoded><![CDATA[<h3>3.2) Association Rule Mining using APRIORI Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><p>In this article we will study the process of association rule discovery using Apriori algorithm and discuss different techniques of association rule mining. If you have not read previous article I strongly recommend to see it first <a href="https://medium.com/p/95e5f017e3d5/edit">here</a>.</p><h3>Concept of Association Rules</h3><p>Today large amount of customer purchase data are collected daily basis by companies. The picture below illustrates an example of such data, commonly known as market basket transactions. Each row in this table corresponds to a transaction, which contains unique identifier TID (transaction id) and set of items bought by a given customer.</p><p>Retailers are interested in analyzing market basket data to learn purchasing behavior of their customers. Some of useful technique to analyze market basket data set is association rule mining.</p><p>The goal of association rule mining is to find rules that will predict the occurrence of an item (Y) based on the occurrence of other items (X) in the transaction. So the goal is to find which items appear frequently together in the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*pKTaYpFDxN3lwt6HzMF0KQ.png" /><figcaption><strong>Example of Market Basket Data</strong></figcaption></figure><p>From the previous article we already know the form of association rule which looks like: X-&gt;Y [support, confidence],<strong> </strong>where X and Y are sets of items in the transaction data. For example: Bread =&gt; Milk [Support=60%, Confidence= 75%], where support shows that in 60% of transactions Milk and Bread appeared together and confidence shows that 75% of customers who purchased bread also bought milk. Let’s review some of the known terms again:</p><ul><li>Item-set:<strong> </strong>It’s a collection of one or more items. K-item-set means a set of k items. For example<strong>:</strong> {Bread, Milk}</li><li>k-itemset: An itemset that contains k items. For example: {Bread, Milk} is 2-itemset</li><li>Support Count:<strong> </strong>Indication of how frequently the item set appears in the database. For example: {Bread, Milk} occurs 3 times in our data set</li><li>Support:<strong> </strong>Fraction of transactions that contain the item-set. Support=Frequency of Itemset/Total N of Transactions. For example: Support for {Bread, Milk} = 3/5=60%. It means that 60% of the transactions contain itemset {Bread, Milk}</li><li>Frequent item-set: It’s an itemset whose support is greater than or equal to a minimum _support threshold</li><li>Confidence: Confidence is the number of transactions with both X and Y divided by the total number of transactions having X. For a rule X=&gt;Y confidence shows the percentage in which X is bought with Y. For example: Confidence for Bread =&gt; Milk = 3 / 4 = 75%, it means that 75% of the transactions that contain X (Bread) also contain Y (Milk) together. Confidence (X=&gt;Y) = P(X∩Y)/P(X)= Frequency (X,Y) / frequency(X)</li><li>Strong rules:<strong> </strong>If a rule X=&gt;Y [Support, Confidence] satisfies min_support and min_confidence then it is a strong rule</li><li>The goal of association rule mining: given a set of transactions find all the rules having support≥minimum_support and confidence ≥ minimum_confidence</li></ul><h3>Association Rule Mining Process</h3><p>In real world transaction data can exceed up to GB s and TBs of data and mining association rules is quite computationally expensive task. An optimized algorithms are needed to prune out item-sets that will not help in later steps and reduces computation time. Apriori and Eclat algorithms are used to do this job which we will discuss later.</p><p>A brute-force approach for mining association rules is to compute the support and confidence for every possible rule. This approach is very expensive because there are exponentially many rules that can be extracted from the data set. Total number of possible rules that can be extracted from a data set that contains d items is: R=3^d - 2^(d+1) +1. Even for a small data set like us this approach requires to compute many rules:</p><ul><li>Data set containing 5 items: 3⁵-2⁶ +1 = 180 rules</li><li>Data set containing 6 items: 602 rules and so on</li></ul><p>More than 80% of the rules are discarded after applying minsup=20% and minconf=50% thresholds, thus making most of the computation become wasted. To avoid performing needles computations, it would be useful to prune the rules early without having to compute their support and confidence values.</p><p>An initial step toward improving the performance of association rule mining algorithms is to decouple the support and confidence requirements. It means that at first we only calculate the support of the candidate itemsets, based on their support value we can filter out candidates which do not satisfy the min_support constraint. Then we calculate the confidence for generated frequent itemsets. We know that support of the rule X -&gt; Y depends only on the support of its corresponding itemsets. Rules originating from the same item set have identical support but can have different confidence. For example these rules have an identical support:</p><ul><li>{Beer, Diapers} -&gt; {Milk}</li><li>{Diapers, Milk} -&gt; {Beer}</li><li>{Milk} -&gt; {Beer, Diapers}</li><li>{Bear, Milk} -&gt; {Diapers}</li><li>{Bear} -&gt; {Diapers, Milk}</li><li>{Diapers} -&gt; {Beer, Milk}</li></ul><p>If the itemset is infrequent, then all six candidate rules can be pruned immediately without our having to compute their confidence values. Therefore, a common strategy adopted by many association rule mining algorithms is to decompose the problem into the two major sub tasks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*vzX53_zk8S7KcYhmOI5InQ.png" /><figcaption><strong>Association Rule Mining Process</strong></figcaption></figure><ol><li><strong>Frequent itsemset generation</strong> whose objective is to find all the itemsets that satisfy the minimum support threshold. These itemsets are called frequent itemsets. In this step we should find all frequent item-sets whose support ≥ minimum_support (the value of minimum_support is defined by us). Item-sets which can’t satisfy the following constraint support &gt;= min_support will be filtered out in this step. Generation of frequent item-sets is the most computationally expensive step.</li><li><strong>Rule generation</strong>, whose objective is to extract all the high-confidence rules from the frequent itemsets found in the previous step. These rules are called strong rules. We have a list all association rules from frequent item-sets generated in first step, Calculate Support and Confidence for all of these rules, Prune rules that fail min_confidence thresholds</li></ol><h3>Generation of Frequent Itemsets</h3><p>Here we have a data set of 5 transactions with 5 unique items: Bread, Milk, Diapers, Beer and Cola. If we create all item-sets from this 5 items we will get 2⁵-1 item-set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*ORH50toPyTiDYlp_ad078A.png" /></figure><p>Let’s see what kind of item-sets can be created according to our data set on the picture below and you can imagine how time consuming can be calculating the support for each super-set (2^k)-1 when you have too many items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*lhrk909HDk9EQJWZBCJJvA.png" /><figcaption><strong>With k item you will get 2^k -1 super set</strong></figcaption></figure><p>Here is more general example of itemset lattice for I = {a,b,c,d,e} where we get (2^k)-1=31 itemsets in total.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*le70BDHQSkUbU6BuZWb4IQ.png" /><figcaption><strong>An itemset lattice</strong></figcaption></figure><p>As we know, a brute-force approach for finding frequent itemsets is to determine the support count for every candidate itemset in the lattice. To do this, we need to compare each candidate against every transaction. This is very expensive operation because it requires many comparisons. Specifically, it requires N*M*w operations where N is the number of transactions, M is the number of candidate itemsets (M=2^k -1) and w is maximum transaction width.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*8O1amfmy2oHyvARS_mmVTQ.png" /><figcaption><strong>A brute-force approach for counting the support for each candidate itemset by scanning the whole database</strong></figcaption></figure><p>There are several strategies t reduce complexity of generation frequent itemsets:</p><ul><li><strong>Reduce the number of candidates (M)</strong> — Apriori algorithm is a good example of eliminate some of the candidates without counting their support value. We will discuss Apriori in details later.</li><li><strong>Reduce the number of comparisons (NM)</strong> — For this we can use efficient data structures to store the candidates or transactions. No need to match every candidate against every transaction. We will discuss this strategies.</li></ul><h3>Basic Concepts of Apriori Algorithm</h3><p><strong>Apriori algorithm states: “Any subset of a frequent item set must also be frequent“. Conversely, if an itemset is infrequent then all of its supersets must be infrequent to. </strong>In other words, no super set of an infrequent item set must be generated or tested!</p><p>Look at the picture below.<strong> </strong>If item-set {a,b} is infrequent (support&lt;min_support) then we do not need to take into account all its super-sets (abc, abd, abcd). You can see how this principle reduces the number of total supersets for calculating the support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*EWItuV7OKfBDrXDbvQ-J1w.png" /><figcaption><strong>If item-set {a,b} is infrequent (support&lt;min_support) then we don’t need to take into account all its super-sets (abc, abd, abcd)</strong></figcaption></figure><p>Apriori principle holds due to the following property of the support measure: Support of itemset(Y) never exceeds the support of its subsets(X): s(X)≥s(Y). This is known as anti-monotone property of support. This strategy of reduce number of generated candidates using support measure is called support-based pruning. Apriori is the first association rule mining algorithm that pioneered the use of support-based pruning. Here is a high level illustration of the frequent itemset generation using Apriori:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*NZLTDz9yINQxTfzI_IFY1g.png" /><figcaption><strong>An illustration of frequent itemset generation using Apriori (We assume that minim_support count=3)</strong></figcaption></figure><p>Here the Apriori algorithm generates 13 candidates, with brute-force approach we will get 41 candidates, this represents a 68% reduction in the number of candidate itemsets.</p><p>Now as we know, Apriori algorithm in a general way, we can see the step by step approach. I recommend to do all of these calculation by your own and compare the results. Follow to those steps accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*0U5v7xCuRzO9m3SIp4_Uug.png" /><figcaption><strong>Step by Step Approach of Apriori Algorithm</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*yt0MuUC9fT9V4EMhEaApVQ.png" /><figcaption><strong>1)Generate itemsets of k=1 and prune candidates whose support&lt;min_support</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*w2iG_05lx-rdEBWrtmJMww.png" /><figcaption><strong>2) Generate k=2 itemsets from previous frequent itemsets and prune candidates whose support&lt;min_sup</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0HiLXNn-uzSQNORA87s6zg.png" /><figcaption><strong>3) Generate k=3 frequent itemsets from k=2 frequent itemsets</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*r9pfpt5lkTt773zBiJw4zQ.png" /><figcaption><strong>4) No new frequent item-sets can be generated. Creating rules. Finally, we got 4 strong rules: {I2}-&gt;I1; {I1}-&gt;I2; {I2}-&gt;I3; {I3}-&gt;I2</strong></figcaption></figure><p>You can see that there are 4 strong rules in our example. For example, rule I2=&gt;I3 having confidence equal to 75% tells that 75% of people who bought I2 also bought I3.</p><h4><strong>Summarize the Steps of Apriori:</strong></h4><ol><li>Candidate generation:<strong> </strong>Generates new candidate k-itemsets based on the requent (k-1) itemsets found in the previous iteration.</li><li>Candidate Pruning: Eliminates some of the candidate k-itemsets using the support-based pruning strategy (If one subset of candidate itemset is infrequent then this itemset is immediately pruned, because all subsets of candidate itemsets must be frequent).</li><li>The Apriori algorithm traverses the item lattice in a breadth-first manner, as shown in above examples. It first discovers all the frequent 1-itemsets, followed by the frequent 2-itemsets, and so on, until no new frequent itemsets are generated.</li></ol><p><strong>Congratulations!</strong></p><p>You have completed the theory of Apriori algorithm. You can find the python codes for Apriori <a href="https://medium.com/p/5292ecb9ff3d/edit">here</a>. In the next article we will discuss Eclat algorithm which is the final part of non-personalized recommenders. <a href="https://medium.com/machine-learning-and-artificial-intelligence/3-4-association-rule-mining-using-eclat-algorithm-b6e50aab2147">Link</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riK5S4jHWYDIcU3P_1Je2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*B8lF6sowEhUzgCzGWso67Q.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b834fe2cf3da" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-2-association-rule-mining-using-apriori-and-eclat-algorithms-b834fe2cf3da">3.2) Association Rule Mining using Apriori Algorithm</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3.1) Introduction to Association Rules]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/3-1-introduction-to-association-rules-95e5f017e3d5?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/95e5f017e3d5</guid>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[apriori]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[association-rule]]></category>
            <category><![CDATA[association]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 21:19:54 GMT</pubDate>
            <atom:updated>2020-09-16T23:41:18.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><h3><strong>Basic Concepts of Association Rules</strong></h3><p>In the previous article we have already seen some examples of association rules using in e-commerce. We know that association rule mining is a popular and well researched method of data mining for discovering interesting relations between items in the databases.</p><p>The goal of association rule mining is to find rules that will predict the occurrence of an item (Item Y) based on the occurrence of other items (Item X) in the transaction.</p><p>For example: Predict the chance of user buying a phone cover (Item Y) if he already bought the phone (Item X) and if the chance is high enough then recommend phone cover to someone who are buying the phone. There is a big chance to discover strong rules in big data, but keep in mind that the implication means co-occurrence does not necessarily means causality! We can not assist that buying one item is cause of buying the other one when items are just frequently bought together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*gIc6YbuY5qAxcFHXhknTRw.png" /><figcaption><strong>Association rule suggests to add phone cover in your cart if you are buying the phone</strong></figcaption></figure><p>Besides market basket data, association analysis is also applicable to other application domains such as bioinformatics, medical diagnosis, web mining and scientific data analysis. In the analysis of Earth science data, association patterns may reveal interesting connections among the ocean, land, and atmospheric processes. We will focus on market basket data.</p><p>Now let’s study the basic concept of association rules. Here is our data which consist of 5 transactions made by our customer. Each transaction shows the products bought together in that transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*Uy1NHp4G8YmZd6gE6DliHQ.png" /><figcaption><strong>Transactions data set including 5 transactions made by our customers</strong></figcaption></figure><ul><li><strong>Binary Representation of Market Basket Data- </strong>Market basket data can be represented in a binary format as shown in table, where each row corresponds to a transaction and each column correspond to an item. An item can be treated as binary variable whose value is 1 if the item is present in a transaction and 0 otherwise. The representation is a simplified view of real market data because it ignores many information about the data such as quantity of items sold or the price paid to purchase them.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*cDg8CfVKE9tucyq0JvsbRQ.png" /><figcaption><strong>A binary 0/1 representation of market basket data</strong></figcaption></figure><ul><li><strong>Item-set: </strong>It’s a collection of one or more items. K-item-set means a set of k items. For example<strong>:</strong> Item-set is {Bread, Milk}</li><li><strong>k-itemset:</strong> An itemset that contains k items. For example: {Bread, Milk} is 2-itemset</li><li><strong>Support Count: </strong>Indication of how frequently the item set appears in the database. It’s frequency of occurrence of an item-set. For example: {Bread, Milk} occurs 3 times in our data set</li><li><strong>Support: </strong>Fraction of transactions that contain the item-set. Support=Frequency of Itemset/Total N of Transactions. For example: Support for {Bread, Milk} = 3/5=60%, it means that 60% of the transactions contain itemset {Bread, Milk}</li><li><strong>Confidence: </strong>For a rule X=&gt;Y confidence shows the percentage in which X is bought with Y. So confidence is the number of transactions with both X and Y divided by the total number of transactions having X. For example: Confidence for Bread =&gt; Milk = 3 / 4 = 75%, it means that 75% of the transactions that contain X (Bread) also contain Y (Milk) together. <strong>Confidence (X=&gt;Y) </strong>= P(X∩Y)/P(X)=Frequency(X,Y)/frequency(X). Suppose, the confidence of the association rule X⇒Y is 80%, it means that 80% of the transactions that contain X also contain Y together</li><li><strong>Form of Association Rule: X</strong>=<strong>&gt; Y</strong> <strong>[Support, Confidence],</strong> where X and Y are sets of items in the transaction data.<strong> </strong>For example:<strong> </strong>Bread =&gt; Milk [Support=60%, Confidence= 75%], where support shows that in 60% of transactions bread and milk are purchased together, confidence shows that 75% of customers who purchase bread also purchase milk</li><li><strong>Thresholds: </strong>While creating association rules you can set minimum threshold for support and confidence to filter out some non-interesting rules and keep only frequent item-sets and strong rules</li><li><strong>Frequent item-set:</strong> An itemset whose support is greater than or equal to a minimum _support threshold</li><li><strong>Strong rules: </strong>If a rule X=&gt;Y [Support, Confidence] satisfies min_sup and min_confidence then it is a strong rule</li><li><strong>The Goal of Association Rule Mining:</strong> The goal of association rule mining is to find all association rules having support≥minimum_support threshold and confidence ≥ minimum_confidence threshold</li><li><strong>Lift:</strong> Lift gives the correlation between X and Y in the rule X=&gt;Y. Correlation shows how one item-set X effects the item-set Y. <strong>Lift(X=&gt;Y) = Confidence of the rule (X=&gt;Y)/ Support(Y)</strong></li><li><strong>Lift for the rule {Bread}=&gt;{Milk}: </strong>Confidence of the rule (75%) / Support (Milk) = 4/5 (80 %) = 75%/80 % = <strong>93.75%</strong></li></ul><p><strong>Evaluate the rule using the value of the Lift:</strong></p><ol><li>If the rule had a lift of 1, then X and Y are independent and no rule can be derived from them</li><li>If the lift is &lt; 1, then presence of X will have negative effect on Y</li><li>If the lift is &gt; 1, then X and Y are dependent on each other, and the degree of which is given by lift value</li></ol><h4>Why use support and confidence?</h4><p>Support and Confidence measure how interesting the rule is. Support is an important measure because a rule that has very low support may occur simply by chance. A low support rule is also likely to be uninteresting from a business perspective because it may not be profitable to promote items that customers seldom buy together. For these reasons support is often used to eliminate uninteresting rules. Support is also used for efficient discovery of association rules.</p><p>Confidence, on the other hand, measures the reliability of the inference made by a rule. For a given rule X-&gt;Y, the higher the confidence, the more likely it is for Y to be present in transactions that contain X. Confidence also provides an estimate of the conditional probability of Y given X.</p><p>Association rules suggest strong co-occurrence relationship between items and does not necessarily imply causality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiRgds2U-ofNCQozFVTGHw.png" /></figure><h3><strong>Basic Concepts of Association Rules</strong></h3><p>An intuitive example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*MZ9V2gveBLP8aXlWqWPYIg.png" /><figcaption>Example of movie data set</figcaption></figure><p>This data set shows the movies that each user likes. Our mission is to discover rules about people’s taste in movies, so we are looking for frequent pairs. For example: Without any calculation we see here that “People who watched Movie_1 also watched Movie_2 “.</p><h4><strong>Confidence</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*dY8NBANjCYigQf4DNXwK4Q.png" /><figcaption>Green -people who have seen Interstellar; Green with red circle - Interstellar and Inception</figcaption></figure><p>We are testing the rule: “ Interstellar”(X) = &gt; “Inception”(Y)<strong> , </strong>This rule means that ”People who have seen Interstellar (X) like to see Inception (Y)”.</p><ul><li>Green are people who have seen Interstellar (X) = 40</li><li>Green with red circle are people who have seen Interstellar (X) and Inception (Y) = 7</li><li>Confidence = Frequency(X,Y) / Frequency (X)</li><li>Confidence for Interstellar (X) = &gt; Inception (Y) = 7/40 = 17.5%</li><li>Meaning: 17.5% of People likes Inception out of people who have seen Interstellar</li></ul><h4><strong>Support</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*_mON-iwbXJz3o2gmYYnUqQ.png" /><figcaption>People with red cycles have seen Inception out of total 100 people</figcaption></figure><p>Lets calculate the support for “Inception”:</p><ul><li>We have here 100 people and 10 of them have seen Inception (In red circle)</li><li>Support X = frequency X / total N of data</li><li>Support for Inception = 10/100 = 10<strong>%</strong></li><li>Meaning: This means that if we randomly suggest people to watch “Inception“, probability that they like it is 10%</li></ul><h4><strong>Summary of an Example</strong></h4><ul><li>As we already know the support for Inception = 10%. Which means that if we randomly suggest people to watch “Inception“, probability that they like it is 10%</li><li>If we suggest to see Inception only those people who have seen “Interstellar”, probability that they like it is 17.5% (Confidence for rule Interstellar = &gt; Inception =17.5 %)</li><li>Lift is improvement in recommendation = Confidence of the rule/Support of Y</li><li>Lift for “Inception” = 17.5%/10% = 1.75%</li><li>If lift is less than 1 it means that having X in the cart reduces the probability of having Y in this cart. In other words a value of lift less than 1 shows that having X on the cart does not increase the chances of occurrence of Y on the cart in spite of the rule showing a high confidence value</li><li>Value of lift greater than 1 proves for high association between {X} and {Y}. More the value of lift, greater are the chances of preference to buy {Y} if the customer has already bought {X}. Lift is the measure that will help store managers to decide product placements</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP8HeRbE4uucy-qodEmqNQ.png" /></figure><p>After a short break continue reading to study association rules mining using Apriori and Eclat algorithms. Click <a href="https://medium.com/machine-learning-and-artificial-intelligence/3-2-association-rule-mining-using-apriori-and-eclat-algorithms-b834fe2cf3da"><strong>here</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95e5f017e3d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-1-introduction-to-association-rules-95e5f017e3d5">3.1) Introduction to Association Rules</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2) Introduction to Non-Personalized Recommendations using Association Rules]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/introduction-to-non-personalized-recommendations-using-association-rules-for-beginners-63a502881ea9?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/63a502881ea9</guid>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[association-rule]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[association]]></category>
            <category><![CDATA[recommendation-engine]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 21:18:58 GMT</pubDate>
            <atom:updated>2020-10-25T18:50:42.797Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>2) Introduction to Non-Personalized Recommendations using Association Rules for Beginners</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><h3><strong>What is Non-Personalized Recommendations</strong></h3><p>In previous article we already discuss the main difference between personalized and non-personalized systems but let’s explain it again.</p><p>Non-personalized recommendations are usually where the most sites start because it’s easy and doesn’t requires to know anything specific about the customers, because customers individual likes and dislikes aren’t used for customized suggestions and the same recommendation is given to all of them. That’s why its non-personalized.</p><p>For example: what if a completely new user visits an e-commerce site. How does the site go about recommending products to the user in this scenario? While we don’t have any past history of that user we can not create personalized offers but we can suggest him the most popular items in the store. For example: bestsellers in book store, top movies on Netflix account, most popular news articles on news feed.</p><p>Also, websites have many non-identified visitors. While they aren’t registered you don’t have any information about them to show personalized content and recommending the most popular content remains the only option in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*wRgM4viU2raJxLYfux_49w.png" /><figcaption><strong>If item is liked by majority of population, it has a big chance to be liked by you</strong></figcaption></figure><p>You might think, that non-personalized recommendations should be shown until the system knows enough about the user and then show personalized content but keep in mind that humans are flock animals by nature and most people want to know what content are the most popular.</p><p>Popularity is a good way to create non-personalized recommendation because if item is liked by majority of population, it has a big chance to be liked by other users as well.</p><p>Keep in mind that there are industries where popularity is not the right way to recommend something. For example music or clothing industry. Also, online stores have million of products and there maybe products that are less famous but some group of people may buy them. In this case popularity is not the solution, but personalized recommendation system solves the problem of discovery by recommending products according to user’s preferences. We will discuss personalized recommendation engines later, in the next articles.</p><p>Now we will discuss kind of non-personalized recommendations that all of us have seen on Amazon or other e-commerce web-sites.</p><h3><strong>E-Commerce Recommendations</strong></h3><p>Here are the common forms of non-personalized e-commerce recommendations that you have seen on your online shops web-site:</p><ul><li>Recommending items that can be add to your basket</li><li>Recommending pairs of items/services that go well together</li><li>Recommending products that are useful when buying some product</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*8_LvACxlgkQ3EF7cyzic8g.png" /><figcaption><strong>E-commerce Recommendations</strong></figcaption></figure><p>Let’s imagine you are a sales assistant and someone buys the phone. You know, there is a high chance he will also buy a phone cover because these products are frequently bought together.</p><p>So it would be wiser for us to recommend phone covers to that user (cross-selling). In other words, we are recommending products that are <strong>associated</strong> to another product. Here the <strong>Association Rule </strong>concept comes into play.</p><p><strong>Data Mining:</strong> Data mining is used to discover interesting and previously unknown patterns from datasets. Association rule mining is a popular and well researched method of data mining for discovering interesting relations between items in the databases.</p><p><strong>Association Rule Mining:</strong> The goal of association rule mining is to know which items are frequently bought together. Given a set of transactions, find rules that will predict the occurrence of an item (Item B) based on the occurrence of other items (Item A) in the transaction. For example: Predict the chance of user buying a phone cover (Item B) if he already bought the phone (Item A) and if the chance is high enough then recommend phone cover to someone who are buying the phone.</p><p>Keep in mind that the implication means co-occurrence and not causality! These items are just frequently bought together but we can not assist that buying one item is cause of buying the other one.</p><p>Before we discuss all of the steps to generate association rules let’s see some more use cases and examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*la22NbHrSx2IyH_lnIzmxg.png" /><figcaption><strong>Association rule recommending the items that can be add on your basket</strong></figcaption></figure><p>Now imagine you are a data scientist and you have a client who runs a retail store. Your client gives you all of the transactions data. This data consists of items bought in the store by customers over a period of time. You are going to use <strong>Market Basket Analysis </strong>(MBA) which uses <strong>Association Rule Mining </strong>on the given transaction data to help your client to boost sales. Market basket analysis is the process of finding the buying habits of people.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*pKTaYpFDxN3lwt6HzMF0KQ.png" /><figcaption><strong>Here is the transactions data containing only 5 transactions</strong></figcaption></figure><p>You can see transactions numbered 1 to 5 here and each transaction shows items bought in that transaction. You can tell to your client what items do customers frequently buy together by generating rules called Association Rules.</p><p><strong>Before we go to exact steps and calculations let’s find association rule just by looking into the data. </strong>We can see that Diapers and Beer are frequently bought together because they appear 3 times in 5 transactions:</p><ul><li>{Diapers, Beer} is an example of a frequent Itemset because appear frequently together</li><li>{Diapers} -&gt; {Beer} is an example of an association rule which means that there is a high chance to buy beer when you are buying diapers</li><li>Diapers and Beer is a very old and well-known example of association rules. The rule suggests that a strong relationship exists between the scale of diapers and beer because many customers who buy diapers also buy beer. Retailers can use this type of rules to help them identify new opportunities for cross-selling their products to customers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*LT-Bb3cIrCeZiJEvr4KRUQ.png" /><figcaption><strong>If you don’t know who buys diapers and then beer try to guess :) and leave me the answer in the comments</strong></figcaption></figure><p>Okay, we have some association rules based on our data and we know which items are frequently bought together. Let’s see what our client can do in terms of marketing strategies with this kind of information:</p><ul><li>Changing the store layout according to trends (If you put frequently bought items far from each other customer will spend more time in the store, or somethings maybe it’s better to put them together)</li><li>Stock management (What other products should the store stocks up?)</li><li>Cross sale offers (Buying <em>this</em>, let’s add <em>this</em> with the price of <em>x</em>)</li><li>Customized emails with add-on sales</li><li>Create a catalogue design and so on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAO8pnwqZZ4Jieo34UuE3g.png" /></figure><p>Next article is an introduction to association rules. Continue reading <a href="https://medium.com/p/95e5f017e3d5/edit"><strong>here</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63a502881ea9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/introduction-to-non-personalized-recommendations-using-association-rules-for-beginners-63a502881ea9">2) Introduction to Non-Personalized Recommendations using Association Rules</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1) Introduction to Recommendation Systems]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/1-introduction-to-recommendation-systems-for-beginners-b50c86f5fccf?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/b50c86f5fccf</guid>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[recommendation-engine]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 20:56:25 GMT</pubDate>
            <atom:updated>2020-10-31T12:38:59.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello! This article is a part of a full tutorial of Recommendation Systems which you can find <a href="https://medium.com/p/d70c3abcea8b/edit">here</a>. I strongly recommend to follow the agenda of this tutorial if you want to master this topic.</p><h3><strong>The Power of Recommendation Systems</strong></h3><p>Recommendation systems are one of the most useful applications of machine learning and nowadays it seems to take more and more place in our lives. There are many web-services like YouTube, Amazon, Netflix or Spotify running powerful recommendation engines.</p><p>In a general way, recommendation systems are algorithms which suggests relevant items to users. For example: movies to watch on your Netflix account, or products to buy on your Amazon account, or videos to watch on YouTube, or music to listen on Spotify, or anything else depending on the industry.</p><p>In today’s world customers are faced with multiple choices because there are millions of products available online and recommendation sections help them to find desired ones. It’s something we can’t imagine modern e-Commerce or online media without it.</p><p>Using recommendation systems companies can boost their sales and increase user interaction. Here are some well-known examples of using these systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbCSIJP1igE0Qy7508_1HQ.png" /><figcaption><strong>Benefits of Recommendation Engines</strong></figcaption></figure><p>The essence of recommendation system is not new. We usually ask people who have a similar taste to us for an advice if we are looking for a new movie, but when we log into our Netflix account choosing the right products is quite challenging process because there are many products and we can’t ask to our friends for a recommendation every time.</p><p>Hopefully, companies have developed recommendation systems which studies customers taste and needs based on his browsing/purchasing history and recommends products which customers might like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*S8pFjrzYhCP1eJlfYGJuAA.jpeg" /><figcaption><strong>“Netflix Prize“</strong></figcaption></figure><p>In order to highlight the importance of having a good recommendation system I will tell you about the well-known competition called — “Netflix Prize“ which was held by Netflix in 2009.</p><p>The goal of this competition was to increase Netflix’s recommendation system’s accuracy with 10% and Netflix was paying 1 million dollar for this. Now you can think about how important it is for business to increase system’s accuracy even with 10% only.</p><h3><strong>Personalized and Non-Personalized Rec Systems</strong></h3><p>In general, there are two types of recommendation systems:</p><ul><li>Personalized</li><li>Non-Personalized</li></ul><h4>Personalized Recommendations</h4><p>Giving a personalized recommendation to the user requires to know specific information about this user. You should know what are the features of products that this user likes or dislikes according to his past behavior and purchasing history on your web-site.</p><p>For example: You should know what kind of movies I liked based on my historical movie ratings (for example I like Sci-Fi movies) and according to this information you can recommend moves that I might like. You can find movies which have high chance to be liked by me in a two ways:</p><ol><li>Item to item similarity: Suggest me to watch other movies which are similar to the movies I already liked (which items are similar to the items I already liked)</li><li>User to user similarity: Suggest me to watch other movies that users which are similar to me have already liked and I have not seen yet (which user is similar to me according to my and his historical behavior/interest)</li></ol><p>Let’s see the example of real world application which uses customers historical data for generate personalized recommendations about new restaurants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*bxTsCXJPDOhlxFi5iRQSVw.png" /><figcaption><strong>yelp.com is using historical rating of customers to recommend them new restaurants</strong></figcaption></figure><p>Let’s sum up what personalized recommendation system tries to do in a simple way before we deep dive into this topic:</p><ul><li>Predicts the rating the user may give to the products which he has not tried yet. Predictions are made based on user’s taste and preferences which is designed according to his historical behavior on your web-site (purchased items, ratings or some other interactions)</li><li>Sorts the products according to the predicted rating in descending order and recommends top N items from this list to the user</li></ul><p>So as you see in personalized systems users individual likes and dislikes (historical ratings) are considered to generate customized recommendations for them. There can be two kind of users rating:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*CdagiGvQn99RhDLIpb7CZg.png" /><figcaption><strong>Explicit Ratings</strong></figcaption></figure><ol><li>Explicit Ratings: If user can rate something that he purchased on your web-site, you have explicit ratings. It’s direct information from users, so you are 100% accurate how they liked products/services which they purchased. For example on Amazon we can rate items we have purchased.</li><li>Implicit Ratings: If you don’t have web-site like Amazon where users can directly rate some items or if your customers don’t use this functionality and you have many items that are unrated, you can use implicit ratings. Imagine, you have an online gambling web-site where people can play some games, you can think about things which might means that they liked this game or not. For example: time or money spent on this game compared to another his games. Or if you have a web-site where you are selling the tickets of bus, theater, events or something else you can say that if user purchased something it also means that they liked it without extra explorations.</li></ol><h4>Non-Personalized Recommendations</h4><p>Non-Personalized recommendations means that you don’t need to know specific information about the users preferences. So you aren’t collecting the historical data of users ratings or purchases to generate customized recommendation for them. That doesn’t mean that this kind of recommendations are less important. In the next article you’ll learn that using non-personalized recommendations can also show interesting content .</p><p>The most simple non-personalized recommendations are based on items popularity. A recommendation comes from what people like. For example: you are suggesting to watch the movie Titanic for all of your customers because Titanic is one of the most popular movie and you hope that it will be also interesting for those who have not seen yet. I am sure you have seen recommendations of popular items like this:</p><ul><li>Best-seller</li><li>Most popular</li><li>Trending hot</li><li>Best-liked</li><li>Selling fast</li></ul><p>There are another kind of non-personalized recommendations which are commonly used in e-commerce. They look like a rule: “People who buy X also buy Y”. For example: People who bought <em>phone</em> also bought <em>phone cover</em>. So if you are buying the phone they are recommending you to add the phone cover in your basket.</p><blockquote>“People who buy X also buy Y”</blockquote><blockquote>“People who bought <em>phone</em> also bought <em>phone cover</em>“</blockquote><p>This kind of recommendation is non-personalized because they are not using your individual ratings/taste or preferences to recommend you the phone cover. Instead, they know that phone and phone cover are associated items, because they are frequently bought together.</p><p>Based on knowledge of which items are generally bought together this kind of system suggests to someone who buys phone to add phone cover in his basket. I am sure you have seen this kind of recommendations on Amazon web-site too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*1Etimzvxe9siP3CfnxACDQ.png" /><figcaption><strong>Example of a non-personalized recommendation</strong></figcaption></figure><p><strong>Summary:</strong></p><p>If we want to create personalized recommendations for someone we should look at his preferences, his ratings on items which he has already purchased or seen in order to understand his taste and needs and then recommend items accordingly.</p><p>Conversely, non-personalized recommendations are not looking for individual users preferences. Instead, they are creating the rules about which items are going well together or what is popular among users peers and generate recommendation based on this knowledge.</p><p>Non-personalized recommendations are usually where the most sites start because it’s easy and doesn’t requires to know anything specific about the customers. We will discuss the benefits of non-personalized recommendations using association rules in the next article. Take a short break and let’s continue learning in more details <a href="https://medium.com/p/63a502881ea9/edit"><strong>here</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*Bt5m3fvx8Q98h79BhnGgPw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b50c86f5fccf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/1-introduction-to-recommendation-systems-for-beginners-b50c86f5fccf">1) Introduction to Recommendation Systems</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agenda of Recommendation Systems Full Tutorial, Theory and Python Codes]]></title>
            <link>https://medium.com/machine-learning-and-artificial-intelligence/recommendation-systems-full-tutorial-theory-and-python-codes-d70c3abcea8b?source=rss----1cb8742383ec---4</link>
            <guid isPermaLink="false">https://medium.com/p/d70c3abcea8b</guid>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[apriori-algorithm]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[association-rule]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Anna Makkx]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 20:41:05 GMT</pubDate>
            <atom:updated>2020-09-25T12:23:37.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75JhKN0Bhm6wj3oYC0yoPA.jpeg" /></figure><p>Hello there!</p><p>As I have spent too much time while exploring this topic I decided to create a full tutorial of Recommendation Systems where theoretical and practical examples are combined together and publish it for new comers.</p><p>All you need is just a basic understanding of linear algebra, statistics and Python programming language.</p><p>At the end of this tutorial you will be able to build your own recommendation engines and you will have a good understanding about different kind of recommendation systems.</p><p>Now I am going to transfer my learning into yours… Yo!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*WUgpg0_jQ3w_9-QjVqL8gw.jpeg" /><figcaption>If somehow you haven’ t seen the movie WALL-E I recommend to watch it ❤</figcaption></figure><p>Here is the <a href="https://medium.com/machine-learning-and-artificial-intelligence">link</a> of my publication where you can find all of the articles published here. In order to be informed about future articles you can follow this publication.</p><h3>Agenda:</h3><ol><li><a href="https://medium.com/p/b50c86f5fccf/edit">Introduction to Recommendation Systems</a></li><li><a href="https://medium.com/p/63a502881ea9/edit">Introduction to Non-Personalized Recommendations using Association Rules</a></li><li>Non-Personalized Recommendations _ Detailed:</li></ol><ul><li><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-1-introduction-to-association-rules-95e5f017e3d5">Introduction to Association Rules</a></li><li><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-2-association-rule-mining-using-apriori-and-eclat-algorithms-b834fe2cf3da?source=your_stories_page-------------------------------------">Association Rule Mining using APRIORI Algorithm</a></li><li><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-3-implementing-apriori-algorithm-for-association-rules-using-python-5292ecb9ff3d">Implementing Apriori Algorithm using Python</a></li><li><a href="https://medium.com/machine-learning-and-artificial-intelligence/3-4-association-rule-mining-using-eclat-algorithm-b6e50aab2147">Association Rule Mining using ECLAT Algorithm</a></li></ul><p>4. Introduction to Personalized Recommendations (Coming Soon)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d70c3abcea8b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-and-artificial-intelligence/recommendation-systems-full-tutorial-theory-and-python-codes-d70c3abcea8b">Agenda of Recommendation Systems Full Tutorial, Theory and Python Codes</a> was originally published in <a href="https://medium.com/machine-learning-and-artificial-intelligence">Machine Learning and Artificial Intelligence</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>