<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Param Mehrotra</title>
    <description>The latest articles on DEV Community by Param Mehrotra (@param3103).</description>
    <link>https://dev.to/param3103</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F546412%2F447762ef-f749-47bd-9cbc-efcf2d662889.png</url>
      <title>DEV Community: Param Mehrotra</title>
      <link>https://dev.to/param3103</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/param3103"/>
    <language>en</language>
    <item>
      <title>Wine Quality Prediction</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Mon, 05 Jul 2021 04:02:43 +0000</pubDate>
      <link>https://dev.to/param3103/wine-quality-prediction-39aj</link>
      <guid>https://dev.to/param3103/wine-quality-prediction-39aj</guid>
      <description>&lt;p&gt;After getting the fundamentals clear from the courses, I knew it was time to jump right in into a machine learning project. But what exactly was in a machine learning project? &lt;/p&gt;

&lt;p&gt;&lt;a&gt; The 7 steps of machine learning &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After looking at the above video by Google, I started off on my project right away. &lt;/p&gt;

&lt;p&gt;The first step was to gather and clean the data for my project. &lt;/p&gt;

&lt;p&gt;Fortunately, the wine data is available in the SKLearn library and so I just had to import it from there.&lt;/p&gt;

&lt;p&gt;Thereafter, I wanted to better understand the data so I put it in a pandas dataframe and saw the first 5 data points in the dataset. The wine dataset has many characteristics which include alcohol, malic acid, ash, alkalinity of ash, magnesium and any more. The wine dataset also had this column called &lt;em&gt;Target&lt;/em&gt; with values only of 1 to 3. Reading up on the dataset, each number represented a class of wine with certain characteristics. Each data point in the wine dataset belonged to one of the classes.&lt;/p&gt;

&lt;p&gt;After looking at the graphs of the data points of each characteristic of wine, I realised that the alcohol levels of the wines were very distinctly putting  each wine to 3 separate classes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pc73eRal--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Param3103/wine_quality_prediction/main/wine_data.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pc73eRal--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/Param3103/wine_quality_prediction/main/wine_data.png" alt="graph of wine type against alcohol level"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each of these classes had values 0,1 or 2.&lt;/p&gt;

&lt;p&gt;So, the problem had now become on predicting if the wines belonged to classes 0, 1 or 2.&lt;/p&gt;

&lt;p&gt;So, now I split the data into training and test sets and scaled the 2 sets to each other.&lt;/p&gt;

&lt;p&gt;I then used the k neighbors classifier algorithm by letting k=6.&lt;br&gt;&lt;br&gt;
 &lt;em&gt;It turns out k=6 had highest accuracy&lt;/em&gt;. I fit the model to the training set and tested it out with the test set. I turns out, this gives an accuracy of 0.83 or 83%.&lt;/p&gt;

&lt;p&gt;I was now able to predict the classes of wines with pretty good an accuracy.&lt;/p&gt;

&lt;p&gt;To conclude off, I just want to roughly share what my understanding is of the k neighbors classifier. How the k neighbors classifier works in this case is that, when a new point is given to the classifier, it plots it onto a horizontal 1-dimensional graph where the previous alcohols were already plotted on based on its alcohol level. It then finds the k nearest points to it on the horizontal graph, depending on what k you give it, and gives a class that is the majority amongst the "neighbor points".&lt;/p&gt;

&lt;p&gt;So, that is my first machine learning project. I am eager to try new machine learning algorithms.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>machinelearning</category>
      <category>firstmlproject</category>
      <category>python</category>
    </item>
    <item>
      <title>Stepping into AI world</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Mon, 05 Jul 2021 03:09:43 +0000</pubDate>
      <link>https://dev.to/param3103/stepping-into-ai-world-3434</link>
      <guid>https://dev.to/param3103/stepping-into-ai-world-3434</guid>
      <description>&lt;p&gt;As I began my journey into the world of machine learning in python, I was totally lost on what should I do. Machine Learning has been the latest craze in the world of programming and I was eager to step my foot into this newest world in the realm of programming.&lt;/p&gt;

&lt;p&gt;AI is set to be the next craze in the next 50 years or so and my curiosity helped me churn out some possible resources I could need to understand this bleak idea to me.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cs50.harvard.edu/ai/2020/"&gt;CS50's Introduction to Artificial Intelligence&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I first came across this link above, in which Andrew Ng &lt;em&gt;(He is awesome by the way)&lt;/em&gt; , a very renowned machine learning expert, shares on the mathematical and conceptual logic and understanding of the machine learning algorithms. I found this very educational as it was here I first was able to relate machine learning problems to optimisation.&lt;/p&gt;

&lt;p&gt;Hereafter, I went to the &lt;em&gt;Elements of AI&lt;/em&gt; course.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.elementsofai.com/"&gt;Elements of AI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this course, I was able to get a better grasp of the fundamental logic and reasoning behind machine learning algorithms.&lt;/p&gt;

