<?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 Vivek Raja on Medium]]></title>
        <description><![CDATA[Stories by Vivek Raja on Medium]]></description>
        <link>https://medium.com/@vivekraja98?source=rss-ace75bb733bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fEcul7t2Q7-N2oXgd46oYw.jpeg</url>
            <title>Stories by Vivek Raja on Medium</title>
            <link>https://medium.com/@vivekraja98?source=rss-ace75bb733bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 13:54:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vivekraja98/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[Literature Text Translation & Audio Synthesis using Microsoft Azure Cognitive Services]]></title>
            <link>https://vivekraja98.medium.com/literature-text-translation-audio-synthesis-using-microsoft-azure-cognitive-services-5e35add0c79e?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e35add0c79e</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[literature]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 02:17:07 GMT</pubDate>
            <atom:updated>2021-03-11T02:17:07.317Z</atom:updated>
            <content:encoded><![CDATA[<p>There are millions of literature works around the world and scholars translate it into various languages for people to read and enjoy the same. Sadly, there are still a lot of works which are yet to be translated and the fruits of the work remain untasted by the rest of the world. So, I have developed an Open-source website where literature texts are translated into various languages and the same is available in the audio format using Microsoft Azure Cognitive Services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGWDBZXHVhLXUcrzyTtmlw.png" /></figure><h3><strong>About the website ‘Literature Love’:</strong></h3><p>The website URL: <a href="https://bit.ly/azurites">https://bit.ly/azurites</a><br>Source Code: <a href="https://github.com/Vivek0712/lit-translate-audio">https://github.com/Vivek0712/lit-translate-audio</a></p><p>The open-source websites brings in all the literature lovers to share, contribute, read and listen the literature texts translated into various languages and also synthesised into audio format for the same.</p><p><strong>THIRUKKURAL:</strong></p><p>The Tirukkural, or shortly the Kural, is a classic Tamil language text consisting of 1,330 short couplets of seven words each, or kurals. The user needs to enter the chapter from 1 to 133 to receive the ten kurals of that chapter. The Kural and its Tamil explanation is available through the <a href="https://api-thirukkural.web.app/">API</a>. The Tamil explanation is translated into English and Hindi using Microsoft Azure Cognitive Service — Translator API. The original text and the translated texts are available in the Github repo.</p><p>The Kurals and their explanations are also available in the Audio format using Microsoft Azure Cognitive Services — Text to Speech API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gxp6rvVbIeDwOYmUAv8ziQ.png" /><figcaption>Literature Love website — Thirukkural</figcaption></figure><h3>How it&#39;s done?</h3><p>Its really easy to get started with this. All you need is experience working with basic HTML,CSS, Javascript and Azure Account (<a href="https://azure.microsoft.com/en-us/">Sign up for a free account!)</a></p><p>Website Techstack: Static Website (HTML,CSS, JS)<br>Microsoft Azure Services:<br>1. <a href="https://azure.microsoft.com/en-us/">Azure Static Web App Service</a><br>2. <a href="https://azure.microsoft.com/en-in/services/cognitive-services/translator/">Azure Cognitive Service — Translator Python SDK</a><br>3. <a href="https://azure.microsoft.com/en-in/services/cognitive-services/text-to-speech/">Azure Cognitive Service — Text to Speech API</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*q9HvwedeLvpdXLF9FoyJKA.png" /><figcaption>Solution Architecture — Literature Love</figcaption></figure><h3>Let’s get started….</h3><h4>Create Azure Cognitive Services Subscription Key</h4><p>Login into your Azure Portal and Create a new resource -&gt; Cognitive Service. Fill out the relevant details. Refer <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows">here </a>to create the same.</p><p>Once the resource is created. Go to the cognitive service resource and under Resource Management → Access Keys &amp; Endpoint and copy the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*lxTW-dXXGcGGNSJK5LbtyA.png" /><figcaption>Cognitive Service Key</figcaption></figure><h4>Translation of Kurals and explanation</h4><p>Copy paste the key and the region in the headers as mentioned in the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d0e6737fc69130a37c72d1f08026922/href">https://medium.com/media/3d0e6737fc69130a37c72d1f08026922/href</a></iframe><p>We are using <a href="https://azure.microsoft.com/en-in/services/cognitive-services/translator/">Azure Cognitive Service — Translator Python SDK</a>. This will fetch the kurals from the API and translate the explanation from tamil to English and Hindi. The whole data is dumped in a JSON file so that it can be used by other developers for future use. The file is available in the Github Repo. This code can be run in Python Notebook in Azure or in your local Python IDE.</p><h4>Creating the Audio Synthesis for the text translations.</h4><p>Load the exp.json (thirukkural translation json file) in your Javascript code and add click listener to the button which will invoke the <a href="https://azure.microsoft.com/en-in/services/cognitive-services/text-to-speech/">Azure Cognitive Service — Text to Speech API</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6751db36d532d54807ffb5c358c1be29/href">https://medium.com/media/6751db36d532d54807ffb5c358c1be29/href</a></iframe><p>We are going to use Microsoft Azure Speech API, which requires us to include the following script file that will be imported through CDN. I have written a playaudio function which will perform Text-to-Speech using Azure Cognitive Service using <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp">Speech Synthesis Markup Language (SSML)</a> . SSML gives us freedom to change the Standard voice, language.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4ee2618be6bbab34cddadcb6a075ca8/href">https://medium.com/media/d4ee2618be6bbab34cddadcb6a075ca8/href</a></iframe><h4>Deploy the application in Azure Static Web App</h4><p>Now that our whole website is ready, its time for the final step: DEPLOYMENT</p><p><strong>MYTH: </strong>Deployment takes a lot of effort to set-up the environment. I need to buy a custom domain for my website. I need to set up CI/CD for my web app.<br>All this takes more efforts and time.</p><p><strong>FACT: AZURE STATIC WEB APP SERVICE does everything for you.</strong></p><p>Azure Static Web App Service is used only for static website (HTML, JS,CSS). If your website is built on some framework, use Azure App Service which is exactly the same.</p><p>Deployment can done in steps:</p><ol><li>Create a repository in Github and upload all the source files.</li><li>Go to Azure Portal -&gt; Azure Static Web App (Preview) -&gt; Create</li><li>Enter the relevant details and sign up with your Github Account for the deployment details.</li><li>Select your repo and the branch.</li><li>Create</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*bzu90bYUW23h_O3_9Sxraw.png" /><figcaption>Azure Static Web App Service</figcaption></figure><p>You application will be deployed along with CI/CD pipelines (using GitHub Actions). You will can find the url of the website here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sw9BZM6Td2vNW4NKe0gCYw.png" /><figcaption>Website is deployed successfully</figcaption></figure><p>Voila, We have successfully deployed our web app which can translate, perform Text-to-speech for the literature texts. You can enjoy reading, listening to <strong>Tamil, English and Hindi version of Thirukkural.</strong></p><h3>How you can contribute to this amazing initiative</h3><h4>As a Literature Lover</h4><p>If you are a literature lover irrespective of any language, you can help us by contributing the original text of literature to us by<a href="https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAANAAQwRVW1UNzMyOFFCUFU3R08xUk4zSlc5SjhONTFPOC4u"> <strong>filling up this form</strong></a>.</p><p>As a <strong>reader</strong>, you can also enjoy the translated texts and audio books available and share the same with your book reading community, fellow readers etc. You are always welcome to suggest the literature works you want to read by <a href="https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAANAAQwRVW1UMUc4NEQ4OTIxQU9SR0YyV1RYNTdOMVlNVC4u"><strong>filling this form</strong></a>.</p><h4>As an API Developer</h4><p>You can help us by creating APIs for the original literature texts. You can find the original texts in the same Github <a href="https://github.com/Vivek0712/lit-translate-audio">repo</a>. The APIs will help us to create Translate and Text-to-Speech services in an easier way.</p><h4>As a Web Developer</h4><p>You can improve the website by working on developing and maintaining the website (usage of other Web tech stack like MERN etc is welcomed). You are just an issue or <a href="https://github.com/Vivek0712/lit-translate-audio">pull request</a> away from making a big change towards the initiative.</p><h4>As a Python/ML Developer</h4><p>You can help us perform the Translations and Text-to Speech for the literature texts and review the same. On the future run, you can help us creating own ML Models to perform the same. Wanna have a chat or need help getting started, you are always welcomed to ping me in my <a href="https://linkedin.com/in/vivek0712">social media handles</a>.</p><p>If you are a beginner in cloud/tech domain who wants to get started with Azure or a professional who is looking forward to more technical sessions and network with other experts, you are always welcome to join our Azure Developer Community but not limited to.</p><h4><a href="https://www.meetup.com/de-DE/azure-developer-community-chennai/">Azure Developer Community — Chennai</a><br><a href="https://www.meetup.com/azure-developer-community-madurai/">Azure Developer Community — Madurai</a><br><a href="https://www.meetup.com/azure-developer-community-coimbatore/">Azure Developer Community — Coimbatore<br></a><a href="https://www.meetup.com/microsoft-reactor-bengaluru/">Microsoft Reactor — Bengaluru</a><br><a href="https://azure.microsoft.com/en-us/resources/join-the-azure-developer-community/">Microsoft Azure Newsletter</a></h4><h3>References:</h3><ul><li><a href="https://azure.microsoft.com/en-in/services/cognitive-services/text-to-speech/">https://azure.microsoft.com/en-in/services/cognitive-services/text-to-speech/</a></li><li><a href="https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp">https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp</a></li><li><a href="https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows">https://docs.microsoft.com/en-us/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows</a></li><li><a href="https://github.com/Azure-Samples/cognitive-services-speech-sdk">https://github.com/Azure-Samples/cognitive-services-speech-sdk</a></li><li><a href="https://en.wikipedia.org/wiki/Tirukku%E1%B9%9Fa%E1%B8%B7">https://en.wikipedia.org/wiki/Tirukku%E1%B9%9Fa%E1%B8%B7</a></li><li><a href="https://api-thirukkural.web.app/">https://api-thirukkural.web.app</a></li></ul><h3>Footnote</h3><p>If you have made to this far end of the article, clap yourself for your amazing interest in tech, literature and also for this article. Don’t forget to leave comments about this blog, website and I am all ears and that’s how we grow together as a community. Time to hop on to this awesome initiative and let&#39;s make this Readers’ world a fun and enjoyable place.</p><p>I am always open to hackathons, developer community work, tech, movies, memes :P , feel free to reach out to me in my social handles : <a href="https://linkedin.com/in/vivek0712">LinkedIn,</a> <a href="https://twitter.com/Vivekraja007">Twitter</a> or let’s go grab a coffee or pizza! xD</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e35add0c79e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inside AWS DeepRacer Garage: Fine-tuning the performance of your model]]></title>
            <link>https://vivekraja98.medium.com/inside-aws-deepracer-garage-fine-tuning-the-performance-of-your-model-4307075de746?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/4307075de746</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[aws-deepracer]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Fri, 23 Oct 2020 07:16:55 GMT</pubDate>
            <atom:updated>2020-10-23T07:16:55.657Z</atom:updated>
            <content:encoded><![CDATA[<p>How cool is to watch your AWS DeepRacer car navigating autonomously every corner and turn in the circuit with your Reinforcement Learning model guiding it? Now its time to fine-tune the model so that we will try to clock the best time.</p><p>If you are new to AWS DeepRacer, visit my previous article on <a href="https://medium.com/@vivekraja98/get-started-with-aws-deepracer-create-train-race-your-first-model-7f264d647313">“Get Started with AWS DeepRacer: Create, Train, Race your first model”</a>. Let’s get our hands greasy now!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jftwKwRjtxMnCZDO7Sv1A.jpeg" /><figcaption>Pit Stop Crew, assemble!</figcaption></figure><p>We will try to dive deeper into this tutorial and discuss more on the Action Space, Reward Function and Hyper-parameter tuning</p><h3>Action Space</h3><p>Action Space is the set of actions that is subjected to Maximum speed, Speed Granularity, Maximum Steering Angle and Steering angle Granularity. At a particular instance of the input image from the sensor (Front-facing camera), the model tries to pick one of the actions and the evaluates the reward obtained for the particular action.</p><p>In the last tutorial, we went with the default DeepRacer vehicle. To define our own action space, we will create a new DeepRacer vehicle.</p><p>On your left navigation pane, under Reinforcement Learning Tab, click Your Garage. You will be redirected to another page where we can build our own vehicle. Click <strong>Build New Vehicle</strong>.</p><p><strong>Step 1: Mod specifications</strong></p><p>Since we are only focusing on Time Trails, so the only sensor needed is the Front-facing Camera. Select Camera and then proceed to the next step.</p><p><strong>Step 2: Action space</strong></p><p>Granularity refers to the degrees of freedom of the DeepRacer model. Change the maximum and granularity values and notice the action list gets updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*8AmDDZ8Tf9e7zQF43MJXpw.png" /><figcaption>Vehicle Mod Specification</figcaption></figure><p>These action list define the behaviour of the model on the track.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*QG7Xj3lqJB2yAIsEDkS1rA.png" /><figcaption>Action list</figcaption></figure><p><strong>Step 3: Personalization</strong></p><p>You can personalize your vehicle by giving it a special unique name and the body colour of the car.</p><h3>Reward Function</h3><p>The reward function and the action space go hand in hand. The reward function must be compatible with the values specified in the action list.</p><p>Last time, we had selected one of the default reward function and trained the model. Though that&#39;s the best way to start, we need to understand the parameters of the vehicle input and design our own reward function to clock the best time.</p><p>The parameter that is passed to the reward function is ‘params’ which is a Python Dictionary object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/107d94250f9a9589c0b9864405818f6f/href">https://medium.com/media/107d94250f9a9589c0b9864405818f6f/href</a></iframe><p>I recommend you to read the official documentation and understand each parameter <a href="https://docs.aws.amazon.com/deepracer/latest/developerguide/deepracer-reward-function-input.html"><strong>here</strong></a>.</p><h3>HyperParameter Tuning</h3><p>Hyperparameters are variables to control your reinforcement learning training. They can be tuned to optimize the training time and model performance.</p><p>We have provision to fine-tune seven hyperparameters. We will try to understand how each hyperparameter influences model training. Hyperparameter tuning is all about iterative improvement through trial and error method.</p><p><strong>Gradient descent batch size: </strong>The batch is a subset of an experience buffer that is composed of images captured by the camera mounted on the AWS DeepRacer vehicle and actions taken by the vehicle.</p><p><strong>Number of epochs: </strong>The number of passes through the training data to update the neural network weights during gradient descent.</p><p><strong>Learning rate: </strong>The learning rate controls how much a gradient-descent (or ascent) update contributes to the network weights.</p><p><strong>Entropy: </strong>The added uncertainty helps the AWS DeepRacer vehicle explore the action space more broadly.</p><p><strong>Discount factor: </strong>The discount factor of 0 means the current state is independent of future steps, whereas the discount factor 1 means that contributions from all of the future steps are included.</p><p><strong>Loss type: </strong>The type of objective function to update the network weights.</p><p><strong>The number of experience episodes between each policy-updating iteration: </strong>The size of the experience buffer used to draw training data from for learning policy network weights.</p><h3>Training and Evaluating your model</h3><p>We need to specify the stopping time for the model training. But there is a catch here. If we train our model for lesser time, there is a high chance of model underfitting, that is, the car may not perform well.</p><p>If the model trained for higher time, the model may experience overfitting, that is the model may perform really well for the current track you had trained for, but may not perform well in other tracks.</p><p>To achieve the generalization, we need to set optimum hours of training, so that the model converges. From other fellow developers, it is said that 4 hours of training yields good result.</p><p>Keep an eye on the evaluation Simulation and the Logs of the model, so that you can improve in future models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*UT4UqvU3BTFUHib8tYFggg.gif" /><figcaption>Evaluation</figcaption></figure><p>Now we are all set to conquer the checkered flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*PsH2LmUoxpB0LK-OKB0WfQ.jpeg" /></figure><h3>Additional Resources:</h3><p>AWS DeepRacer e-learning course for free: <a href="https://www.aws.training/Details/eLearning?id=32143">https://www.aws.training/Details/eLearning?id=32143</a><br>For source-code and get started pack, see <a href="https://github.com/Vivek0712/aws-deepracer">https://github.com/Vivek0712/aws-deepracer</a><br>For more information about AWS DeepRacer, see <a href="https://aws.amazon.com/deepracer/">https://aws.amazon.com/deepracer/</a>.<br>For more information about AWS Training and Certification, see <a href="https://aws.amazon.com/training/">https://aws.amazon.com/training/</a>.<br>To troubleshoot and collaborate about the AWS DeepRacer, see <a href="https://forums.aws.amazon.com/forum.jspa?forumID=318">https://forums.aws.amazon.com/forum.jspa?forumID=318</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4307075de746" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get started with AWS DeepRacer: Create, Train, Race your first model]]></title>
            <link>https://vivekraja98.medium.com/get-started-with-aws-deepracer-create-train-race-your-first-model-7f264d647313?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f264d647313</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[race]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[f1]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Mon, 19 Oct 2020 04:31:03 GMT</pubDate>
            <atom:updated>2020-10-19T04:31:03.783Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wanted to race in F1 against legends like Daniel Ricciardo? For someone like me who is very passionate about<strong> F1 and Machine learning</strong> but driving skills are insanely bad, there is only one way to make my dream come true: <strong>AWS DeepRacer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJuNiybAYt9mlhNegZB4gA.jpeg" /><figcaption>Posing as an F1 driver :)</figcaption></figure><p>In this tutorial, we will see what is AWS DeepRacer and its underlying Machine Learning Concepts and then create and race our first DeepRacer model</p><h3>What is AWS DeepRacer?</h3><p>AWS DeepRacer is a cloud based 3D racing simulator, fully autonomous 1/18th scale race car driven by reinforcement learning, and global racing league. We can build models in Amazon SageMaker and train, test, and iterate quickly and easily on the track in the AWS DeepRacer 3D racing simulator. It gives you an interesting and fun way to get started with reinforcement learning (RL). RL is an advanced machine learning (ML) technique that learns very complex behaviours without requiring any labelled training data, and can make short term decisions while optimizing for a longer-term goal.</p><h3>About AWS DeepRacer Evo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*kW49cwafVp4FKiFy7woGXg.png" /><figcaption>AWS DeepRacer Evo</figcaption></figure><p>AWS DeepRacer Evo is the next generation in autonomous racing. It comes fully equipped with stereo cameras and LiDAR sensor to enable object avoidance and head-to-head racing, giving developers everything they need to take their racing to the next level. In object avoidance races, developers use the sensors to detect and avoid obstacles placed on the track. In head-to-head, developers race against another DeepRacer on the same track and try to avoid it while still turning in the best lap time. Forward-facing left and right cameras make up the stereo cameras, which helps the car learn depth information in images. This information can then be used to sense and avoid objects being approached on the track. The LiDAR sensor is backwards-facing and detects objects behind and beside the car. We will be using simulated car and track in this tutorial</p><p>Before jumping into creating a model, it is very important to understand some basic concepts of Reinforcement Learning.</p><h3>Reinforcement Learning</h3><p>In reinforcement learning, models learn by a continuous process of receiving rewards and punishments for every action taken. It’s all about rewarding positive actions and punishing negative ones.</p><p>Let’s take an example. Imagine a simple game wherein you have a robot that runs from left to right and must avoid obstacles by jumping over them at the right time. If your robot successfully clears an obstacle, it gets 1 point, but if the robot runs into it, it loses points. The goal of the game, of course, is for your robot to clear the obstacles and avoid a crash. Although simple in concept, this is a great starting point for understanding how reinforcement learning works and how you can use it to solve a concrete challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t3qY_P3AAPqSdx17quoVOg.gif" /><figcaption>Reinforcement Learning</figcaption></figure><p><strong>Terminologies</strong></p><p><strong>Agent:</strong> The system (like robots) that interacts and acts on the environment.<br><strong>Policy: </strong>A policy defines how an agent acts from a specific state.<br><strong>Rewards: </strong>Reward <em>r(s, a)</em> defines the reward collected by taking the action <em>an</em> at state <em>s</em>. Our objective is to maximize the total rewards of a policy.<br><strong>Episode: </strong>Playing out the whole sequence of state and action until reaching the terminate state or reaching a predefined length of actions.<br><strong>Discount rate</strong>: Discount rate values the future rewards at the present value.</p><h3>Applying RL to AWS DeepRacer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*FNHItaKtnyqckR8d3RW4lg.gif" /></figure><p>I highly recommend you to take <a href="https://www.aws.training/Details/eLearning?id=32143">AWS DeepRacer e-learning course</a> for free to understand the underlying concepts better.</p><h3>Time to create &amp; train DeepRacer model</h3><p>First, we need to create an AWS Account to get started. Sign up for a free account if you don&#39;t have one. (Set region to us-east-1). And let’s get started.</p><blockquote>Note: This exercise is designed to be completed in your AWS account. AWS DeepRacer is part of AWS Free Tier, so you can get started with the service at no cost. For the first month after sign-up, you are offered a monthly free tier of 10 hours of Amazon SageMaker training, and 60 simulation units of Amazon RoboMaker (enough to cover 10 hours of training). If you go beyond those free tier limits, you will accrue additional costs. For more information see the AWS DeepRacer Pricing page</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPZuswFjX2M_wM5TxLF9aA.png" /><figcaption>AWS DeepRacer Console</figcaption></figure><p>Go ahead and click “Create Model” and give the relevant model name and description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*kxHPSqbEuzY-035xGFwSyg.png" /></figure><p>We need the track to train our DeepRacer model, let’s go with ReInvent 2018. You can experiment with other tracks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*Z89cArOHghR9EzNga_qHWg.png" /></figure><p>To start off in a simple way, let’s select <strong>Time Trail </strong>as our race mode. The objective is to complete the race in fastest possible time.</p><p>Now we need to concentrate on two important things that will make our DeepRacer model race better than other models</p><ol><li>Reward Function</li><li>Hyperparameter Tuning</li></ol><p><strong>Reward Function: </strong>As we had already discussed, reward function gives the reward to the agent for its good action and penalises for incorrect action.</p><p>Lets design a simple reward function (Pre-available reward template in AWS DeepRacer). We will make the DeepRacer car stay as close as possible to the center line. If it is away or moves out of track, we will penalise it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8f55e0c6acc190d0a88aed55666722c/href">https://medium.com/media/f8f55e0c6acc190d0a88aed55666722c/href</a></iframe><p><strong>Hyperparameter Tuning:</strong></p><p>The hyperparameters of a model is what we supply externally to the model. Though we can go with the default values, we can play with the values of each hyperparameter to see if we can reach the best performance. It is more of trail and error method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*huOFROP3xnkp3CevgVah2Q.png" /></figure><p>Before we start training, lets set the stopping condition i.e, the training time. The more the model gets trained, the better the performance. Keeping the free tier limit and costs, lets set to 60 mins of training.</p><p><strong>Training and evaluating the AWS DeepRacer model</strong></p><p>Once we start training the model, we can find the real-time reward graph and video simulation of the DeepRacer car where the model training takes place</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*XUEl48-AnsA1mpSK8LDwvA.gif" /><figcaption>Video Simulation of training model</figcaption></figure><p>We need to wait for 60 minutes to complete the training before we evaluate the trained model. Let’s grab a cup of coffee meanwhile :)</p><p>Once the training is complete, under Evaluation tab, view the simulation of the trained model of AWS DeepRacer performing on the the simulated track</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*UT4UqvU3BTFUHib8tYFggg.gif" /></figure><h3><strong>Congrats, We have successfully trained and raced our first AWS DeepRacer Model.</strong></h3><p>I know the performance of the model is not up to the mark, that is because we have a simple reward function, default hyperparameters and less training time .</p><p>In our next part of this tutorial series, we will see how we can improve our AWS DeepRacer Model.</p><h3>About AWS DeepRacer League</h3><p>The AWS DeepRacer League is open for 2020 and October 31 is the last date to submit our model. The model will be evaluated against racers from all over the world and the leaderboard is updated in realtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*tIa-E7w34Qc275tkQr_Imw.png" /></figure><h3>Introducing my AWS DeepRacer Community Race League — TFC Circuit de Virtua</h3><p>AWS DeepRacer also allows us to create community race league, and I am hosting one such Community Race on behalf of Tamil FOSS Community called<strong> “</strong><a href="https://console.aws.amazon.com/deepracer/home#raceToken/qIm7P1gHQ9O70-kyL5CJNg"><strong>TFC Circuit de Virtua</strong></a><strong>”.</strong></p><p>To join my race league and compete against our fellow DeepRacers, click on the link here: <a href="https://bit.ly/tfc-race"><strong>https://bit.ly/tfc-race</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7px71fEoqHyPSdFakc06Q.jpeg" /></figure><p>If you have reached this far, I appreciate your patience and interest. Do give claps and share if you find this article interesting and stayed tuned for next part!</p><h3>The race is on, gentlemen!</h3><h3>Resources:</h3><p>For source-code and get started pack, see <a href="https://github.com/Vivek0712/aws-deepracer">https://github.com/Vivek0712/aws-deepracer</a><br>For more information about AWS DeepRacer, see <a href="https://aws.amazon.com/deepracer/">https://aws.amazon.com/deepracer/</a>. <br>For more information about AWS Training and Certification, see <a href="https://aws.amazon.com/training/">https://aws.amazon.com/training/</a>. <br>To troubleshoot and collaborate about the AWS DeepRacer, see <a href="https://forums.aws.amazon.com/forum.jspa?forumID=318">https://forums.aws.amazon.com/forum.jspa?forumID=318</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f264d647313" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting and Visualizing Twitter Sentiment during COVID-19 Pandemic using AWS Comprehend and…]]></title>
            <link>https://vivekraja98.medium.com/detecting-and-visualizing-twitter-sentiment-during-covid-19-pandemic-using-aws-comprehend-and-c641e1549e2b?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c641e1549e2b</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Tue, 08 Sep 2020 02:31:01 GMT</pubDate>
            <atom:updated>2020-09-08T02:31:01.384Z</atom:updated>
            <content:encoded><![CDATA[<h3>Detecting and Visualizing Twitter Sentiment during COVID-19 Pandemic using AWS Comprehend and Quicksight</h3><p>People are experiencing a prolonged state of physical isolation from their friends, as well as teachers, extended family, and community networks due to COVID-19 lockdown. While quarantining adults has generally led to negative psychological effects, including confusion, anger, and post-traumatic distress, it is unknown how these measures have impacted children.</p><p>The twitter consumer sentiment is the most common text classification tool that analyzes an incoming tweet and conveys if the underlying sentiment is positive negative or neutral from the public.</p><p>Taking India as a case study, we are going to analyze the sentiment of people during each phase of COVID-19 Pandemic. The three phases are Pre-lockdown, Lockdown and Unlock phases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*3t3abuJ904bjt2mPf2OGqA.png" /></figure><p>Let’s orchestrate AWS services to access the data, identify the sentiment and then visualize the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*FiC0qhf2p8WsxPbE97EcsA.png" /><figcaption>System design</figcaption></figure><h4>Tweet Processing and Upload</h4><p>The tweets were collected on three bases: 1. Keyword, 2. Location 3. Date range. Only tweets in English were collected for this purpose</p><ol><li>Keyword: 15 trending keywords related to COVID-19.</li><li>Location: Chennai, Bangalore, Hyderabad, Delhi, Mumbai, Kolkata.</li><li>Date Range: Three phases — Pre-lockdown, Lockdown, Unlock.</li></ol><p>The GetOldTweets3 python library was used to collect the tweets based on the above three criteria. To preprocess the data, NLTK packages were used.</p><p>To save you from the hassle, I have uploaded the dataset in my <a href="https://github.com/Vivek0712/covidtwitterdataset/tree/master/dataset/processed">Github repo</a>. The techniques used for data collection and preprocessing is explained in the readme file.</p><p>All dataset contains three features: tweet text, location, phase.</p><h4>Setting up AWS Account and IAM roles and users</h4><p>If you are new to AWS, then you create your free AWS account <a href="https://aws.amazon.com/free/">here</a>.</p><blockquote>Warning: Though we are using all free tier services in this tutorial, it is up to your responsibility to prevent from incurring additional costs</blockquote><ol><li>Creating a new role</li></ol><p>Go to IAM Console and then click roles. Give a name for the role (s3-lambda-role) and then select Lambda as the use case. Under permission, attach the following policies as mentioned in the picture below and create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*tzq2oyjzJS35jb3GEsHblg.png" /></figure><p>2. Creating a new user</p><p>We are creating a user to export the Dynamo DB data. Click Users in the side pane of IAM console. Create a new user and attach “<a href="https://console.aws.amazon.com/iam/home?#/policies/arn%3Aaws%3Aiam%3A%3Aaws%3Apolicy%2FAmazonDynamoDBFullAccess">AmazonDynamoDBFullAccess</a>” permission. Also, under the security tab, generate an access key and secret key (Keep it safe as we need it in later part of the tutorial)</p><p>Now we all are all set to proceed with the next step. So, whenever a file gets uploaded in the bucket, we need to send it to AWS Comprehend and receive the sentiment of each tweet and populate the data in Dynamo DB. So we need three things here.</p><ol><li>An S3 Bucket</li><li>Dynamo DB table</li><li>A Lambda function</li></ol><h4>Create an S3 bucket</h4><p>Navigate to S3 console and create new bucket name it as “covidsentimenttwitter” or any name as you wish. This is where our dataset will be uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mwsvZpc9Ev0DbBIUYGJYw.png" /></figure><h4>Create a Dynamo DB table</h4><p>Navigate to Dynamo DB console and on the side navigation pane, click Tables. Create a new table with “text” as the partition key. Also, note down the region where the table is created. In this tutorial, my table “covidsentiment” is created in “us-east-2” region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*s_pgLWBckx0dj23fzUiRWQ.png" /></figure><h4>Lambda Function</h4><p>The lambda function is going to act as a bridge between S3 object and Dynamo DB table.</p><p>Navigate to Lambda function console and click create function.</p><p>Give a suitable name and choose Python 3.8 as runtime. Under Permissions, click “Use an existing role” and select the role which we had created earlier in this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EpdrLNYz0jeycrxnlIrHlQ.png" /></figure><p>Once the function is created, navigate inside it. In the Designer Pane, click Add Trigger. In Trigger Configuration, select S3 and select the bucket name which we had created earlier. Set the event type as “All Object create event”. So whenever a new object is created in the S3 bucket, this lambda function will be triggered.</p><p>Also, set the execution timeout for lambda function as 15 minutes.</p><p>Now we need to identify the sentiment of the tweet in the uploaded file and write the data to Dynamo DB. Run the following code under the function code of the lambda function. Replace the name of the bucket, table name as per your configuration and save the function. The lambda function code is as below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d31476cdb2c32b449ea7fcb69ac8302/href">https://medium.com/media/9d31476cdb2c32b449ea7fcb69ac8302/href</a></iframe><p>Now you can upload all three dataset files in S3 bucket. You can monitor the lambda function and view the output logs by switching to the Monitoring tab in the lambda function. You can view the populated items in the Dynamo DB under Items tab in Dynamo DB console.</p><h4>Export Dynamo DB data</h4><p>Once the data is populated, we can simply export the whole Dynamo DB data as CSV. <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">Install </a>the AWS CLI, and<a href="https://stedolan.github.io/jq/download/"> jq </a>library in your local machine, if you don&#39;t have it.</p><p>In your terminal, type</p><blockquote>$ aws configure</blockquote><p>Enter the Access ID, Secret key, Region name which we had created earlier.</p><p>Execute the following command to export the Dynamo DB. Replace the table name as per your config.</p><blockquote>$ aws dynamodb scan — table-name covidsentiment — select ALL_ATTRIBUTES — page-size 500 — max-items 100000 — output json | jq -r “.Items” | jq -r “(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ].S])[] | <a href="http://twitter.com/csv">@csv</a>” &gt; table.csv</blockquote><h4>Visualizing the sentiment dataset using AWS QuickSight</h4><p>Navigate to <a href="https://aws.amazon.com/quicksight/">AWS QuickSight</a>. Under the Analysis tab, click New Analysis -&gt; New Dataset -&gt; Upload a file. Click and upload the exported Dynamo DB data CSV file.</p><p>Once the dataset is imported, Click Add Visual and then select your preferred graph and set the relevant Axis, filters and play with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPp2FRpR2I4TZ24AHjyaKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpxrEAlmdwElLxAIm_kH6A.png" /></figure><p>Once you have derived meaningful insights with the data, you can publish the QuickSight dashboard.</p><h4>Future Enhancement</h4><ol><li>You can use AWS Firehose to stream real-time data from Twitter to S3.</li><li>You can build a data pipeline between Dynamo DB / or any other DB to Quicksight Data source.</li><li>Host the dashboard as a web app using Elastic Beanstalk</li></ol><p>Voila, we have built a dashboard to visualize the sentiment of the twitter during COVID-19 pandemic.</p><p>If you have reached this part of the article, give claps, follow me for more articles on AI and Cloud. Until then, if you have any queries, you can comment or drop a <a href="/service/mailto:vivekraja98@gmail.com">mail </a>or message at <a href="https://linkdin.com/in/vivek0712">LinkedIn</a> or <a href="https://twitter.com/vivekraja007">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c641e1549e2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building End to End COVID-19 Forecast Model using Azure ML]]></title>
            <link>https://vivekraja98.medium.com/building-end-to-end-covid-19-forecast-model-using-azure-ml-16da338864b3?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/16da338864b3</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-machine-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[covid19]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 22:44:30 GMT</pubDate>
            <atom:updated>2020-06-08T22:44:30.951Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months before, we would have never thought how the entire would change due to the pandemic caused by a virus so-called <strong>COVID19 a.k.a Coronavirus</strong>. It has changed how the entire world works right now and we must salute to the people working in the frontline to prevent, cure us of this deadly virus.</p><p>As a Data &amp; Cloud Enthusiast, I wanted to contribute my purpose in these times of dire situation and most importantly to empower people with AI/ML knowledge to contribute. I hope this tutorial article would serve one of its purposes. I have tried my best to simplify the process that you can build your own model at the end of this article. All you need to know is the basics of<strong> Python Programming</strong> to get started!</p><p>The <strong>website</strong> I had created is <a href="https://newcovid.herokuapp.com/"><strong>https://newcovid.herokuapp.com</strong></a> to visualize and get real-time information about COVID-19 status worldwide, India (State and District wise) and most importantly, the forecast of COVID-19 cases in India for next 7 days.</p><p>On you mark….</p><h3>Step 1: Get your Azure Account</h3><p>First thing first, we need to get an <strong>Azure Account</strong> to get started. If you have one, that’s well and good. If not, don’t worry, Microsoft is giving a free trial to access Azure Cloud. Register and sign up here: <a href="https://azure.microsoft.com/free">https://azure.microsoft.com/free</a></p><h3>Step 2: Setting up the Workspace</h3><p>We need to create a workspace for our project. Workspaces are Azure resources, and as such, they are defined within a resource group in an Azure subscription, along with other related Azure resources that are required to support the workspace.</p><p>In your Azure portal homepage, click “Create a Resource”. Since we are going to do many ML tasks, now select “AI + Machine Learning” under Azure Marketplace column. Select the first option “Machine learning”. Now create a workspace by filling up the following details. Enter the details as shown the image. You are free to use any name for the Resource Group, Workspace. Select the appropriate subscription (Free trial if you are using one). Click “Review and Create once it is done”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*r_dUvKU2fh-0UGjP_za2GA.png" /><figcaption>Azure Workspace Creation</figcaption></figure><p>Since we need a compute instance to run the entire ML tasks, let’s create one. Go to ml.azure.com. On the left side, click “Compute”. Under Computer Instances, click New. Give a name for your Compute Instance and select Virtual Machine type as “STANDARD_DS3_V2”. Wait a minute or two for your VM to spin up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*4qKO1trCxPbLKWhKyomNjw.png" /><figcaption>Compute Instance Creation</figcaption></figure><p>Click “Jupyter” and that will take to Jupyter Notebooks.</p><p>Create a new folder by clicking “New” on the right side. Navigate to the folder and then create new “Python 3.6 Azure ML”. Open the .ipynb notebook file you had just created.</p><h3>Step 3: Creating an experiment</h3><p>We need to connect our load our workspace and set up a new experiment, say “covid_exp”. This can be done as shown below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73d0587c39cb81c32390f185cd47a65d/href">https://medium.com/media/73d0587c39cb81c32390f185cd47a65d/href</a></iframe><h3>Step 4: Creating a Pipeline script file</h3><p>We are going to create a script file which will be the input to the ML Pipelines. ( Don’t worry, we will come to back to Pipelines in the later section of the article)</p><blockquote>The following lines of codes under this step must be executed in single notebook cell.</blockquote><p>The script is going to perform the following actions under the run context of our “covid_exp” experiment.</p><ol><li>Import the COVID-19 Indian Data.</li><li>Train the forecasting model</li><li>Upload the forecast data to Azure Storage.</li></ol><h4>Import the COVID-19 Indian Data</h4><p>First, we will create a new python script file called prediction.py and import all necessary libraries. You can run these lines of code in our .ipynb Python Notebook we are working on.</p><p>We need to define the run context for the experiment, followed by importing the COVID-19 Indian data from <a href="https://api.covid19india.org/data.json">https://api.covid19india.org/data.json</a></p><p>Load the Time series data in Pandas data frame. We will be working on the daily number of cases of confirmed, recovered and deaths. Split the data as Train and test dataset with 0.75 ratios.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e348e0c4817d40583ae4720601a0c5c7/href">https://medium.com/media/e348e0c4817d40583ae4720601a0c5c7/href</a></iframe><h4>Train the forecasting model</h4><p>We can infer that this is a typical Time Series Forecast Problem <strong>BUT </strong>it is not. To model the spread(infection) and control(recovered) of infectious diseases, a mathematical model such as SIR (Susceptible-Infected- Recovered) Model. This section of the article is the playground of Data Scientists, you can come up with the models for this data.</p><blockquote>To know more about SIR Model and its implementation, refer: <a href="https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model">https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model</a></blockquote><p>Write the forecast data to a local file called covid_pred.txt</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c328f7369212e4c5ae0bc47d6c7d2d34/href">https://medium.com/media/c328f7369212e4c5ae0bc47d6c7d2d34/href</a></iframe><h4>Upload the forecast data to Azure Storage</h4><p>The forecast data is available in covid_pred.txt must be uploaded to Azure Storage as a blob. This blob can we be accessed by Anonymous request to use the forecast data. The following steps need to be done to create a storage account and upload the blob.</p><ol><li>Go to Azure Portal homepage and click “Storage Account”. Click “Add”. Enter the required details to create an account. Be sure to mention the same Resource Group name.</li><li>We need to create a container to store our file. Click the storage account we created and then click “Containers”.</li><li>Create a new Container named “covidprediction”. Set the access level to “Blob”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*abvWw9tfqA-6SsaHCYeL_g.png" /></figure><p>4. Once the container is created, navigate inside the container. The Container is going to hold the uploaded forecast data as a blob. Click “Upload” and select an empty text file. Give a name for the blob .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*6NQen8qFaBkVTZYLb8932w.png" /></figure><p>5. Click “…” of the created blob and select “Generate SAS Token”. Leave the settings as follows. Copy the Blob URL (you need it later).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*NoDZpra40iYcOfJsBx6P_w.png" /></figure><p>6. Coming back to our pipelinescript.ipynb. As our last step of our Python script file prediction.py is to upload the content of covid_pred.txt to the blob we had just created using SAS token. Complete the run of the experiment by run.complete()</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48409f703370f68516c13e80753a1d0a/href">https://medium.com/media/48409f703370f68516c13e80753a1d0a/href</a></iframe><h3>Step 5 Creating and scheduling the Pipeline</h3><p>A <a href="https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.pipeline%28class%29?view=azure-ml-py">Pipeline</a> object contains an ordered sequence of one or more <a href="https://docs.microsoft.com/en-us/python/api/azureml-pipeline-core/azureml.pipeline.core.builder.pipelinestep?view=azure-ml-py">PipelineStep</a> objects. The pipeline is going to execute the script prediction.py</p><p>Allocate the compute cluster for the pipeline to be executed. You can use the same compute for this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51008c68147194f86fcacb2f4cf08a14/href">https://medium.com/media/51008c68147194f86fcacb2f4cf08a14/href</a></iframe><p>Create a Conda Environment for the pipeline by including the necessary libraries for execution. Name the environment, say “covid_env”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7960421870e8195b4f5d0984cd7ba12f/href">https://medium.com/media/7960421870e8195b4f5d0984cd7ba12f/href</a></iframe><p>Now we need to define the pipeline Object which consists of the Pipeline step which is going to execute prediction.py on compute cluster.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/920fc124218518da278ae2062489a049/href">https://medium.com/media/920fc124218518da278ae2062489a049/href</a></iframe><p>Now the pipeline is ready and we need to execute the pipeline and publish it as “covid-pipeline”.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b3bd61dcf4b28904f0e468fe906bb7c/href">https://medium.com/media/7b3bd61dcf4b28904f0e468fe906bb7c/href</a></iframe><p>We can schedule the pipeline to be run at the time specified by us. For our problem statement, the SIR model will predict the new forecast for next 7 days every day. So the pipeline needs to be scheduled to run once a day using the pipeline id generated in above code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8767dc23eccecd1aead3b66da742353c/href">https://medium.com/media/8767dc23eccecd1aead3b66da742353c/href</a></iframe><h3>Step 6: RUN IT ALLLLLLLLLL!</h3><p>Now execute all the cells in pipelinescript.ipynb. You can view the execution details in the output cell. Once the execution is over, we can notice two results</p><ol><li>Blob file contains the forecast data</li><li>The Pipeline is scheduled to be run every day.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*VjwuGOk7WUQPbiSa1OPKYQ.png" /></figure><p>The blob forecast data may vary according to your model.</p><h3>Step 7: Access forecast data</h3><p>Now we need to make the blob to be accessible by applications. This can be done by an HTTP request. To make sure the data access safe, we need to modify CORS policy such that our application can access the blob.</p><p>Go to Storage Account in your Azure Portal → Click the account → Under Settings click CORS → Update the URL and necessary information as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*MHWclA7KADQt02N0KtEEDA.png" /></figure><p>As my website wants to access the blob, I had allowed the ‘GET’ method.</p><p>The blob now can be accessed with the SAS Blob URL we had generated in Step 4.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/092a133f46e0fbb4184f049782327165/href">https://medium.com/media/092a133f46e0fbb4184f049782327165/href</a></iframe><h3>Step 8: Visualization of Output</h3><p>The plot of trends of daily confirmed cases + forecast and Daily recovered + forecast can be seen in the below two graphs hosted in the website</p><p><a href="https://newcovid.herokuapp.com/">COVID-19 World and India Live Tracker &amp; Forecast</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3gERBNl-9Vava9pZvvUJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxb0LPfPUrjkX6bphsy-bA.png" /></figure><p>Voila! Congratulations on creating an <strong>end to end ML model for COVID-19 forecast system using Azure ML</strong>. If you loved the article/tutorial, give claps, share to other devs as well.</p><p>Feel free to reach out to me regarding queries, suggestions, critics, appreciation, feedback through Email: vivekraja98@gmail.com, LinkedIn.</p><h3>References/ Resources:</h3><ul><li><a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019">https://www.who.int/emergencies/diseases/novel-coronavirus-2019</a></li><li><a href="https://docs.microsoft.com/en-us/learn/paths/build-ai-solutions-with-azure-ml-service/">https://docs.microsoft.com/en-us/learn/paths/build-ai-solutions-with-azure-ml-service/</a></li><li><a href="https://azure.microsoft.com/free">https://azure.microsoft.com/free</a></li><li><a href="https://ml.azure.com/">https://ml.azure.com/</a></li><li><a href="https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology">https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology</a></li><li><a href="https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model">https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model</a></li><li>h<a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview">ttps://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview</a></li><li><a href="https://docs.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services">https://docs.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services</a></li><li><a href="https://www.highcharts.com/">https://www.highcharts.com/</a></li><li><a href="https://www.djangoproject.com/">https://www.djangoproject.com/</a></li><li>Tons of Stackoverflow queries</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16da338864b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning for Beginners]]></title>
            <link>https://vivekraja98.medium.com/machine-learning-for-beginners-187178d1326d?source=rss-ace75bb733bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/187178d1326d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[google-cloud]]></category>
            <dc:creator><![CDATA[Vivek Raja]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 16:25:00 GMT</pubDate>
            <atom:updated>2019-09-23T16:25:00.117Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a common article topic in every ML blog but I am sure that this article will very much different from others as I tried to breakdown the topics in very simple words based on how I understood the topics.</p><blockquote><strong>Disclaimer:</strong> I might have gone wrong in a few places, please feel free to correct me. (This is how the learning process works!)</blockquote><h3><strong>About Google Cloud Tech Series:</strong></h3><p>I, the chairperson of <strong>Google Students Club</strong> started the Google Cloud Tech Series in my college club as an initiative to help students get familiar with the concepts of Google Cloud, Machine Learning and Artificial Intelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*bB3YQlzM_mnlxPHY60sMjQ.png" /></figure><p><strong>Motivation:</strong></p><p>I have been participating in over 60+ hackathons and won many International and National Level Hackathons, programming competitions. Recently, I attended Google Cloud Onboard 2019 and was inspired by the talk given by Ajinkya Kohle. So, I wanted to share my knowledge of Google Cloud and Machine Learning to my fellow students and that is why this Tech series was included in the club’s agenda.</p><p>So let’s get started with the session.</p><p>We have been hearing the buzz word “<strong>Machine Learning</strong>” very often lately. Why is that? Why not before two or three decades back? So machine learning just came up recently?</p><p>No, Machine learning started in the late 1960s. So again back to the same question. Why is there so much hype very recently?</p><p>Thanks to the huge volume of data we are generating nowadays and increased computational power at our disposal.</p><p>Look at this picture below. Can you guess what the element which connects everything is?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*zGKy4J69KCp4RTwtXgj9Bg.png" /></figure><p>Yes, you would have guessed it right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*l7PWHTZ-wdM2t5XBupo0bA.png" /></figure><p>I am sure you would be confusing with the terms “<strong>Artificial Intelligence</strong>” and “<strong>Machine Learning</strong>”. Is it same?</p><p>Machine Learning is a subset of Artificial Intelligence, to be put in simple words.</p><p>This churns out a number of jobs in IT industries focusing on all sectors.</p><p>Data Scientist is termed as <em>“ The Sexiest Job of 21st Century” </em>and there is no doubt in it.</p><p>Not only data scientists, but there are also multiple related jobs such as Data Analysts, Data Engineer, Machine Learning Engineer and so on.</p><p>Below gives a basic expertise and skill one possesses for the job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*gD6xx6tjuFmR4WCvGm-mmQ.png" /></figure><p>To know what is Machine Learning, let’s take a look at what Wiki has to say</p><blockquote>“Machine learning is a field of <a href="https://en.wikipedia.org/wiki/Computer_science">computer science</a> that gives <a href="https://en.wikipedia.org/wiki/Computer_systems">computer systems</a> the ability to “learn” (i.e. progressively improve performance on a specific task)”</blockquote><p>Now, wait a minute! Does Wiki really say we are giving the Computer Systems ability to learn? Yeah right!</p><p>But how can a computer learn when all it knows is 0’s and 1’s?</p><p>With that question pondering our minds, let us make ourselves more clear with the Machine learning by watching some movie clips. Yayy!! But Confusing eh?</p><p>While watching the clips, try to list out technologies/things which are not in existence now. Also, try to figure out something related to Machine Learning or Artificial Intelligence</p><p>So here is the first clip from the movie Big Hero 6.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNOHqxUpXxDQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNOHqxUpXxDQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNOHqxUpXxDQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/66cb3e2fadc7caa7506511f144e389a1/href">https://medium.com/media/66cb3e2fadc7caa7506511f144e389a1/href</a></iframe><p>You can notice Baymax trying to figure out the way to reach the boy. Yeah, that is called “Obstacle Detection”.</p><p>It is trying to understand the boy’s pain from a rating of 1 to 10 and this is called “Sentimental Analysis”</p><p>Baymax is having a conversation and responds to the boy and its called “Natural Language Processing”. It is what you can find in Siri, Google Assistant, Alexa.</p><p>And the next clip is from our favourite movie.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZwOxM0-byvc%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZwOxM0-byvc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZwOxM0-byvc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98afd239399528518e2d77380d6d290a/href">https://medium.com/media/98afd239399528518e2d77380d6d290a/href</a></iframe><p>JARVIS is an intelligent assistant to Iron Man. So we can also observe “Natural Language Processing”.</p><p>It is also capable of identifying things which are called “Object Detection”</p><p>There are a lot more in the clip and let me know in the comment section</p><p>Next clip is from my childhood favourite movie. Mr Incredible</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLZbsB5-bSKo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DLZbsB5-bSKo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLZbsB5-bSKo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b717b6805eb73e47b15039ec1404ed88/href">https://medium.com/media/b717b6805eb73e47b15039ec1404ed88/href</a></iframe><p>As you can notice in the beginning, the blonde lady says,” It’s a learning robot. Every time you spend fighting with the robot increases its chance of winning”.</p><p>With this line, I can give you the informal definition of Machine Learning</p><p>A “something” learns from the data over time.</p><p>That “Something” is what we call a Machine Learning model.</p><p>How is this different from Classical Programming?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*7Sg6XOknDa4U67fAP_X9zg.png" /></figure><p>The classical programming is where the programmer has to construct a logic/algorithm where the input data is processed and output is given</p><p>A machine learning model learns the rules/algorithm by itself by looking at the input, output training examples.</p><p>It formulates the hypothesis at the end of the training.</p><p>So with the hypothesis, the test output is generated form the input</p><p>Let us take a simple example</p><p>Assume that the training pairs given are</p><p>&lt;1,1&gt; , &lt;2,4&gt;, &lt; 3,9&gt;, &lt;4,16&gt;,&lt;5,25&gt;</p><p>The machine learning model tries to generate a hypothesis, say f(x) = 2x , g(x) = x*x , h(x) = x*4</p><p>The best hypothesis among the hypothesis space is g(x) where the training output matches with the target.</p><p>So the g(x) is the hypothesis generated from the model. Let us say, we give an input 10, which gets applied to the hypothesis i.e, g(10) = 10*10 = 100.</p><p>So this is how a machine learning model works.</p><p>There are three different types of learning known as</p><p>1. Supervised Learning</p><p>2. Unsupervised Learning</p><p>3. Reinforcement Learning</p><p><strong>Supervised learning:</strong></p><p>A type of learning where we train the model by giving both inputs as well as the target(output). The above example is supervised learning.</p><p>For instance, in your childhood days, your father or someone would have taught you to ride a bicycle. We learnt it only from teaching someone.</p><p><strong>Unsupervised Learning:</strong></p><p>A type of learning where is no target. The model tries to learn the data by itself without any target label.</p><p>This is similar to the skills we acquire. For example, take swimming, most of us would have got pushed into the pool and we somehow figured to swim to the other end.</p><p><strong>Reinforcement Learning: </strong>A type of learning based on reward and punishment.</p><p>With this, let us see the categories within each type of learning</p><p>We can see many use cases within each category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjOEPfjteDRFHPGsSoTabw.png" /></figure><p>We can come back to data again.</p><p>The data can consist of two types of values</p><p>1.<strong> Discrete Value </strong>— Finite and fixed number of values</p><p>Eg. Gender, Age Group, Presence or Absence, Yes or no etc.</p><p>2. <strong>Continuous Value </strong>— Infinite and continuous values</p><p>Eg. Price, Sales, Age, Height, Weight</p><p>I will break down the process of Data Lifecycle for Machine Learning into simple steps</p><h3><strong>Step 1: Understand the domain</strong></h3><p>This is the most important than any other step in the machine learning process. I have attended over 60+ Hackathons and this is the step which has made me won or at least took me close to victory.</p><p>Understand the domain the problem belongs. The domain knowledge can be acquired from domain experts. Useful knowledge can be applied in our later process for better results.</p><p>Next thing is to go through the data.</p><p>Identify the features, target and the type of problem. Think of the ways you can transform the data such that it is easy to understand.</p><p>Go for visualization of data. It can give you a lot of insights by plotting data in a graph. A little statistics knowledge would be a big boon for you.</p><h3><strong>Step 2: Preprocess the data</strong></h3><p>Why do we need to preprocess the data?</p><p><strong>Data in the real world is dirty</strong></p><p><strong>Incomplete</strong>: lacking attribute values, lacking certain attributes of interest, or containing only aggregate data<br> e.g., occupation=“ ”</p><p><strong>Noisy:</strong> containing errors or outliers<br>e.g., Salary=“-10”</p><p><strong>Inconsistent:</strong> containing discrepancies in codes or names<br>e.g., Age=“42” Birthday=“03/07/1997”<br>e.g., Was rating “1,2,3”, now rating “A, B, C”<br>e.g., the discrepancy between duplicate records</p><p><strong>Intentional </strong>(e.g., <em>disguised missing</em> data)<br>Jan. 1 as everyone’s birthday?</p><p>Only if the quality of the data is good, the results we acquire from our model will also be good.</p><p>So the quality measures of data are as follows</p><p>· Accuracy: correct or wrong, accurate or not</p><p>· Completeness: not recorded, unavailable, …</p><p>· Consistency: some modified but some not, dangling, …</p><p>· Timeliness: timely update?</p><p>· Believability: how trustable the data are correct?</p><p>· Interpretability: how easily the data can be understood?</p><p>· Accessibility</p><p>The major steps in data preprocessing are</p><p><strong>Data cleaning<br></strong>Fill in missing values, smooth noisy data, identify or remove outliers, and resolve inconsistencies</p><p><strong>Data integration<br></strong>Integration of multiple databases, data cubes, or files</p><p><strong>Data reduction</strong></p><ul><li>Dimensionality reduction</li><li>Numerosity reduction</li><li>Data compression</li></ul><p><strong>Data transformation and data discretization</strong></p><ul><li>Normalization</li><li>Concept hierarchy generation</li></ul><h3><strong>Step 3: Learning Model</strong></h3><p>With the preprocessed data, we split it into train-test set and train the suitable machine learning with train dataset</p><h3><strong>Step 4: Interpreting Model</strong></h3><p>We evaluate how well the model performs with test data by calculating the metrics. We try hyper-parameter tuning( change the parameters of the model) or different models to see if we can improve the accuracy.</p><h3><strong>Step5: Consolidating and deploying the model</strong></h3><p>When the model is finalized, we integrate with our use case/project.</p><p>If you have reached this far, I am sure you would have liked the article and understood the basics of Machine Learning by demystifying some myths.</p><p>I will write a follow-up article about the hands-on session of ML. Stay tuned.</p><p>Peace.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=187178d1326d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>