<?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 Ganapathi Subramanian on Medium]]></title>
        <description><![CDATA[Stories by Ganapathi Subramanian on Medium]]></description>
        <link>https://medium.com/@ganapathisubramanian?source=rss-8a414250c299------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*g1kSkt1EstwUn5zR.</url>
            <title>Stories by Ganapathi Subramanian on Medium</title>
            <link>https://medium.com/@ganapathisubramanian?source=rss-8a414250c299------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:52:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ganapathisubramanian/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[Using self-hosted runners in GitHub actions]]></title>
            <link>https://faun.pub/using-self-hosted-runners-in-github-actions-f66bdaf6df49?source=rss-8a414250c299------2</link>
            <guid isPermaLink="false">https://medium.com/p/f66bdaf6df49</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[continous-integration]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ganapathi Subramanian]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 16:07:59 GMT</pubDate>
            <atom:updated>2022-07-01T11:32:32.694Z</atom:updated>
            <content:encoded><![CDATA[<p>Before getting into this, please go through the blog below to learn about the foundational concepts of GitHub actions.</p><p><a href="https://medium.com/@ganapathisubramanian/getting-started-with-continuous-integration-using-github-actions-1fd7b93027c7">Getting started with Continuous integration using GitHub actions</a></p><p>Let’s learn about runners first.</p><p><strong>Runners:</strong></p><p>Runners are the virtual servers that execute the jobs specified in the workflow. It can clone the repository, install the required software, and run the commands and other processes that can help continuous integration. There are two types of runners supported by GitHub actions</p><ol><li>GitHub-hosted runners</li><li>Self-hosted runners</li></ol><p><strong>GitHub-hosted runners:</strong></p><p>As the name implies, these runners are hosted and managed by GitHub in its virtual environment. It contains a set of tools, packages and configurations leveraged by GitHub actions. The VMs are available in Ubuntu Linux, Windows and macOS operating systems which can be utilized for testing the code in different environments. Also, maintenance and upgrades of the VMs are taken care by GitHub. The steps involved when a workflow is getting triggered are as follows,</p><ol><li>New VM is automatically provisioned for a job</li><li>All the steps get executed on that VM</li><li>After job completion, the provisioned VM is automatically decommissioned</li></ol><p><strong>GitHub-hosted runners comes with the below configuration:</strong></p><p>For Windows and Linux virtual machines:</p><ul><li>2-core CPU</li><li>7 GB of RAM memory</li><li>14 GB of SSD disk space</li></ul><p>For macOS virtual machines:</p><ul><li>3-core CPU</li><li>14 GB of RAM memory</li><li>14 GB of SSD disk space</li></ul><p><strong>Self-hosted runners:</strong></p><p>As mentioned above, GitHub provides fixed configuration for the managed runners. Some of the workloads might require a more powerful configuration. This is where self-hosted runners are useful as they allow us to provision VMs with custom configuration. For example, we can use AWS EC2 c5.2xlarge for compute-intensive workloads and EC2 r5.4xlarge instances for workloads that process large data sets in memory.</p><p>If the workflow requires less power than GitHub-hosted runners, we can consider running cheaper instances on any cloud provider as a self-hosted runner. In this way, we can save cost.</p><p>Also, we can set up an EC2 runner in any subnet of our Virtual private cloud(VPC), which enables communication with any other private resources in the VPC. For example, the runner can access an RDS instance in a private subnet.</p><p>Please note that we are responsible for the cost and maintenance of the runners.</p><p><strong>Enough theory, let’s play!</strong></p><ul><li>Kindly go through the previous blog mentioned at the top for the initial set-up.</li><li>As per the GitHub documentation</li></ul><blockquote>We recommend that you only use self-hosted runners with private repositories. This is because forks of your repository can potentially run dangerous code on your self-hosted runner machine by creating a pull request that executes the code in a workflow.</blockquote><ul><li>Go to repository → Settings → Actions → Runners</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BijRJPh5KxP_lgU38VUURA.png" /></figure><ul><li>Select <em>New self-hosted runner option → </em>Choose runner image → Choose architecture</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5207f96e635bb0ba4fb59838365ed9ab/href">https://medium.com/media/5207f96e635bb0ba4fb59838365ed9ab/href</a></iframe><ul><li>After selection, follow the steps suggested by GitHub to download, configure and use the self-hosted runner. Please make sure you have the necessary permission to execute those steps. It should show the below-given message for a successful setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*s98U5H3glGrSVxog40jJ6A.png" /></figure><ul><li>Commit and push any changes to the repository</li><li>Check the <em>Actions </em>tab from the GitHub page to get the status of workflows</li><li>Check the command line of the self-hosted runner, and the build started there</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*o-lJqyz1HpjWE7MrQHrR2A.png" /></figure><p><strong>Troubleshooting:</strong></p><ol><li>Make sure you have the necessary permissions to set up and configure the runners. For example, in a windows machine, the execution policies might block the external commands</li><li>Sometimes the workflow will not trigger due to an outage very rarely. You can check the <a href="https://www.githubstatus.com/">GitHub Status</a> here</li><li>Check out the official documentation here, <a href="https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners">About self-hosted runners</a></li></ol><p><em>Thanks for reading. Happy learning :)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AU-HikWSTK9eMCmF.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f66bdaf6df49" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/using-self-hosted-runners-in-github-actions-f66bdaf6df49">Using self-hosted runners in GitHub actions</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Continuous integration using GitHub actions]]></title>
            <link>https://faun.pub/getting-started-with-continuous-integration-using-github-actions-1fd7b93027c7?source=rss-8a414250c299------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fd7b93027c7</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ganapathi Subramanian]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 09:08:45 GMT</pubDate>
            <atom:updated>2022-07-01T11:32:59.885Z</atom:updated>
            <content:encoded><![CDATA[<p>Continuous Integration is one of the renowned mantras in the DevOps + agile environment. It is a DevOps practice where developers/engineers regularly merge their code changes into a central repository, and it is built and tested automatically.</p><p><strong>Benefits of continuous integration:</strong></p><ul><li>Prevent integration errors</li><li>Committing code frequently</li><li>Continuous feedback mechanisms</li><li>Catch bugs early</li><li>and many more</li></ul><p><strong>Tools for continuous integration:</strong></p><p>There are many tools for CI. Some of the popular tools are:</p><ul><li>Jenkins</li><li>Bitbucket Pipelines</li><li>AWS CodePipeline</li><li>CircleCI</li><li>GitHub Actions</li></ul><p>As a part of my DevOps learning journey, I came across GitHub actions and I am happy to share my understanding of them here.</p><p><strong>GitHub actions:</strong></p><p>It is a continuous integration and continuous delivery (CI/CD) platform that automates the build, test and deployment phases. It goes beyond the standard CI process and allows you to configure the workflows such as automated labelling for new issues created in the repository. This workflow can be executed in a GitHub-hosted environment called runners or self-hosted runners. It supports Windows, Linux and macOS virtual environments.</p><p><strong>Components of GitHub actions:</strong></p><ul><li><em>Workflows</em>: Configurable automated process defined in a YAML file, that can execute one or more jobs</li><li><em>Events</em>: Activity in the repository that can trigger the workflow execution</li><li><em>Jobs</em>: Set of steps to execute as a part of a workflow</li><li><em>Actions</em>: Custom applications that are combined to create jobs</li><li><em>Runners</em>: Servers that run the workflows when triggered</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*RFRNrkJtuHPa7eaOfqB4MA.png" /></figure><p><strong>Enough theory, let’s play!</strong></p><p>Before getting into this, please brush up on the basic concepts of <em>Node.js</em>, unit testing and g<em>it.</em></p><p><strong>Setting up Node.js Application:</strong></p><ol><li>Create src/app.js</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6ee3281af9d0f58096e4b9718c04ac9/href">https://medium.com/media/a6ee3281af9d0f58096e4b9718c04ac9/href</a></iframe><p>2. Create src/index.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f28888bf84b59705f10964a9111f52ba/href">https://medium.com/media/f28888bf84b59705f10964a9111f52ba/href</a></iframe><p>3. Add test file — src/app.test.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bb5c858a9b3bde2d4663c442078c7e0/href">https://medium.com/media/7bb5c858a9b3bde2d4663c442078c7e0/href</a></iframe><p>4. Add scripts section in package.json</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3928f1f0f5adb798ee0c58958ad83c63/href">https://medium.com/media/3928f1f0f5adb798ee0c58958ad83c63/href</a></iframe><p><strong>Setting up GitHub Actions:</strong></p><ol><li>Create a new GitHub repository or you can use the existing repository if you have one</li><li>Create a directory <em>.github/workflows</em> in the repository to store the workflow configuration file</li><li>Create <em>a YAML </em>configuration file under the workflows directory</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba661b6228b43126b4129d48d84adaef/href">https://medium.com/media/ba661b6228b43126b4129d48d84adaef/href</a></iframe><p>Let’s do a deep dive into the workflow configuration</p><ul><li><em>name</em>: defines the name of the workflow — <strong>Node.js CI</strong></li><li><em>on</em>: defines events that cause the workflow to trigger — we configured <strong>push</strong> and <strong>pull_request </strong>events and the branch to watch</li><li><em>jobs</em>: defines a job — we configured a job named <strong>build</strong></li><li><em>runs-on</em>: defines the runner OS — <strong>ubuntu-latest</strong></li><li><em>steps: </em>a set of steps to perform for the job</li><li><em>uses: </em><strong>checkout </strong>action checks-out your repository under $GITHUB_WORKSPACE and <strong>setup-node </strong>action installs node.js environment</li></ul><p>Now we have the initial setup ready.</p><p><strong>Steps to test the workflow:</strong></p><ol><li>Make some changes anywhere in the app.js file (Ex: console.log())</li><li>Commit and push the changes to your repository. Since we configured the <em>push </em>event in our workflow, it will be triggered automatically</li><li>Check the <em>Actions </em>tab from the GitHub page to get the status of workflows</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZIiUQ0Dp6HeuQX6_z_OUA.png" /></figure><p>4. Optional — You can try to create a new branch from the main branch, make some changes and then merge it back to the main branch to test the <em>pull_request </em>event</p><p><strong>Summary:</strong></p><p>We have discussed the basics of GitHub actions. But this is not the end, based on the requirement of the project, you can also configure the following items,</p><ul><li>Various events and actions</li><li>Multiple workflows</li><li>Using self-hosted runners</li><li>and many more…</li></ul><p>To learn more, please check out the official documentation — <a href="https://docs.github.com/en/actions">GitHub Actions Documentation — GitHub Docs</a></p><p>Repository reference — <a href="https://github.com/GanapathiSubramanian/githubActions">GanapathiSubramanian/githubActions</a></p><p>Thank you for your time. Happy learning :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*nPxkQPsWTzr_ul0D.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd7b93027c7" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/getting-started-with-continuous-integration-using-github-actions-1fd7b93027c7">Getting started with Continuous integration using GitHub actions</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[நான்காம் சக்கரம்.]]></title>
            <link>https://medium.com/@ganapathisubramanian/%E0%AE%A8%E0%AE%BE%E0%AE%A9%E0%AF%8D%E0%AE%95%E0%AE%BE%E0%AE%AE%E0%AF%8D-%E0%AE%9A%E0%AE%95%E0%AF%8D%E0%AE%95%E0%AE%B0%E0%AE%AE%E0%AF%8D-35143992a275?source=rss-8a414250c299------2</link>
            <guid isPermaLink="false">https://medium.com/p/35143992a275</guid>
            <dc:creator><![CDATA[Ganapathi Subramanian]]></dc:creator>
            <pubDate>Sat, 28 Sep 2019 18:08:01 GMT</pubDate>
            <atom:updated>2019-09-28T18:13:09.250Z</atom:updated>
            <content:encoded><![CDATA[<p>நான்காம் சக்கரம்.</p><p>நண்பர்களுடன் சேர்ந்து உணவு விடுதிக்கு செல்ல பேருந்து நிறுத்தத்தில் நின்று கொண்டிருந்தேன். அப்போது அங்கே வந்த மூன்று சக்கர வாகனத்தில் ஏறினோம். பின் இருக்கையில் இடப்பற்றாக்குறை என்பதால் என்னை ஓட்டுனரின் இருக்கையில் இடம் கொடுத்து அமர வைத்தார் அந்த ஓட்டுனர். பயணம் தொடங்கியது.</p><p>திடீரென அவரின் மகனிடம் இருந்து தொலைபேசி அழைப்பு வந்தது.</p><p>மணி : இரவு 7.30</p><blockquote>அப்பா. எப்ப பா வீட்டுக்கு வருவ?</blockquote><blockquote>அரை மணி நேரத்தில வந்துடுவேன் டா…!</blockquote><blockquote>அப்பா… இன்னிக்கு கடைல வாங்கி சாப்பிட்டுகிடவா?</blockquote><blockquote>கடைலியா டா. சரி சாப்டுக்கோ</blockquote><blockquote>நீயும் வா பா. சேர்ந்து போவோம்.</blockquote><blockquote>இல்ல டா. நீ போ. அப்பா வர லேட் ஆகும்.</blockquote><blockquote>சரி பா.</blockquote><p>அதன் பின், எனக்கும் அவருக்குமான உரையாடல்.</p><blockquote>என்ன அண்ணே. அரை மணி நேரத்தில் வரேனு சொல்லிட்டு இப்போ லேட் ஆகும்னு சொல்றிங்க.</blockquote><blockquote>ஆமா பா. மவன் கடைல சாப்பிடனும்னு ஆசை படுறான். அவன் தங்கச்சியும் சேர்ந்து தான் போகும். அப்போ குறைந்தது ₹200 செலவாகும். இன்னும் 2 சவாரி போனம்னா அந்த செலவ ஈடு கொடுக்க முடியும்.</blockquote><blockquote>அப்போ அவன வீட்ல சாப்பிட சொல்லலாம்லா ணே?</blockquote><blockquote>அவனுக்காக தான் உழைக்கிறேன். அவன் சாப்டுட்டு இருப்பான் நினைச்சிட்டே ஓட்டுனா உடம்புல வலி தெரியாது பா ☺</blockquote><p><strong>தன் மகனுக்காக மூன்று சக்கரத்துடன் சேர்ந்து நான்காம் சக்கிரமாக அந்த மனிதன் ஓடிக் கொண்டிருக்கிறான்.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35143992a275" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recommendation Engine : Python]]></title>
            <link>https://medium.com/coinmonks/recommendation-engine-python-401c080c583e?source=rss-8a414250c299------2</link>
            <guid isPermaLink="false">https://medium.com/p/401c080c583e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ganapathi Subramanian]]></dc:creator>
            <pubDate>Sat, 30 Jun 2018 02:58:44 GMT</pubDate>
            <atom:updated>2018-07-04T06:23:52.492Z</atom:updated>
            <content:encoded><![CDATA[<p>Now a days systems are guiding you through out your life with the help of recommendation engine. They recommend you the products based on your interests. For example, if you are searching for a good movie in website like IMDb or Netflix it provides you recommendations based on your interest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*XurW2_nNuhSEC_gb_KdZdA.png" /></figure><p>It applies not only for movies but also in other services like online shopping, online courses, etc. And how it is possible ? Any guesses ?</p><p>Yes. It is possible with python on top of Machine Learning. And let’s move into the core part.</p><p><strong>What is a recommendation system?</strong></p><p>Technically speaking, a recommendation system is a subclass of information filtering system that seeks to predict the “rating” or “preference” a user would give to an item.</p><p>Practically speaking, this system provides you items or products based on your past purchases or interests.</p><p><strong>Types of making recommendation systems?</strong></p><ul><li>Content-based recommendation — based on product attributes</li><li>Collaborative filtering — based on similar users</li></ul><p><strong>Content based recommendation:</strong></p><p>System use the knowledge of each product to recommend a new product.</p><p>Example: If you are interested to watch a romantic movie, then the system would recommend you the list of movies in that genre.</p><p>It works well if you have descriptive data available for the product you have to recommend.</p><p><strong>Collaborative filtering:</strong></p><p>System don’t have any knowledge about the product but it recommend only based on the user’s rating in the past.</p><p>Example: Consider that you rated a list of movies. If you gave 4.5/5 for an horror movie and 1.5 for an adventure movie, then the system would recommend horror movies in the future.</p><p>Now let us move on to the steps for building a system.</p><p>We make use of huge data sets in this module.</p><p><strong>List of data sets used: </strong>movies.csv , movie_ratings_data_set.csv</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXua31Yb1kpnH14wDfePKw.png" /><figcaption>movies data set</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZPhWLWb9uMfIUa4YoNzwA.png" /><figcaption>movie ratings data set</figcaption></figure><p><strong>Representing product reviews in the form of matrix:</strong></p><pre><strong><em># Convert the running list of user ratings into a matrix using the &#39;pivot table&#39; function</em></strong><em><br></em>ratings_df = pd.pivot_table(df, index=<strong>&#39;user_id&#39;</strong>, columns=<strong>&#39;movie_id&#39;</strong>, aggfunc=np.max)<br>print(ratings_df)</pre><pre><strong>#aggfunc is used to handle duplicate data. If an user rated the same movie twice it would consider the maximum value for the duplicates.</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*XHZc--zz9v33rlenuLIf3A.png" /><figcaption>Ratings matrix</figcaption></figure><p><strong>Handling missing data in the matrix:</strong></p><p>Every human is unique in their interests. Assume that the user ratings are the reflection of how much a movie appeals the user’s unique set of interests.</p><p>For example: If user #1 gives 5 rating to movie #1, then obviously he/she might give the same rating to other movie in that genre.</p><p>It is done with the help of matrix factorization and it will be discussed below.</p><p><strong>User Ratings:</strong></p><p>The steps involved in calculating user’s ratings are</p><ul><li>Model how the movie appeals the interests.</li><li>Model the user’s interest.</li><li>Measure how well the user’s interest matches the movie attributes.</li></ul><ol><li><strong>Modelling a movies appeal (matrix M):</strong></li></ol><ul><li>Action appeal rating</li><li>Drama appeal rating</li><li>Romance appeal rating</li><li>Arthouse appeal rating</li><li>Crowd-pleaser appeal rating</li></ul><p>Now we have the attributes and we shall give ratings based on the listed attributes from -5 to +5.</p><p>2. <strong>Modelling user’s interest (matrix U):</strong></p><ul><li>Action interest rating</li><li>Drama interest rating</li><li>Romance interest rating</li><li>Arthouse interest rating</li><li>Crowd-pleaser interest rating</li></ul><p>Similarly, we shall give ratings to user based on the listed attributed from -5 to +5.</p><p>3. <strong>Calculating user’s interest:</strong></p><p>Multiplying matrix M and matrix U gives us a score for each attribute. If we do this for each user, we could get the review matrix for all the movies.</p><p>Based on linear algebra, we represent matrices as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*alE5Xf4J4ZL_iLXv2NDhXw.png" /><figcaption>Matrix Multiplication</figcaption></figure><p>We could use numpy library to perform this operation with just a single line of code.</p><p><strong>Matrix Factorization:</strong></p><p>Matrix Factorization is applied to find the latent(hidden) features :</p><pre>U,M=matrix_factorization_utilities.low_rank_matrix_factorization(ratings_df.as_matrix(),num_features=15,regularization_amount=0.1)</pre><p>Multiplied to find the predicted ratings :</p><pre>predicted_ratings = np.matmul(U, M)</pre><p>Now the predicted ratings are as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*SZ7QXNU8D3a9UIRuQt1ZNQ.png" /><figcaption>Predicted Ratings</figcaption></figure><p>For user #1 it could be seen that the maximum score is obtained for movie #34. So that is the first movie we should recommend him/her. While we recommend to the user, the user might give ratings to our prediction and we may add it to that matrix for future calculations.</p><blockquote>“More the ratings we have, less number of holes in the array and the better optimization to come up with the accurate values for the matrices.”</blockquote><p><strong>Working of Matrix Factorization:</strong></p><p>Matrix factorization is an idea where large matrix could be broken down into smaller matrices. It is used to fill up the holes in the ratings data set as the users might not give ratings to some movies. It is just a backward operation from a larger matrix to smaller matrices using an iterative algorithm. At first we guess, then check and after several iterations we get closer to the correct answer.</p><p><strong>Step 1 :</strong></p><p>Set the elements of U and M matrices with random numbers and if we multiply both of it then the result will be random.</p><p><strong>Step 2 :</strong></p><p>Check how different is the calculated matrices from the real matrix. Obtain a cost function. We call the difference as cost.</p><blockquote>“The Cost is how wrong we are”</blockquote><p><strong>Step 3:</strong></p><p>To use numerical optimization algorithm to search into the minimum cost. The goal is to get the cost function a little closer to zero. The numerical optimization algorithm will tweak the numbers little at a time at each iteration.</p><p>Scipy’s fmin_cg() function is used to find the minimum cost.</p><p><strong>Step 4:</strong></p><p>Step 3 is repeated until we get the minimum cost.</p><p>At some point of iteration, we will get the minimum cost and the values of U and M at time is the values which we use. If we again multiply U and M we will get a little difference from the original matrix but it is not a major flaw as we are closer to it!</p><p><strong>Product Similarity using latent representations:</strong></p><p>Our system couldn’t recommend any product until the user gives any ratings or reviews (i.e; first time users). For this kind of users we could show some similar products to one which they looking at. With the product attributes calculated using matrix factorization we could also calculate the product similarity.</p><p>After concurrent operations to find similarity we get the result as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*kmf4nO08jWaafwPpLXc9UA.png" /><figcaption>Finding similarity</figcaption></figure><p><strong>Finalized Product:</strong></p><p>Our product gives the recommendation based on the given user id. It trains the system based on the past reviews and gives us the result which will be very much closer to the set of interests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*dCS9LWiBj641R6AAaFt9ZA.png" /><figcaption>Recommended Movies</figcaption></figure><p><strong>Avoiding Overfitting:</strong></p><p>Consider movies of two different genres like horror-comedy and serious horror, a bad recommendation system might take the attribute horror by discarding everything else. This could be avoided by regularization with which we could reduce the amount of weight on a single attribute.</p><blockquote>“Higher the regularization amount, lesser the weight on a single attribute”</blockquote><p><strong>References:</strong></p><ul><li><em>“Film Recommendation Systems using Matrix Factorization and Collaborative Filtering” </em>DOI: 10.1109/ICITSI.2014.7048228</li></ul><p><strong>Thank you… Have a great day :)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*KxOlIUQkCHybnF0U4vcrvA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=401c080c583e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/recommendation-engine-python-401c080c583e">Recommendation Engine : Python</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hadoop : OS of Big Data]]></title>
            <link>https://medium.com/@ganapathisubramanian/hadoop-os-of-big-data-3874b4fdb27b?source=rss-8a414250c299------2</link>
            <guid isPermaLink="false">https://medium.com/p/3874b4fdb27b</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[hadoop]]></category>
            <dc:creator><![CDATA[Ganapathi Subramanian]]></dc:creator>
            <pubDate>Sat, 20 Jan 2018 17:41:39 GMT</pubDate>
            <atom:updated>2018-01-20T17:41:39.053Z</atom:updated>
            <content:encoded><![CDATA[<p>The word <strong>BIG DATA </strong>itself denotes “large amount of data”.</p><p>We use traditional database to store information. But the term big data emerges when our traditional database fails to store large data sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*XsCwuKSds3yAUx7Lc7TNRA.jpeg" /></figure><p><strong>Challenges in BIG DATA :</strong></p><p>Rather than large amount of data(VOLUME) there exist major challenges like faster data creation(VELOCITY) and fetching of data in different from various sources(VARIETY).</p><p><strong>Breaking down 3 V’s of Big Data:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*Qr9rY5B5EDP6dHjlh9yrrA.jpeg" /></figure><blockquote>The primary goal is to store data cost efficiently and process it effectively.</blockquote><p>And there comes the framework called “Apache Hadoop” shortly called as “Hadoop”</p><p><strong>Hadoop Origin:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*tZt8h25y69XIzFTs9kW-wQ.jpeg" /></figure><p>This man “Doug Cutting” is the father of Hadoop. Initially he was working for an open source web search engine called <strong>Nutch. </strong>They were facing a major issue of storing large amount of data. At that time, Google published papers on how they are working internally like their distributed file system and mapReduce concept. One of his friend advised him to implement those ideas in their open source project provided Yahoo was ready to invest in this project.</p><blockquote>Open Source + Google’s Paper ideas = Hadoop</blockquote><p>Initially, it was scaled upto some petabytes of data running on thousands of processors. Later hadoop has became the <strong>Operating System </strong>of big data.</p><p><strong>Hadoop Logo:</strong></p><p>“Hadoop….!!!” sounds interesting,right?</p><p>There is an interesting story behind the scenes of logo and the name as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*wGna3qUgpVS0NeMEfNOl3g.jpeg" /></figure><p>The logo was inspired from an elephant toy of Doug Cutting’s Son.</p><p>His words of explaining the logo :</p><blockquote>The name my kid gave a stuffed yellow elephant. Short, relatively easy to spell and pronounce, meaningless, and not used elsewhere: those are my naming criteria. Kids are good at generating such.</blockquote><p>Let’s move even deeper into the technical stuffs of it.</p><p><strong>Core Hadoop:</strong></p><p>Two important goals as said earlier are:</p><ol><li><strong>Storing </strong>— is done using Hadoop Distributed File System (HDFS)</li><li><strong>Processing</strong> — is done using mapReduce</li></ol><p>The available large data are split up into small chunks and stored into number of machines called as clusters. It is then processed from where it stored rather than retrieving it.</p><blockquote>HDFS + mapReduce = Hadoop.</blockquote><p><strong>Key Components of mapReduce:</strong></p><p>The two major components of hadoop ecosytem are:</p><ol><li><strong>Hive </strong>— user could write simple SQL scripts and then hive interpreter turns the code into map-produced code.</li><li><strong>Pig </strong>— simply analyse the data</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*mhHKbqBB_xqUSrkKN7sVnw.png" /></figure><p><strong>HDFS:</strong></p><p>The files are split into small blocks called chunks and each block is given a reference id and it looks like blk_1,blk_2.,etc. A cluster is a collection of machines or nodes. Each blocks are stored in the nodes of the cluster in a <strong>random</strong> fashion. A software running on each node which stores the data is called as the <strong>dataNode</strong>. Another node called <strong>nameNode </strong>is the centerpiece of an HDFS file system. It keeps the directory tree of all files in the file system, and tracks where across the cluster the file data is kept. It does not store the data of these files itself.</p><p><strong>Problems faced in HDFS:</strong></p><ol><li>Network failure between the nodes.</li><li>Disk failure on dataNode or nameNode.</li></ol><p><strong>nameNode failure:</strong></p><p>If the nameNode fails, it’s impossible to access the stored data.Thus nameNode is stored not only in the hard disk but also in NFS (network file system).</p><p><strong>MapReduce:</strong></p><p>MapReduce is the key algorithm that the Hadoop MapReduce engine uses to distribute work around a cluster.</p><p>Again mapReduce is divided into two namely</p><ol><li><strong>Mappers </strong>— maps input key/value pairs to a set of intermediate key/value pairs.</li><li><strong>Reducers </strong>— reduces a set of intermediate values which share a key to a smaller set of values and has 3 primary phases: shuffle, sort and reduce.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*7ASmkKAmu_1PBoJ-v0jH2Q.png" /></figure><p><strong>Real world example :</strong></p><p>Consider a ledger of sales forecast. It’s too annoying to calculate the amount of sales in series and it is time consuming process. Using mapReduce, instead of reading it in series, the staffs of the accounting department were divided into mappers and the reducers.</p><blockquote>Mappers — ledger is divided among themselves and each mappers will maintain a pile of records.</blockquote><blockquote>Reducers — then the piles are received by the reducers and their only work is to add up the final amount rather than seperating it and adding up.</blockquote><p>If there are more keys and say two reducers, we can’t guess the number of keys do each reducer get. The piles are allocated in a random manner as mentioned earlier.</p><p><strong>Daemons of mapReduce:</strong></p><blockquote>Daemons are the piece of code running on each machine of the cluster.</blockquote><p>Along with Mapper and reducer there is another component called job tracker which splits up the job among them.Task tracker running on each machine tracks each task on the cluster.</p><p>Since task tracker and the name node are in the same node , Hadoop framework will be able to run the map task directly on the piece of data which will reduce the network traffic.</p><p><strong>Finally, </strong>as the name suggests the concept is not only BIG but also too DEEP as well. I’ve just gave a short intro about the topic. If you are interested keep on exploring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*CgaecFNaxF7PUDTk1hWg_g.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3874b4fdb27b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>