<?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 Shravan C on Medium]]></title>
        <description><![CDATA[Stories by Shravan C on Medium]]></description>
        <link>https://medium.com/@shravan-c?source=rss-fa76ab4a20c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*w3BeWc6hh0bpY1qDdV1WXw.jpeg</url>
            <title>Stories by Shravan C on Medium</title>
            <link>https://medium.com/@shravan-c?source=rss-fa76ab4a20c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:00:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shravan-c/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[Masters Program at University of Limerick]]></title>
            <link>https://shravan-c.medium.com/masters-program-at-university-of-limerick-b53e363772cc?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b53e363772cc</guid>
            <category><![CDATA[friends]]></category>
            <category><![CDATA[ireland]]></category>
            <category><![CDATA[international-education]]></category>
            <category><![CDATA[masters-degree]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Sat, 28 Nov 2020 13:59:18 GMT</pubDate>
            <atom:updated>2020-12-04T15:16:01.808Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*_RUPgZ7Qyv7nz-9GBtPC7Q.png" /></figure><p>Here is a personal story or call it documentation of my experience in Limerick, pursuing my masters. I would like to narrate it in a very pleasant way, covering before coming, while pursuing, and after completing the masters.</p><p><strong>Before Reaching Ireland:</strong></p><p>I was having a very good time in India while working, made a lot of friends. The office is where I enjoyed most, not to mention it I guess backed by my parents. My last day at the office was on August 15th at Infrrd Pvt. Ltd. Here is a throwback pic of that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6xI09EpTM96GtDGNkP71Q.jpeg" /><figcaption>From left: Myself, Ayush, Vinay, Gautam, Avismara, Avinandan, Shwetha, Piyush, Supriyo and Mahu</figcaption></figure><p>It was very fun and the environment was very friendly. I missed out on the opportunity of taking a good pic with all my previous company friends, but I would like to remember them too with my favorite pic so far of ours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AOODlz4gYhxLOZOUrmUlYw.jpeg" /><figcaption>From left: Avinash, Somappa, Myself, Amruta, Sharada, Bharath, and Vivek</figcaption></figure><p>And not to forget, here comes my engineering friends at a send-off party:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msuttjUAIIKgNBgQsrgyIg.jpeg" /><figcaption>La Casa, JP Nagar</figcaption></figure><p>There are many memorable moments in India, and most of them would with the above people. The badminton, table tennis, movies, parties, hangouts, etc.</p><p>Saying all this, I will come to the topic of masters, I was always interested in studying new topics. Science always interests me. And had it in my mind to do masters and it was again backed up by brother Pooran. He went before me, completed it, and secured a job. Then I felt now it&#39;s my turn to catch up with him. Then I decided to do research on the university.</p><p>I will try to cut it short and it goes like this. I started going to education fairs and finally decided to go to Ireland, as it was one year program and an English speaking country. I and my father did go through this time of arranging money and stuff smoothly(not completely though 😛), thanks to his energy and patience coming along with me wherever I call him. And finally, the day came for me to leave 💃. And here is a pic to remember took a few days back, before departure date, as the last pic is not a good one to share 😛:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3T2PDvckgaqLhx2qmYtAAQ.jpeg" /><figcaption>And somehow my father smiled for the pic 🙏</figcaption></figure><p><strong>While Pursuing Masters:</strong></p><p>And I reached Ireland, my first international journey. Just to remember my initial days, two people helped me very much. I was new and meeting them made my nerve a little relaxed. And that is Bharath and Sultan. I will be covering them in the pic in the later part.</p><p>So the master&#39;s program finally started 😮, we had three semesters divided into one complete year. Our university had the best/most clubs and societies to join. Also, the sports facility was the best among other universities in Ireland. I did join many of them. The main highlight was badminton, table tennis, Sky diving club, and Scuba diving. I will cut it short by posting a pic of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dsw6ZEOeqTIQQDzBY0T71w.jpeg" /><figcaption>Tandem Jump from 800 feet.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSQ6JLBb_cWbAFkQ-AfRKA.jpeg" /><figcaption>Snorkeling training.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5I-EjNcpIRWZLa4mm_49OA.jpeg" /><figcaption>Badminton with new friends.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVaRn-SB5G7YmADp-KQ3rQ.jpeg" /><figcaption>Runner up at the tournament :)</figcaption></figure><p>The first semester went so fast, it was filled with many things. The first two months went by in excitement and the third month was super hectic. Every alternate day a different subject. I felt really challenged. In both the semester, I did like 3 subjects over 5. Those two would be boring, filled with theory and assignment. I did get to learn new things in terms of master programs. I like programming and I did get a chance to showcase it in multiple group projects. Again, I had got very nice colleagues at the college for group projects.</p><p>Again, made a lot of friends, and it was discussing the courses, assignments, and other stupid stuff. Also in the first semester did celebrate Indian festivals and Irish gathering like Halloween, and why not, here comes the pics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mM7QYNIgePbFqeHU4gV3Cg.jpeg" /><figcaption>Deepavali 2019</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHi68ZrcGemFJv6ldz28Fg.jpeg" /><figcaption>Halloween 2019</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63w-htV-m59cG0QYmQUFBQ.jpeg" /><figcaption>The end of 2019(New years eve at Shannon river)</figcaption></figure><p>And here comes the second semester 😕 and came the Covid-19 chasing it. Covid-19 prevailed, regular routine got derailed and we all got jailed. The first month went as usual and restriction started its turn slowly and all the teaching went online. Introducing a few extra group projects, by changing the regular structure. Slowly everyone started to get locked up in the home.</p><p>I as such did not face any major problem in completing my master&#39;s, from the second sem I had started working on my third sem project. I had got it covered early before it starts. During the second semester, there was a stand-up meeting organized by my supervisor every week, to discuss the progress.</p><p><strong>Projects so far worked are here:</strong></p><p><strong>First Semester’s work:</strong></p><p><a href="https://github.com/shravanc/software_engineering/blob/main/sem_1/software_design/Software%20Design%20Projectv0.1.pdf">Software Design Project</a>→ <a href="https://github.com/shravanc/golang_experiments">Golang</a> →<a href="https://github.com/shravanc/software_engineering/tree/main/sem_1/machine_learning">Machine Learning</a>→<a href="https://github.com/shravanc/software_engineering/blob/main/sem_1/research_and_methods/state%20of%20the%20art%20essay.pdf">State of the Art Essay</a> →<a href="https://github.com/shravanc/software_engineering/blob/main/sem_1/software_paradigms/RNN%20Recurring%20Neural%20Network.pptx">Presentation on RNN</a> →Poster Presentation</p><p><strong>Second Semester’s work:</strong></p><p><a href="https://github.com/shravanc/software_engineering/blob/main/sem_2/software_architecture/ProjectCS5722_Group10.pdf">Software Architecture</a> →<a href="https://github.com/shravanc/data_mining">Data Mining</a> →<a href="https://github.com/shravanc/data_mining/blob/master/Parkinson_Final.ipynb">Data Mining Project</a> →<a href="https://github.com/shravanc/gcp_project">Big Data Project</a> → <a href="https://github.com/shravanc/software_engineering/blob/main/sem_2/software_architecture/CS5722_TermPaper_Group10.pdf">Software Architecture Essay</a></p><p><strong>Final Semester / Thesis work:</strong></p><p><a href="https://github.com/shravanc/software_engineering/blob/main/thesis/Thesis.pdf">Mixed-Language Sentiment Analysis: A Deep Learning Approach</a></p><p>In the meantime, we did celebrate all the birthdays and stuff, gather here and there. Limerick is a small city and if u go out you find someone you know.</p><p>I just want to post one last pic which covers many who are close.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebERJVUs71-xb_OtHMtMFQ.jpeg" /><figcaption>Camp Fire in the Summer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4MPpjUTAyzC84mpf7oEZQ.jpeg" /><figcaption>Possibly more than 20 of them</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2niFl3t1_Y0ki46f9ueqXQ.jpeg" /><figcaption>Other extracurriculars!!!</figcaption></figure><p><strong>After Completion:</strong></p><p>Completed the masters on the 27th of August with all the submissions. While I was doing my thesis, I had gotten into part-time work, in a company called No Place Like(rebranded into Plop in November 2020). Happy to say that it will be full-time from December 7th onwards.</p><p><strong>Today:</strong></p><p>Received Digital Certification of Completion with First Class Honors, today November 27th. Happy to receive it and happy at home.</p><p><strong>EndNote:</strong></p><p>Thanks for all being there and making this memorable one. Looking forward to more to come with all and new people out there :)</p><p>Also have not mentioned my Mom in the above section, maybe because she was there for me and with me all the time. She knows almost everything about me and I will always count on her if I need someone to talk to. Thanks to her for being there for me every time and almost every other skill I possess can be dedicated to her.</p><p>Last pic to express my feeling so far:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*T3o9OkY1Sr06qA7fQPGduA.jpeg" /><figcaption>😛</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b53e363772cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DataPiepeline using Apache Beam and Google Cloud DataFlow as Runner and BigQuery as DataSink]]></title>
            <link>https://medium.com/analytics-vidhya/datapiepeline-using-apache-beam-and-google-cloud-dataflow-as-runner-and-bigquery-as-datasink-a6dcfadc8428?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6dcfadc8428</guid>
            <category><![CDATA[google-cloud-storage]]></category>
            <category><![CDATA[apache-beam]]></category>
            <category><![CDATA[google-bigquery]]></category>
            <category><![CDATA[google-cloud-dataflow]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 17:58:14 GMT</pubDate>
            <atom:updated>2020-11-10T10:37:07.989Z</atom:updated>
            <content:encoded><![CDATA[<h3>DataPipeline using Apache Beam and Google Cloud DataFlow as Runner and BigQuery as DataSink</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*aDqZPVxAhpgtibU014Acbg.png" /><figcaption><a href="https://www.hadoopinrealworld.com/batch-processing-with-google-cloud-dataflow-and-apache-beam/">https://www.hadoopinrealworld.com/batch-processing-with-google-cloud-dataflow-and-apache-beam/</a></figcaption></figure><p>In this article, we will be looking into creating a data pipeline using Google Cloud Platform(GCP) services. I have been learning through Coursera specialization in <a href="https://www.coursera.org/account/accomplishments/specialization/certificate/YM5K5UWD8474">Data Engineering, Big Data, and Machine Learning GCP</a> thought of creating something outside of the course on my own. Luckily I got a nice use case where I was working recently on AWS s3 log analysis. And I have done all this using my free account in the GCP console. Also, there is a walkthrough video added at the end, performing all the actions on GCP!!!</p><p><strong>Use Case Goes like this:</strong></p><p>Download Logs →Upload Logs to Google Storage → Trigger DataFlow</p><p><strong>Responsibility of a DataFlow Job:</strong></p><p>Read Logs Files → Parse Log Files →Write To BigQuery</p><p><strong>For what?</strong></p><p>BigQuery is used to generate reports required from the S3 logs.</p><p>I will provide all the links that I have gone through while creating this pipeline. To understand each concept of this can go through these links: <a href="https://www.youtube.com/watch?v=KalJ0VuEM7s">DataFlow</a>, <a href="https://beam.apache.org/documentation/sdks/python/">Apache Beam Python</a>, and <a href="https://cloud.google.com/bigquery/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=japac-IN-all-en-dr-bkws-all-super-trial-e-dr-1009137&amp;utm_content=text-ad-none-none-DEV_c-CRE_315806004867-ADGP_Hybrid%20%7C%20AW%20SEM%20%7C%20BKWS%20~%20T1%20%7C%20EXA%20%7C%20Big%20Data%20%7C%201%3A1%20%7C%20IN%20%7C%20en%20%7C%20bigquery-KWID_43700028131581118-kwd-297617549231&amp;userloc_1007880-network_g&amp;utm_term=KW_bigquery&amp;ds_rl=1264446&amp;gclid=CjwKCAiA-f78BRBbEiwATKRRBDt_Kkf6JeH1BGG6KW4wSwbJ6inIYEycBQo6XTirx4DdiInlBZ6cABoCngIQAvD_BwE">BigQuery</a>.</p><p><strong>Steps involved in creating a complete Pipeline:</strong></p><ol><li>Create a Google Cloud Storage in the Region which you prefer.</li><li>Create a BigQuery Dataset in the same project</li><li>Create a Service Account and provide owner role</li><li>Create Pipeline using Apache Beam</li><li>Analyze logs using BigQuery and DataStudio</li></ol><p><strong>Google Cloud Storage:</strong></p><p>Create a Bucket in the selected project in any region that is required and keep a note of the region is selected.</p><p><strong>Create a BigQuery Dataset:</strong></p><p>In BigQuery UI create a Dataset under the same project.</p><p><strong>Create a Service Account:</strong></p><p>Create a Service Account to communicate from local machine to GCP service.</p><p><strong>Create Pipeline using Apache Beam:</strong></p><p>This is a little time-consuming in the beginning maybe. Here we need to create a pipeline using ApacheBeam open-source library using either in Java or Python language. Here is my pipeline for the use case described above in Python.</p><pre>obj = AwsLogParser()<br>quotes = ( <br>        p           <br>        | &#39;Read&#39; &gt;&gt; ReadFromText(known_args.input)<br>        | &#39;Parse Log&#39; &gt;&gt; beam.Map(lambda line: obj.parse(line))<br>)</pre><pre>quotes | beam.io.gcp.bigquery.WriteToBigQuery(<br>    obj.table_spec,<br>    obj.schema,<br>    write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND,<br>    create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED<br>)</pre><p>This Pipeline contains three steps, Read each line from the logs and then pass it on to the Parse step. Here in the parse basically parse the s3 log lines and create a dictionary matching the column name of the BigQuery table schema. And in the final step is about populating the parsed data into a BigQuery table. One thing to note here: When we are running any pipeline in a local machine specify all the data as input to be a local path and output path also to be on local. Likewise when running the pipeline using DataFlow runner needs to specify Google Storage files paths. I made the mistake of runner the pipeline on the cloud by specifying the local path for input. The problem here is, the pipeline will execute successfully but the table won&#39;t get created in the BigQuery since there is no data.</p><p><strong>And the command to run above:</strong></p><pre>export GOOGLE_APPLICATION_CREDENTIALS=&quot;/path/to/your/json_file.json&quot;</pre><pre>export PROJECT=your_project_id<br>export BUCKET=your_bucket_id<br>export REGION=your_region</pre><pre>python main.py  \<br> --region $REGION   \<br> --runner DataflowRunner  \<br> --project $PROJECT  \<br> --temp_location gs://$BUCKET/tmp/ \<br> --input gs://$BUCKET/aws_logs/2020*</pre><p>Once this is running we can see the status on the Web UI as well in the GCP. It does take time, need to be a bit patient.</p><p><strong>Analyzing the Logs using BigQuery and DataStudio:</strong></p><p>BigQuery is the Datawarehoue maintained by Google. It provides a simple rich MySql type syntax approach to get the analytics on petabytes of data.</p><p>Here in our case we are parsing the s3 log and storing all the info in the table. Here to keep it simple, we will query only 200 requests and the key to be ending with HTML.</p><pre>SELECT<br>  key,<br>  request_uri,<br>  http_status,<br>  date<br>FROM<br>  `justlikethat-294122.s3_logs.access_report`<br>WHERE<br>  http_status=&#39;200&#39; and ends_with(key, &#39;html&#39;)<br>LIMIT<br>  1000</pre><p>We then will realize the result from the above query with a pie chart using Google DataStudio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*08_IQiuattZY5oJjZNxopA.png" /></figure><p>Likewise, any type of chart can be obtained.</p><p><strong>What Next?</strong></p><p>Once the report is created either using a template provided by Google Datastudio or created on your own, it can easily be integrated into your website by embedding the report to the respective website using iframe. That is not covered here.</p><p><strong>Links:</strong></p><pre><a href="https://medium.com/swlh/apache-beam-google-cloud-dataflow-and-creating-custom-templates-using-python-c666c151b4bc">https://medium.com/swlh/apache-beam-google-cloud-dataflow-and-creating-custom-templates-using-python-c666c151b4bc</a></pre><pre><a href="https://github.com/ankitakundra/GoogleCloudDataflow/blob/master/dataingestion.py">https://github.com/ankitakundra/GoogleCloudDataflow/blob/master/dataingestion.py</a></pre><pre><a href="https://stackoverflow.com/questions/55694541/error-unable-to-parse-file-when-i-run-a-custom-template-on-dataflow">https://stackoverflow.com/questions/55694541/error-unable-to-parse-file-when-i-run-a-custom-template-on-dataflow</a></pre><pre><a href="https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python">https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python</a></pre><pre><a href="https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount.py">https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount.py</a></pre><pre><a href="https://beam.apache.org/documentation/io/built-in/google-bigquery/">https://beam.apache.org/documentation/io/built-in/google-bigquery/</a></pre><p><strong>Walkthrough:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fxpx_MYAH53c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dxpx_MYAH53c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fxpx_MYAH53c%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/3a0dc98f8fdeee6285c90ac5978dd72c/href">https://medium.com/media/3a0dc98f8fdeee6285c90ac5978dd72c/href</a></iframe><p><strong>EndNote:</strong></p><p>It was a good experience doing this complete flow. Felt like I achieved something cool. I do have experience dealing with multiple servers on-premise, but this is a different experience doing it all in the cloud, Code is available <a href="https://github.com/shravanc/apache_beam_learning/blob/main/apache_beam/aws_log_analysis_through_dataflow/main.py">here</a>. This is it!!! Thanks for reading cheers!!! enjoy coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6dcfadc8428" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/datapiepeline-using-apache-beam-and-google-cloud-dataflow-as-runner-and-bigquery-as-datasink-a6dcfadc8428">DataPiepeline using Apache Beam and Google Cloud DataFlow as Runner and BigQuery as DataSink</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File type conversion using Python]]></title>
            <link>https://shravan-c.medium.com/file-type-conversion-using-python-15961ed729c1?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/15961ed729c1</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[glb]]></category>
            <category><![CDATA[glb-to-ibj]]></category>
            <category><![CDATA[file-conversion]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Tue, 27 Oct 2020 00:10:07 GMT</pubDate>
            <atom:updated>2021-03-11T13:17:14.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*StT2zVdjJjAjryyuIZNxQg.jpeg" /><figcaption><a href="https://www.fiverr.com/shubhamthetitan/your-professional-file-conversion-expert">https://www.fiverr.com/shubhamthetitan/your-professional-file-conversion-expert</a></figcaption></figure><p>This is an attempt to make the file conversion from one format to another through the python program. This is done using API from <a href="http://anyconv.com/">Anyconv</a>.</p><p><strong>Code:</strong> <a href="https://github.com/shravanc/file_conversion">GitHub</a></p><p><strong>Motivation:</strong></p><p>Anyconv provides a very simple interface to get the file format conversion from one format to another. But when there are many files to be converted this will start to appear as a big task. And, a person like me who hates to use the mouse cursor will be even more irritated. Sometimes, this helps in creating an easy solution and a little organized as well.</p><p><strong>Steps:</strong></p><p>In order to avoid the time-consuming task of converting more files at a time started to think to automate this step. Then started using browsing dev tools to get the API call that is happening on the website. Figured out there were only three API calls that were happening in this file conversion process.</p><p>The three API calls were Add, Status, and Download.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vitefsIBWKuiqYoxWAZYQA.png" /><figcaption>Copy as CURL</figcaption></figure><pre>curl &#39;<a href="https://anyconv.com/api/action/add/633a03ba68f2e7836ad89c6465bc5050/&#39;">https://anyconv.com/api/action/add/633a03ba68f2e7836ad89c6465bc5050/&#39;</a> \<br>  -H &#39;authority: anyconv.com&#39; \<br>  -H &#39;pragma: no-cache&#39; \<br>  -H &#39;cache-control: no-cache&#39; \<br>  -H &#39;access-control-allow-origin: *&#39; \<br>  -H &#39;accept: application/json, text/plain, */*&#39; \<br>  -H &#39;x-xsrf-token: eyJpdiI6Ims2XC9PdkpoQWlOQk1ubmZkZjJPS0pnPT0iLCJ2YWx1ZSI6IjF3SlpEN3hSQ0ZNajdmS1E3Z2xtbnVcL3grMEFIVTJ6QXQ4VDQrQStqdUVMc3ZsdkZcL0xiUlFMaU1VeWgxMVZtdCIsIm1hYyI6IjM2NWFiNTBmZjI0YTI3NGQ1MGUxZjhjMDkyMDgzYWUwZjAwMTQwYmNjMGQ4YmI2OGVkMjRjMWMxNjg2ZDVlMzIifQ==&#39; \<br>  -H &#39;sec-ch-ua-mobile: ?0&#39; \<br>  -H &#39;content-type: multipart/form-data; boundary=----WebKitFormBoundaryhyR3DScWubwxxoId&#39; \<br>  -H &#39;user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36&#39; \<br>  -H &#39;sec-ch-ua: &quot;Chromium&quot;;v=&quot;86&quot;, &quot;\&quot;Not\\A;Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;86&quot;&#39; \<br>  -H &#39;origin: <a href="https://anyconv.com&/#39;">https://anyconv.com&#39;</a> \<br>  -H &#39;sec-fetch-site: same-origin&#39; \<br>  -H &#39;sec-fetch-mode: cors&#39; \<br>  -H &#39;sec-fetch-dest: empty&#39; \<br>  -H &#39;referer: <a href="https://anyconv.com/glb-to-obj-converter/&#39;">https://anyconv.com/glb-to-obj-converter/&#39;</a> \<br>  -H &#39;accept-language: en-US,en;q=0.9&#39; \<br>  -H &#39;cookie: _ga=GA1.2.1234396918.1602581718; _ym_uid=1596117912523737438; _ym_d=1602581723; _gid=GA1.2.165874002.1603748699; _ym_isad=1; _ym_wasSynced=%7B%22time%22%3A1603748704028%2C%22params%22%3A%7B%22eu%22%3A1%7D%2C%22bkParams%22%3A%7B%7D%7D; _ym_hostIndex=0-1%2C1-0; XSRF-TOKEN=eyJpdiI6Ims2XC9PdkpoQWlOQk1ubmZkZjJPS0pnPT0iLCJ2YWx1ZSI6IjF3SlpEN3hSQ0ZNajdmS1E3Z2xtbnVcL3grMEFIVTJ6QXQ4VDQrQStqdUVMc3ZsdkZcL0xiUlFMaU1VeWgxMVZtdCIsIm1hYyI6IjM2NWFiNTBmZjI0YTI3NGQ1MGUxZjhjMDkyMDgzYWUwZjAwMTQwYmNjMGQ4YmI2OGVkMjRjMWMxNjg2ZDVlMzIifQ%3D%3D; anyconvsession=eyJpdiI6Ink4T1hKOHo5amxUajFBdXB4ZTdYdlE9PSIsInZhbHVlIjoiVlg2K1QzdFk3N2JKNGk3cmxSbmtWZ3pvNzErY1ZjczJvZHdOTWhJK1hWVEFJSzdcL3pmNDFoYW1KYnplN1ZhOXoiLCJtYWMiOiIwN2M5MTkxNDNkMGQyZjAwM2JjNTBjNTNjOGYxMDRjNWFlZDY0ZmQ1NGQ2Yzg4NjEyOTBkOWM2Mjk0ZjI1NTU2In0%3D; _gat_UA-135212576-1=1; _ym_visorc_53329336=w&#39; \<br>  --data-binary $&#39;------WebKitFormBoundaryhyR3DScWubwxxoId\r\nContent-Disposition: form-data; name=&quot;file&quot;; filename=&quot;test.glb&quot;\r\nContent-Type: application/octet-stream\r\n\r\n\r\n------WebKitFormBoundaryhyR3DScWubwxxoId\r\nContent-Disposition: form-data; name=&quot;to&quot;\r\n\r\nobj\r\n------WebKitFormBoundaryhyR3DScWubwxxoId--\r\n&#39; \<br>  --compressed</pre><p>This is the CURL API call when copied from the browser the way showed in the above image.</p><p>Repeated the same process and copied all the three APIs and then figured out only a few headers were that were actually needed. Minimum headers that is required is as below:</p><pre>curl &#39;<a href="https://anyconv.com/api/action/add/1963a3833306d22646ae43bbe5ff8144/&#39;">https://anyconv.com/api/action/add/1963a3833306d22646ae43bbe5ff8144/&#39;</a> \<br>  -H &#39;access-control-allow-origin: *&#39; \<br>  -H &#39;accept: application/json, text/plain, */*&#39; \<br>  -H &#39;content-type: multipart/form-data; boundary=----WebKitFormBoundarymrHPh4BIPwSilBKz&#39; \<br>  -H &#39;cookie: _ga=GA1.2.1234396918.1602581718; _ym_uid=1596117912523737438; _ym_d=1602581723; XSRF-TOKEN=eyJpdiI6IlNxbDdXXC9BalhFVjdvYWNFQjZnZld3PT0iLCJ2YWx1ZSI6ImdyZkpPOXd6U0s0ZExmN09aWFFUNit4c1lhNmp3QndsYzNJRkNoaWZxeXpMM3h5b0hXZXJnRnhtT2VkdE9neTAiLCJtYWMiOiI5ZTM1ZGUwMzAyNzMzMDNiYjNhMDkxMjVmMWNjNjMxMmJhOTEyZjVlMzg4MDFmMDRlY2E4NmFhNGU4N2Q1N2I5In0%3D; _gid=GA1.2.252471988.1603569339; _ym_wasSynced=%7B%22time%22%3A1603569345626%2C%22params%22%3A%7B%22eu%22%3A1%7D%2C%22bkParams%22%3A%7B%7D%7D; _ym_isad=1; _ym_visorc_53329336=w; anyconvsession=eyJpdiI6IkhzTkt6U0RkVkZxV2FIM08wODhLakE9PSIsInZhbHVlIjoiOCtWMjlNUjhFM0V0MmJPZW5EckM2bkJvdEE2Z3I4dlwvOWhUQTB3M3RyTFNhcURvY1wvSmpOaXNHSmlPMkxJcnZvIiwibWFjIjoiNWE2NTEzNTY1MTNlMTJkZWVjZGYyODE3YjRhNTU0MmRiODYyNzIxZDYzMGQxNTk5ZTc3MjZmYzA3MDhhNTJhNyJ9&#39; \<br>  --data-binary $&#39;------WebKitFormBoundarymrHPh4BIPwSilBKz\r\nContent-Disposition: form-data; name=&quot;file&quot;; filename=&quot;<a href="http://twitter.com/Vine">@Vine</a>.obj&quot;\r\nContent-Type: application/x-tgif\r\n\r\n\r\n------WebKitFormBoundarymrHPh4BIPwSilBKz\r\nContent-Disposition: form-data; name=&quot;to&quot;\r\n\r\ndae\r\n------WebKitFormBoundarymrHPh4BIPwSilBKz--\r\n&#39; \<br>  --compressed</pre><p>I tried to remove the cookie and run the API, it was getting successful, but was failing when I tried to download the converted file. API requires a cookie to be sent along if not it will return fail in the status API call.</p><p><strong>Conclusion:</strong></p><p>From this, I was able to get the work done in less than 30 mins which would have taken 2 days to patiently convert something close to 150 files. Thanks for reading cheers!!! Enjoy coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15961ed729c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Covid-19 Kannad Language Sentiment Analysis Dataset]]></title>
            <link>https://shravan-c.medium.com/covid-19-kannad-language-sentiment-analysis-dataset-a2fc7b107287?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2fc7b107287</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[kannada-dataset]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[dataset]]></category>
            <category><![CDATA[kaggle-kannada-dataset]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Tue, 08 Sep 2020 12:57:59 GMT</pubDate>
            <atom:updated>2020-09-08T13:03:42.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*pCaYpQRvo0txYzzSikVEoA.jpeg" /><figcaption><a href="https://www.news-medical.net/health/The-Surge-of-Sensationalist-COVID-19-AI-Research.aspx">https://www.news-medical.net/health/The-Surge-of-Sensationalist-COVID-19-AI-Research.aspx</a></figcaption></figure><p>At this time of writing this article, I had completed my Masters in Software Engineering a week ago. In my final sem thesis project, I had done the sentiment analysis for Kannada Language using Multi-Lingual BERT.</p><p>TL;DR: <a href="https://www.kaggle.com/shravanc/kannada-covid19-sentiment-analysis-dataset">Translated Dataset</a> and <a href="http://info.aylien.com/coronavirus-dataset?utm_campaign=Coronavirus%20Dataset%20Requests&amp;utm_source=Blog%20post&amp;utm_medium=Dataset%20blog">Source Data.</a></p><p>After spending a lot of time browsing for any Kannada Dataset for Sentiment Analysis, I was not able to find much of the dataset. And finally, I found Dataset related to Covid-19. This dataset has a huge collection that is labeled. Then after downloading I tried to translate it to the Kannada language. First I tried to create my own machine translation model to do the translation. Ended up writing this article <a href="https://medium.com/@shravan007.c/neural-machine-translation-with-attention-and-tensorflow-2-0-6c6d16c829f4">Neural Machine Translation</a>. Since the dataset to train the translation model is very less, I ruled out this method. Then tried to check the cost of Google Translation API. It is a very expensive solution to do, so ruled out this as well. Then tried to find a freely available Python library like <a href="https://pypi.org/project/nltk/">NLTK</a>, but there was no Kannada support yet in this library. Finally, I found another python library that uses <a href="https://pypi.org/project/textblob/0.9.0/#features">Google Translation API</a> internally. <a href="https://pypi.org/project/textblob/0.9.0/">TextBlob</a> is the Python library that I settled down to use for the translation.</p><p>There is a limitation for using the TextBlob translation service because it is using Google Translation, it is limited to use only for 400 times a day. But the dataset that I had found to translate had like 5 Lakhs of news articles. Again I was let down by this.</p><p><strong>Google Colab to the Rescue</strong></p><p>With this limitation, the first thing that came in mind is to run the translation using Google Colab with multiple sessions. Though the limitation of 400 applies to Google Colab as well with multiple sessions opened, I was able to translate like 15 thousand articles a day. I continued this till I get like close to 70 thousand of articles. Google Colab to create this can be found <a href="https://github.com/shravanc/datasets/blob/master/covid_eng_to_kan.ipynb">here</a>.</p><p>The code to do the extraction can be found <a href="https://github.com/shravanc/msc_project/blob/master/sentiment_analysis/bert/data_extraction/main.py">here</a>. I have also created the same problem that I tried to solve in my thesis in the <a href="https://www.kaggle.com/shravanc/kannada-covid19-sentiment-analysis-dataset/tasks">Kaggle</a>, in case if interested. Quickstart for the Kaggle task can be found <a href="https://www.youtube.com/watch?v=gE-95nFF4Cc">here</a>. Thanks for reading!!! Enjoy Coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2fc7b107287" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build and Deploy Tensorflow Model and its integration with a Flask application from scratch]]></title>
            <link>https://shravan-c.medium.com/build-and-deploy-tensorflow-model-and-its-integration-with-a-flask-application-from-scratch-6b910a054e34?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b910a054e34</guid>
            <category><![CDATA[early-stopping]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow-serving]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Mon, 06 Jul 2020 22:20:17 GMT</pubDate>
            <atom:updated>2020-07-06T22:20:17.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*lRpDA7NB_UiEB_ou7tbg0w.png" /><figcaption><a href="https://stackoverflow.com/questions/54224934/sagemaker-tensorflow-serving-stack-comparisons">https://stackoverflow.com/questions/54224934/sagemaker-tensorflow-serving-stack-comparisons</a></figcaption></figure><p>In this article, we will cover what needs to be done to deploy the TensorFlow model with the TensorFlow model server and related commands. I have extended one of my previous <a href="https://www.youtube.com/watch?v=e2z5ZUgIH1k">projects</a> with new topics covering early stopping and model evaluation techniques. Also, will be building a flask application with a form in it, to provide new data to make a prediction.</p><p><strong>Points that are covered:</strong></p><ul><li>Build regression model</li><li>Train model with Early Stopping callback</li><li>Evaluate model with the test dataset</li><li>Save model</li><li>Save the stats of the dataset for normalization</li><li>Build a Flask application from scratch</li><li>Start TensorFlow production-ready server to serve model prediction</li><li>Make prediction from a flask</li></ul><p><strong>Complete video for the above step is as below:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMK_yw9qJUVQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMK_yw9qJUVQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMK_yw9qJUVQ%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/723c09305c9b8f8ed800fea444169b09/href">https://medium.com/media/723c09305c9b8f8ed800fea444169b09/href</a></iframe><p><strong>Useful commands are as below:</strong></p><p>Deploying TensorFlow model:</p><pre><strong># Saving tensorflow model</strong></pre><pre>save_path = &#39;/tmp/regression_model/1&#39;<br>tf.keras.models.save_model(model, save_path)</pre><pre><br><strong># model_name: Any name for the your model<br># model_base_path: location of the saved model</strong></pre><pre>tensorflow_model_server \<br> --rest_api_port=&quot;8501&quot; \<br> --model_name=&quot;regression_model&quot; \<br> --model_base_path=&quot;/tmp/regression_model/&quot;</pre><pre><strong>API request to TensorFlow model server:</strong></pre><pre>curl -X POST <a href="http://localhost:8501/v1/models/regression_model:predict">http://localhost:8501/v1/models/regression_model:predict</a> -d &#39;{&quot;instances&quot;: [ [ 0.3, -1.4, 0.8, -0.1, -0.9, -0.3 ] ] }&#39;</pre><p>Github link for the project is <a href="https://github.com/shravanc/youtube_tutorials/tree/master/deployment">here</a>. Video is pretty lengthy but it is done everything from scratch to understand integration better. Hope it is useful. Enjoy coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b910a054e34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Useful VIM shortcuts]]></title>
            <link>https://shravan-c.medium.com/useful-vim-shortcuts-a93a168531fb?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a93a168531fb</guid>
            <category><![CDATA[basic-vim-commands]]></category>
            <category><![CDATA[vim-editor]]></category>
            <category><![CDATA[vim-commands]]></category>
            <category><![CDATA[vi]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Sun, 05 Jul 2020 15:42:48 GMT</pubDate>
            <atom:updated>2020-07-06T12:11:20.775Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*44Q9SXylX4KgrUT9zEGv4g.png" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Vimlogo.svg">https://commons.wikimedia.org/wiki/File:Vimlogo.svg</a></figcaption></figure><p>A short introduction, vim is an improved version of VI editor. I was introduced to it in one of the institute who taught me the C programming language. I am glad to be introduced to it. I love programming in VIM editor. I have gotten used to it so much that I can&#39;t get out of it. Recently I started using Pycharm though, still experimenting with it, but I love VIM.</p><h3>Here are a few useful shortcuts for vim:</h3><p>Commands are highlighted to avoid confusion. Please do mention in the comments the one you like the most.</p><p><strong>Cursor Navigation:</strong></p><p><strong>L</strong> = move the cursor to the bottom of the screen<br><strong>M</strong> = move the cursor to the middle of the screen<br><strong>H</strong> = move the cursor to the top of the screen</p><p><strong>G</strong> = move the cursor to the bottom of the file<br><strong>g + g</strong> = move the cursor to the top of the file</p><p><strong>z + z</strong> = move the cursor to the center of the screen<br><strong>z + t</strong> = move the cursor to the top of the screen</p><p><strong>Use case:</strong><br>1. go the bottom of the screen and then bring the cursor to the centre:<br>(shift + l) → (z + z)</p><p><strong>Linewise Navigation:</strong></p><p><strong>0</strong> = start of the line<br><strong>^</strong> = start of the first charecter<br><strong>$</strong> = end of the line</p><p><strong>Deleting:</strong></p><p><strong>d + a + w</strong> = delete a word<br><strong>d + a + “</strong> = delete all the content inside “ along with “. Ex: var + “something” — &gt; var +<br><strong>d + i + “ </strong>= delete just the content inside “. Ex: var + “something” — &gt; var + “”</p><p><strong>d + t + “</strong> = delete all the charecter till the next “. Ex: var + “something” — &gt; “something”<br><strong>d + f + “</strong> = delete all the charecter along with “. Ex: var + “something” — &gt; something”.</p><p>Hope this helps, will update the list as and when I come up with new shortcuts. A reference for the same can be found in this <a href="https://www.youtube.com/watch?v=Qem8cpbJeYc&amp;list=LLH9wBYoxgafJ7MoJxfZ2mUA&amp;index=33&amp;t=0s">link</a> and <a href="https://danielmiessler.com/study/vim/">another</a>. Enjoy coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a93a168531fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Linear Regression using Tensorflow]]></title>
            <link>https://shravan-c.medium.com/simple-linear-regression-using-tensorflow-97f60785ca47?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/97f60785ca47</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[tensorflow-example]]></category>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[step-by-step-guide]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 00:49:24 GMT</pubDate>
            <atom:updated>2020-06-05T00:49:24.963Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*2BeqIQxa-eFJ6q1wuSAuKw.jpeg" /><figcaption>Yes simple as this!</figcaption></figure><p>In this article would like to cover, how to solve a linear regression problem using Tensorflow framework. In this, I will not be covering too many details on the EDA process. This is a very simple dataset and this just to show how simple it is to solve using TensorFlow. For the first time, I have created a video tutorial as well on Youtube, will be mentioning the link for the same.</p><p>The dataset that I have used can be found on <a href="https://www.kaggle.com/mohansacharya/graduate-admissions">Kaggle</a> or in my <a href="https://github.com/shravanc/datasets/blob/master/graduate_admission.csv">Github repo</a> if you don&#39;t want to download and use it directly from the Github link. This dataset is about predicting the chance for a student to get admission to a particular university. The target column in this is “admit”. More details can be found in the Kaggle.</p><p>Will be solving it with the deep neural network. Steps involved are as below:</p><ul><li>Load Data</li><li>Prepare training and validation dataset(tf.data.Dataset)</li><li>Build Model</li><li>Validate and Plot the Training and Validation Curve</li></ul><p>Video tutorial for the same can be found below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fe2z5ZUgIH1k%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3De2z5ZUgIH1k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fe2z5ZUgIH1k%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/8de482a5f7e8305d0c4a7208da85d83a/href">https://medium.com/media/8de482a5f7e8305d0c4a7208da85d83a/href</a></iframe><p><strong>Load in the Data and Preparing it out to Train and Valid Set</strong></p><p>There not many things that can be found on part of EDA here, as the dataset is very simple with no missing values. I could have added the graphs and fancy correlation plots just for the sake of EDA, but I felt since there not dealing with it to another data imputation or dealing with the outliers. I have kept it simple. I have done a little detail about the EDA in one of the <a href="https://medium.com/@shravan007.c/eda-data-imputation-be3171846546">articles</a>.</p><p>Here we are dividing the dataset into 85% train data and 15% valid data using the pandas&#39; sample method. And then I chose to keep research column as categorical just being more defensive to avoid bias. And then scaling the data using mean and std. One of the reasons I chose to use mean and standard deviation is that it can be stored, and when the model is deployed and for each request values can be scaled done with the values that were seen during training. An alternate way is to store the scaler methods available from sklearn, the same can be found <a href="https://machinelearningmastery.com/how-to-save-and-load-models-and-data-preparation-in-scikit-learn-for-later-use/">here</a>. I am going with mean and standard deviation in this to keep it simple.</p><p>And the data from the DataFrame is then converted to tf.data.Dataset object using prepare_dataset function. In this, we are converting first to tf.data using from_tensor_sclices method, where we passing both x and y as a tuple (x, y). Then we shuffle it again make it independent of the sequence the data is prepared. Further, it is batched to the batch size, this says in each epoch all the dataset will be trained one batch after each other. This adds a regularisation effect to the neural network which is good. And the prefetch is performed on it. This will make sure the processors will not wait for the next batch to appear because the next data is already prefetched and available for training. With this data, preparation is done.</p><p><strong>Building Model and Plotting the curves</strong></p><p>This three-layered network is built. Not that deep but since the dataset is small this would be enough. Compiling it with “mse” loss function and SGD optimizer function. It is then trained with the train_dataset and valid_dataset. Since we have created the dataset using from_tensor_slices by passing in both x and y values to it, we don&#39;t have to specify x and y in fit function. Tensorflow will understand the dataset has both the values in it. The same applies to the validation dataset. From the training metrics, we can see that values have dropped saying the model is improving with each epoch.</p><p>Further to validate our understanding it is recommended to plot the training and validation mae and loss. It can be found below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gokIwqJfM8pInrtrqjf0w.png" /><figcaption>Training and Validation MAE</figcaption></figure><p>From the plot, it is evident both training and validation curve has curved down showing a very good sign that the model is learning over each epoch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*68G2kYFhbXY7Ah1fCljqqg.png" /><figcaption>Training and Validation Loss</figcaption></figure><p>Same goes with the loss curve, Loss has decreased over epochs.</p><p><strong>Prediction</strong>:</p><p>In the beginning, we have stored the first row for testing the prediction and the model has performed very well predicting very close to the expected.</p><p>Please do with the video, also the code is available <a href="https://github.com/shravanc/youtube_tutorials/tree/master/linear_regression">here</a>. Feedback for the video and the article would be of great help. I will do more such work whenever I have time. Thanks for reading and supporting. Enjoy Coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97f60785ca47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker for exiting Rails app with Postgresql]]></title>
            <link>https://shravan-c.medium.com/docker-for-exiting-rails-app-with-postgresql-59eaa79ec7ac?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/59eaa79ec7ac</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Fri, 24 Apr 2020 14:35:43 GMT</pubDate>
            <atom:updated>2020-04-24T15:22:46.315Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker for existing Rails app with Postgresql</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bOrphmm1BtsoUc9rND7lmw.png" /><figcaption>Source: <a href="https://www.docker.com/resources/what-container">https://www.docker.com/resources/what-container</a></figcaption></figure><p>At the beginning of my career, I used to install any software or programming languages directly into my system. I was happy with that at that time. So was executing any ruby program with ruby filename.rb. Whereas Ruby has rvm to manage different versions of a ruby in your system, but I was not a fan of that and used only one version of ruby because I didn’t get any use case for that. Later I went on doing the same with the python programming language. But later I came across the use case where I needed a different version of libraries for different programs(It was for TensorFlow 1.14 and 2.1).</p><p>Then I introduced myself with <a href="https://pypi.org/project/virtualenv/">virtualenv</a> library which will help us keep different versions of python and its library and whenever we need any particular version just activate it and start using it. I felt very happy with this and gave me a very broad mind like I can screw up anything I want in that virtualenv and still have your system python version fine shine. And now, learned docker, which is one level above this virtualenv. This is another awesome thing, and this literally allows you to create a new OS in your existing OS and run everything in that space. Everything you want for the application will be installed, and the app will be up and running. This will kind of helps me share the application I develop to anyone I want and be carefree of installation procedure(Just share the command to bring up the system and then enjoy the application). It’s that simple with the docker. Further details on <a href="https://www.docker.com/resources/what-container">docker</a>.</p><p>In this article as the title says, we will be going to create a docker file and see how we can get it up and running.</p><h3>Docker installation:</h3><p>Installing docker to ubuntu 18.04 can be found in this <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04">article</a>. I used the below command to get it up and running:</p><pre>sudo apt update<br>sudo apt install apt-transport-https ca-certificates curl software-properties-common<br>curl -fsSL <a href="https://download.docker.com/linux/ubuntu/gpg">https://download.docker.com/linux/ubuntu/gpg</a> | sudo apt-key add -<br>sudo add-apt-repository &quot;deb [arch=amd64] <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> bionic stable&quot;</pre><pre>sudo apt update<br>apt-cache policy docker-ce<br>sudo apt install docker-ce<br>sudo systemctl status docker</pre><p>The docker version that I have is 19.03.6. I hope it should not matter much with different versions.</p><h3>Dockerfile:</h3><p>I did struggle to get the right Dockerfile, it took me like 2–3 days after many different experiments that I did. I used to follow tutorials was able to get the app they were using up and running but not my app. So I stopped all the copy-pasting and started writing the commands carefully. I followed these two articles(<a href="https://www.digitalocean.com/community/tutorials/containerizing-a-ruby-on-rails-application-for-development-with-docker-compose">first</a> and <a href="https://coderjourney.com/convert-rails-app-to-docker/">second</a>) to come up with my docker setup for Rails and Postgres. I have tried executing the same commands as these articles suggested, but couldn’t get it working. Either Postgres issue or the rails were not able to run. This is the Docker file:</p><pre>FROM ruby:2.5.1</pre><pre>ENV BUNDLER_VERSION=2.1.2</pre><pre>RUN apt-get update -yqq \<br>    &amp;&amp; apt-get install -yqq --no-install-recommends \<br>    postgresql-client \<br>    nodejs \<br>    qt5-default \<br>    libqt5webkit5-dev \<br>    &amp;&amp; apt-get -q clean \<br>    &amp;&amp; rm -rf /var/lib/apt/lists</pre><pre>RUN gem install bundler -v 2.1.2</pre><pre>WORKDIR /usr/src/app<br>COPY Gemfile* ./<br>RUN bundle check || bundle install</pre><pre>COPY . .</pre><pre>ENTRYPOINT [&quot;./entrypoints/docker-entrypoint.sh&quot;]</pre><p>Just be careful with the bundler version. Try to specify the bundler version that u have installed the gems from Gemfile. If it didn’t work, try to update the bundler version, delete Gemfile.lock and then run bundle install.</p><h3>docker-compose</h3><p>The same story, tried from two articles, but this is my working docker-compose file:</p><pre>version: &quot;3.4&quot;</pre><pre>volumes:<br>  db-data:<br>    external: false</pre><pre>services:<br>  db:<br>    environment:<br>      POSTGRES_USER:<br>      POSTGRES_PASSWORD:<br>    image: postgres:10.12<br>    volumes:<br>      - db-data:/usr/local/pgsql/data</pre><pre>app:<br>    env_file: .env<br>    build: .<br>    volumes:<br>      - .:/usr/src/app<br>    ports:<br>      - 3003:3003<br>    depends_on:<br>      - db</pre><p>Again, give attention to the Postgres image.</p><h3>.env file</h3><pre>POSTGRES_HOST=db<br>POSTGRES_USER=user_system<br>POSTGRES_PASSWORD=super_secure<br>SECRET_KEY_BASE=development_secret<br>SINGLE_TENANT_MODE=true</pre><p>This is clear that it will set this as environment variables in the container for the application to use.</p><h3>database.yml</h3><pre># config/database.yml<br>default: &amp;default<br>  adapter: postgresql<br>  host: &lt;%= ENV[&quot;POSTGRES_HOST&quot;] %&gt;<br>  username: &lt;%= ENV[&quot;POSTGRES_USER&quot;] %&gt;<br>  password: &lt;%= ENV[&quot;POSTGRES_PASSWORD&quot;] %&gt;<br>  encoding: utf8<br>  min_messages: warning<br>  pool: 2<br>  timeout: 5000</pre><pre>development:<br>  &lt;&lt;: *default<br>  database: user_system_dev</pre><pre>test:<br>  &lt;&lt;: *default<br>  database: user_system_test</pre><pre>production:<br>  &lt;&lt;: *default<br>  database: user_system</pre><p>This host is required to be added and rest is known. Nothing special in this, just read data from environment variables that are set in the .env file.</p><h3>Gemfile</h3><p>Gemfile and Gemfile.lock can be found in this <a href="https://github.com/shravanc/user_system">repository</a>. All the highlights are the points where I have got a doubt when my docker was failing to run in the beginning. Just thought of highlighting, hope it helps others with the same problem.</p><h3>Testing</h3><p>Commands are as below:</p><pre># README</pre><pre>docker-compose up --build<br>docker-compose up -d<br>docker-compose exec app bundle exec rake db:setup db:migrate<br>docker-compose exec app bundle exec rake db:seed</pre><p>With this, you should be able to open the browser and run any get calls.</p><h3>Conclusion:</h3><p>Docker is a useful tool if you need to share your application without much load on the person to whom you are sharing to. It just takes a few commands that are mentioned in the above section. Containerization will help deploy your application on the cloud as well. There you go, happy learning and sharing. Enjoy coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59eaa79ec7ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End to end Machine Learning Solution]]></title>
            <link>https://shravan-c.medium.com/end-to-end-machine-learning-solution-ca6936ef2afb?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca6936ef2afb</guid>
            <category><![CDATA[apc]]></category>
            <category><![CDATA[gridsearchcv]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[eda]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Sun, 22 Mar 2020 22:46:57 GMT</pubDate>
            <atom:updated>2021-04-19T10:44:06.435Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fExE_dGhzuDIUu7fktaIg.jpeg" /><figcaption><a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fmedium.com%2F%40ricardocastellanos_13596%2Fios-machine-learning-libraries-and-frameworks-e458f18e5a18&amp;psig=AOvVaw1gugPzf-AbNgSP4Uo5T-vM&amp;ust=1585003128956000&amp;source=images&amp;cd=vfe&amp;ved=0CAIQjRxqFwoTCMCqkfeSr-gCFQAAAAAdAAAAABAD">https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fmedium.com%2F%40ricardocastellanos_13596%2Fios-machine-learning-libraries-and-frameworks-e458f18e5a18&amp;psig=AOvVaw1gugPzf-AbNgSP4Uo5T-vM&amp;ust=1585003128956000&amp;source=images&amp;cd=vfe&amp;ved=0CAIQjRxqFwoTCMCqkfeSr-gCFQAAAAAdAAAAABAD</a></figcaption></figure><p>Hello, this is about the complete flow for a regression machine learning solution. EDA — Exploratory Data Analysis is the first step towards any machine learning problem. It is about understanding the data before moving further. It goes like understand the problem first and then solve it. I feel more time spent on data more comfortable you become towards solving ML problems. Dataset used in this can be found <a href="https://data.world/uci/parkinsons-telemonitoring">here</a>[0]. All are floating-point values. I have covered almost all the regression models in Sklearn and using <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html">GrdidsearchCV</a>. GridsearchCV finds the best possible model parameters and it implements score on the cross-validation which is a measure of the model. Also to make it a little interesting, have covered almost all <a href="https://scikit-learn.org/stable/modules/classes.html#module-sklearn.preprocessing">preprocessing</a> techniques for scaling.</p><p>The idea behind this experiment is, it is not possible to master all the techniques in a short amount of time. To bypass this time of not understanding all the techniques in-depth, run this method to give an insight into which method to look into and pick like best three or five combinations and analyze more on the same if needed. Also to avoid all the doubts in mind why not try other combinations. This will give an idea as to what is the thing that you have got in front of you to solve a given problem.</p><p>Code for this is divided into three-part:</p><ol><li><a href="https://colab.research.google.com/drive/1gIOM24xP0EZdGRV-yJxtL0wixeeyW-ZA">Final Part</a></li><li><a href="https://github.com/shravanc/tf/tree/master/framework">Regression Framework</a></li><li><a href="https://colab.research.google.com/drive/19rTDVFyOFxB40_OAmvldnLTzDcQmFwFq">Analysis of Framework Results</a></li></ol><h3>EDA — Exploratory Data Analytics</h3><p>As I have said in the intro it is very vital dealing with ML. By doing this you almost end up yourself thinking about which ML model that you want to use for this. More time you spend more insights and problems you will see and start finding solutions to tackle it. This mainly involves below points:</p><ul><li>Data Distribution</li><li><a href="https://medium.com/@shravan007.c/eda-data-imputation-be3171846546">Outliers Involved</a></li><li>Analyzing Categorical / Numerical features(Some numerical features are also categorical)</li><li><a href="https://medium.com/@shravan007.c/eda-data-imputation-be3171846546">Data Imputation</a></li><li>Dimensionality Reduction — PCA (Feature selection if not deep learning)</li></ul><p>Data distribution is understanding how each feature is varied, is it too random? is it uniform? is it uniform with outliers? how many missing values for each feature? This is understood with pandas describe. This gives mean, median, std, and percentiles 25, 50 and 75. Standard deviation is a measure of spread. How the numeric feature is spread out? If the value is high it is a clear indication that data is spread out on a wider range. <a href="https://www.youtube.com/watch?v=mk8tOD0t8M0">A very good video on youtube to understand all these parameters</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCm4qUnQDunJyWc3vStzlg.png" /></figure><p>Doing analysis for a few features:</p><p><strong>age</strong>: total count is clear(i.e there is 2100 entry in the table and of course it should be the same for all features). mean is 64.4 this says that the average age of consideration is 64.4, from that you can get an idea like if there is an entry with age below 10 you might get some doubt if the data is correct or wrong. This is the measure of correctness in my terms with the help of standard deviation. std is 9.1 so this looks fine, it is not a very big number. It should be less for ideal datasets. This says that from mean that is 64.4 a regular data can vary in the range of 9.1. So if you see any data varying badly from mean with respect to std then it can be considered as an outlier and has to be understood properly before taking any action on such data.</p><p><strong>test_time</strong>: source says(test_time — Time since recruitment into the trial. The integer part is the number of days since recruitment[0]) from this we can say, either it should be zero or a positive integer. But there are few negative values. This can be tackled in many ways, I have done one of the experiments in this <a href="https://colab.research.google.com/drive/1STlnjrVR-Sh7I6JOuUN3qR2BqD5FNiL6">Colab</a> by replacing it with mean value, but didn&#39;t make much of a difference, as there are only 3 negative values. Here again, std is around 53 which is a little more, so it can be assumed distribution will be wider, and max value and .75 percentile value has a big difference as well, leading us to assume to have more outliers.</p><p>For <a href="https://medium.com/@shravan007.c/eda-data-imputation-be3171846546">Outliers and Imputation</a> please follow this article. And categorical should be converted to numerical representation by methods like one-hot encoding. It is always better to use one-hot encode rather than replacing it with a sequence of numbers(1, 2, 3, etc) which may introduce bias.</p><p>By the above steps, like one hot encoding along with numerical values, might increase features by many. So in order to keep features that really matter for the prediction, features with low relevance for prediction should be filtered out. If not training will takes ages to complete unless the infrastructure is very good. PCA is one of the well-known dimensionality reduction techniques. There are many videos on youtube. My suggestion would be <a href="https://www.youtube.com/watch?v=HMOI_lkzW08">this</a>.</p><h3>GridSearchCV:</h3><p>This is another good friend from sklearn community, it does all the hard work of trying it out many different combinations that we specify. GridSearchCV is like a developer and hyperparameters are the commands of his manager. Developers do all the work based on the hyperparameters. Like how different developer s need to be tackled differently with different motivation factors, even for GridSearchCV needs this different motivation on different MachineLearning models. All this hyperparameter that I feel is enough or known in the model_list.py file. It is like a configuration file that can be changed anytime for any purpose. More details from S<a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html">kelarn</a>.</p><h3>Preprocessing</h3><p>Preprocessing as said above done to give equal importance for each feature. Sklearn has defined many preprocessing techniques, in this exercise I have tried 8 different scaling method. Once this preprocessing is done new CSV is created out of it. All this is done after data analysis done on the original data. And each dataset is run against 15 machine learning models. Each result is then stored and further analysis is done on this result. This is available in the final Colab.</p><p>So this is how the code is to be used: Final part →framework →Analysis.</p><p>Once the Analysis is done for a given problem replace the model in the final part. In the Framework, there is a very good way of understanding each feature. The framework mainly has three functions:</p><ul><li><strong>generate_csv_with_different_scaling_method</strong>: generate CSV for each scaling method</li><li><strong>analyse_distribution</strong>: This generates an image in the image path</li><li><strong>cluster_analysis</strong>: This gives cluster analysis image in cluster path</li><li><strong>train</strong>: This run iterations over CSV’s and models.</li></ul><p>This concludes my experiment. From the Analysis, I found out for the regression dataset mentioned above RandomForestRegressor is the best and has performed across the scaling method. This is not generic enough to handle all type of datasets, going further will update. I would like to hear if any thoughts on this and I hope it helps others as this involves the complete process of machine learning. Enjoy sharing!!! Enjoy Coding!!!</p><p><strong>References:</strong></p><p>[0] Athanasios Tsanas, Max A. Little, Patrick E. McSharry, Lorraine O. Ramig (2009),’Accurate telemonitoring of Parkinsonâ€™s disease progression by non-invasive speech tests’, IEEE Transactions on Biomedical Engineering (to appear).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca6936ef2afb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EDA- Data Imputation]]></title>
            <link>https://shravan-c.medium.com/eda-data-imputation-be3171846546?source=rss-fa76ab4a20c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/be3171846546</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[eda]]></category>
            <category><![CDATA[data-imputation]]></category>
            <category><![CDATA[outliers]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Shravan C]]></dc:creator>
            <pubDate>Sat, 21 Mar 2020 15:50:10 GMT</pubDate>
            <atom:updated>2020-03-21T17:01:32.920Z</atom:updated>
            <content:encoded><![CDATA[<h3>EDA - Data Imputation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-kBaE2r0oEIfpK3tnWo4rA.png" /></figure><p>Hello, getting straight into the business. Data Imputation is about filling the missing data of your dataset. Of course, pandas are used and no particular dataset is used rather data frame is created for the understanding purpose.</p><p><strong>This is done in three steps</strong></p><ul><li>Data visualization with proper data</li><li>What is an outlier and dealing with it</li><li>Data imputation for missing data</li><li>Data imputation using Kmean clustering</li></ul><p><a href="https://colab.research.google.com/drive/1U0Ce_isYP4XMLtzzmR4QiRQcPHZ1MIM8"><strong>Details can be found in the Colab. This is an interesting step in EDA.</strong></a></p><p><strong>In the first part,</strong> of the Colab example, it is about creating a DataFrame and then visualizing it with pandas describe and the boxplot. Here we see that there are no outliers as such because data has none.</p><p><strong>In the second part</strong>, an outlier is introduced by adding a very large number compared to others in the data. From the boxplot, it is evident that data contains outliers. Usually, all the outlier features are segregated and treated differently(in terms of scaling, where logarithmic scaling and robust scaling are applied) and regular scaling for non-outlier features. Scaling is important because this will allow a machine learning model to give equal importance to all features.</p><p><strong>In the third and fourth parts, </strong>missing data is introduced. It is then checked how they are there. And again describe is used to analyze the distribution. And two methods are discussed to fill in the missing data. 1. is a regular method using your data analysis 2. using cluster analysis to impute the data which will make sure there is no bias introduced in the imputation process.</p><p>If the dataset is very large it does take a long time for cluster analysis, but it is what it is. Please do go along the Colab to understand better. I have been experimenting with all scaler methods available in sklearn and with all possible regression models shortly will publish an article on the same. Thanks for reading!!! Enjoy Coding!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be3171846546" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>