&lt;p&gt;I thought now I was ready to dive into the programming part of machine learning. However, the courses I found either only talked about the code with no explanation about the concept or showed the code after explaining the concepts. It was only until I saw this video series by &lt;em&gt;CodeBasics&lt;/em&gt; that I was really able to piece things together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/playlist?list=PLeo1K3hjS3us_ELKYSj_Fth2tIEkdKXvV"&gt;Data Science Full Course For Beginners- CodeBasics&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;He explained the machine learning algorithms, explained the logic behind each line of code he was writing and what steps he was taking to use the ml model. Shout out to him and to all other beginners out there, I would recommend you to follow him.&lt;/p&gt;

&lt;p&gt;After looking at his videos, I thought it was time I began my first ml project. More about it in the next post!&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Calculator</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Fri, 11 Jun 2021 03:56:04 +0000</pubDate>
      <link>https://dev.to/param3103/calculator-5e8d</link>
      <guid>https://dev.to/param3103/calculator-5e8d</guid>
      <description>&lt;p&gt;Hello there! As I continue to progress in my programming journey, I decided to learn something new. As a quick flashback, I started off with basic python projects and then learnt about DBMS with SQL and Python mySQL. So, I decided to now move onto the user interface side by learning about Flutter.&lt;/p&gt;

&lt;p&gt;Flutter is one of the latest user interface programming languages created by Google and I found this introductory course by The Net Ninja on Youtube quite useful.&lt;br&gt;
&lt;a&gt;Intro to Flutter&lt;/a&gt;&lt;br&gt;
They go through the basics of Dart programming and the creating of basic functions and widgets on the application.&lt;/p&gt;

&lt;p&gt;Thereafter, I decided to use my newfound knowledge to create a Calculator App. I ran my code to display it on Google, which gives us the capabilities to see what phone users will see. I then experimented with designs, colors, display, buttons and came up with a calculator -shape app for which pressing the buttons will show text on the screen.&lt;/p&gt;

&lt;p&gt;The came the part about evaluating the equation. I did that in another function and evaluated the text using the &lt;em&gt;eval&lt;/em&gt; function which I created using a simple algorithm. I separated the string into 2 on the either side of the sign. Used the &lt;em&gt;eval&lt;/em&gt; function on them. Returned the values and then calculated the final equation. I then displayed in the text form on the screen.&lt;/p&gt;

&lt;p&gt;This experience was fun and enriching as I learnt about stateful and stateless widgets and designing apps in general.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My super mart</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Fri, 11 Jun 2021 03:37:40 +0000</pubDate>
      <link>https://dev.to/param3103/my-super-mart-5d3j</link>
      <guid>https://dev.to/param3103/my-super-mart-5d3j</guid>
      <description>&lt;p&gt;After learning about and experimenting with Databases in the previous project. I decided to go next level with a project that requires more tables in my database. After some research online, I decided to make my very own super mart managed on a database.&lt;br&gt;
In this database, I will be managing, customer interactions, item handling and price management.&lt;/p&gt;

&lt;p&gt;Let us first talk about item handling. So, I first created a table &lt;em&gt;seller_details&lt;/em&gt; to store the details about the vendors from whom I was going to purchase my items from. For example, I may purchase breads from Raj's Bakery. So, I will store their name, phone, email and address...just as I did in my contact book project.&lt;br&gt;
Then, I created a table of &lt;em&gt;stock_type&lt;/em&gt; that will store all the types of items I will store in my shop like oranges, apples, bananas, milk, etc. I also created a table that stored details of all the items I had in my store like the name &lt;em&gt;Beautiful Bananas&lt;/em&gt;, their quantity, their sale and purchase prices, etc. .&lt;/p&gt;

&lt;p&gt;Then, I had to look into customer management so I created the tables &lt;em&gt;customer_details&lt;/em&gt; and &lt;em&gt;customer_purchase_details&lt;/em&gt;. The first table stored details of my customers like name, phone, email and address... just as I did in my contact book project. The cutomer_purchase_details stored all the transactions they had made. They stored the item bought, the quantity and the price they paid.&lt;/p&gt;

&lt;p&gt;Finally, I created a table for my income management that stored the details of all the income I had made.&lt;/p&gt;

&lt;p&gt;Overall, in this project I learnt about database handling, SQL syntax and how to connect python to sql.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create Contact Book</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Tue, 05 Jan 2021 12:39:10 +0000</pubDate>
      <link>https://dev.to/param3103/create-contact-book-41hj</link>
      <guid>https://dev.to/param3103/create-contact-book-41hj</guid>
      <description>&lt;p&gt;Hi guys. From my second project, I created a contact book which helps you save details about people you know. For this project, I limited myself to 4 details of the contact: &lt;em&gt;Name, Phone, Email ID, Address&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So, for the contact book. I needed to store my details somewhere, so this data can be easily retrievable. So, just like my previous project, I stored this data of contacts into a csv file &lt;em&gt;Contact_Book.csv&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;Now, that I had the contact book set up, I needed to create three functions for the user to interact with the contact book. &lt;em&gt;create_new_contact, update_exisiting_contact, find_contact&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In the function create_new_contact, &lt;br&gt;
I took in four values: &lt;em&gt;Name, Phone, Email ID, Address&lt;/em&gt; and wrote it into the csv file. &lt;/p&gt;

&lt;p&gt;In the function retrieving_contact ,I took in two variables &lt;em&gt;finder_keys&lt;/em&gt; and &lt;em&gt;finder_values&lt;/em&gt; each of it is a set. The finder_keys contains the type of data i have. i.e. name,phone,etc. The finder_values contains the data i have in the same order the keys are in in finder_keys.I then iterated through each contact in the contact book and converted each string into an array.I then saw if each datum in the contact is the same as the datum i want for a particular type of data. If so, then i append this contact into a set containing all the contacts I want and in the ens it will return the contact.&lt;/p&gt;

&lt;p&gt;In the function updating_existing_contact, i took in 4 sets of values, &lt;br&gt;
1) finder_keys: which contains the types of data i have to identify the contacts i want to update&lt;br&gt;
2) finder_values: which contains the data i have to identify the contacts i want to update&lt;br&gt;
3) tbc_keys: which contain the type of data i want to change for each contact&lt;br&gt;
4) new_values: which contain the new values i want to put into the contact&lt;/p&gt;

&lt;p&gt;I then wrote all the contacts I am not updating and the updated contacts into a new csv file and renamed that file to the original one.&lt;/p&gt;

&lt;p&gt;In the function find_contact, i took in two sets of values, &lt;em&gt;finder_keys&lt;/em&gt; and &lt;em&gt;finder_values&lt;/em&gt;. Then i iterated through the csv file. And found if the value in the line and the position of each finder_key is the same as the corrospoding finder_value. If all the finder_values match with the contact. I append the contact into a set found_contact and return the set at the end.&lt;/p&gt;

&lt;p&gt;I then created a user_interface to allow the contact book user to easily interact with the book. &lt;/p&gt;

&lt;p&gt;Finally, i unittested each of the functions using custom impits and custom outputs to ensure all were working well.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>IMDB movie scrapper - my first project</title>
      <dc:creator>Param Mehrotra</dc:creator>
      <pubDate>Tue, 29 Dec 2020 10:37:54 +0000</pubDate>
      <link>https://dev.to/param3103/imdb-movie-scrapper-my-first-project-4592</link>
      <guid>https://dev.to/param3103/imdb-movie-scrapper-my-first-project-4592</guid>
      <description>&lt;p&gt;I have started my programming journey with a project that incorporated a lot of things I have never done before. I was exposed to many new python libraries available for use and also learnt the format of programming projects.&lt;/p&gt;

&lt;p&gt;So, I started off by first reading about the library beautiful soup. This library helps us to extract and decode the html code of the website that we are extracting data from. In this case, I was extracting data of the top 250 English and top 250 Hindi movies from IMDB. &lt;em&gt;(links below)&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;After that, I read up a bit on html to understand the html code of the website. here, I found out that all titles and their years were given in the 'td' section with &lt;/p&gt;

&lt;p&gt;''' python &lt;br&gt;
{"class": "titleColumn"}&lt;br&gt;
''' &lt;/p&gt;

&lt;p&gt;and all the ratings were given with '{"class": "ratingColumn imdbRating"}' in the same section. So, I extracted them all using the findall function in beautiful soup. I then separated thee title into name and year by splitting the string into two. I then created a class Movie which took in the values name, year and rating.&lt;/p&gt;

&lt;p&gt;Now, that I had extracted the data, I had to sort it based on a custom criterion (either movie name "(alphabetically)", Rating or Release Year). &lt;/p&gt;

&lt;p&gt;Links:&lt;br&gt;
1)IMDB top 250 English movies:&lt;br&gt;
 &lt;a href="https://www.imdb.com/chart/top/?ref_=nv_mv_250"&gt;https://www.imdb.com/chart/top/?ref_=nv_mv_250&lt;/a&gt;&lt;br&gt;
2) IMDB top 250 Hindi movies: &lt;br&gt;
&lt;a href="https://www.imdb.com/india/top-rated-indian-movies/?pf_rd_m=A2FGELUUNOQJNL&amp;amp;pf_rd_p=4da9d9a5-d299-43f2-9c53-f0efa18182cd&amp;amp;pf_rd_r=F22A2RC934X0Q4NDWHBA&amp;amp;pf_rd_s=right-4&amp;amp;pf_rd_t=15506&amp;amp;pf_rd_i=top&amp;amp;ref_=chttp_ql_7"&gt;https://www.imdb.com/india/top-rated-indian-movies/?pf_rd_m=A2FGELUUNOQJNL&amp;amp;pf_rd_p=4da9d9a5-d299-43f2-9c53-f0efa18182cd&amp;amp;pf_rd_r=F22A2RC934X0Q4NDWHBA&amp;amp;pf_rd_s=right-4&amp;amp;pf_rd_t=15506&amp;amp;pf_rd_i=top&amp;amp;ref_=chttp_ql_7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>myfirstproject</category>
    </item>
  </channel>
</rss>
