<?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: Olayinka Atobiloye</title>
    <description>The latest articles on DEV Community by Olayinka Atobiloye (@olayinkaatobiloye).</description>
    <link>https://dev.to/olayinkaatobiloye</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%2F550164%2F8c142300-ce39-4d42-b23e-5e978ca17976.jpeg</url>
      <title>DEV Community: Olayinka Atobiloye</title>
      <link>https://dev.to/olayinkaatobiloye</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olayinkaatobiloye"/>
    <language>en</language>
    <item>
      <title>A Deep Dive Into Machine Learning</title>
      <dc:creator>Olayinka Atobiloye</dc:creator>
      <pubDate>Mon, 03 May 2021 09:18:40 +0000</pubDate>
      <link>https://dev.to/olayinkaatobiloye/a-deep-dive-into-machine-learning-2c94</link>
      <guid>https://dev.to/olayinkaatobiloye/a-deep-dive-into-machine-learning-2c94</guid>
      <description>&lt;p&gt;Machine learning is one of the latest buzzwords in tech. This field has experienced an uprising in the past few years. The role of a machine learning engineer ascertains you a level of job security, as machine learning is one of the highest paying jobs in recent times.&lt;/p&gt;

&lt;p&gt;With the promising future of this tech discipline, it is not surprising that several people have grown interest in the field. I believe that you, reading this are one of such people.&lt;/p&gt;

&lt;p&gt;Starting to learn machine learning, especially when you are not well-grounded in what it entails, can be daunting. This article will cover the nitty-gritty of machine learning needed to give you the necessary knowledge and confidence to start machine learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Machine Learning?
&lt;/h2&gt;

&lt;p&gt;Machine learning is simply making machines learn patterns from existing data and applying them to new data. It is all about making inferences and predictions from data.&lt;/p&gt;

&lt;p&gt;You can liken machine learning to a child learning to recognize and identify people around him. The child sees the people many times, watches them,  identifies their features, then, when he sees these people again, he uses the knowledge he has accrued from watching these people in identifying who is who.&lt;/p&gt;

&lt;p&gt;And that is the workflow of any machine learning process. We feed data to a machine, the machine studies the data, and discovers patterns in the data. When new and unseen data is fed to the machine, it predicts or makes inferences from the data based on patterns discovered from previous data fed to it.&lt;/p&gt;

&lt;p&gt;This process of feeding data to a machine to enable it to make inferences from future unseen data is called training a model. Machine learning is all about modeling. &lt;/p&gt;

&lt;p&gt;A machine learning model is an algorithm with a clear set of instructions on how our machine is expected to learn from data, what it is expected to predict, and the overall expected methodology.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/5dYeglPmPC5lL7xYhs/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/5dYeglPmPC5lL7xYhs/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types Of Machine Learning
&lt;/h2&gt;

&lt;p&gt;Machine learning problems can be categorized into three distinct types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supervised Learning&lt;/li&gt;
&lt;li&gt;Unsupervised Learning&lt;/li&gt;
&lt;li&gt;Reinforcement Learning&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Supervised Learning
&lt;/h2&gt;

&lt;p&gt;As previously discussed, machine learning models are trained on data. The nature of the data determines if the machine learning problem is supervised or unsupervised. In supervised learning, the training data is labeled, and the values of targets are known.&lt;/p&gt;

&lt;p&gt;Supervised learning is when you have your input values with known output values; then, you use an algorithm to derive a function that matches input to output.&lt;/p&gt;

&lt;p&gt;To thoroughly understand the concept of machine learning, think of a teacher teaching a student how to solve a maths problem. The teacher knows and has the answer to the maths problem. The student, on the other hand, is expected to solve and find the answer following a set of instructions. The student iteratively solves the problem and is corrected by the teacher until he derives the correct answer. The student only stops solving the question when he derives the correct answer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/3og0IJXQEKwIdIEYpy/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3og0IJXQEKwIdIEYpy/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the process of machine learning. The engineer writes an algorithm with which the machine is expected to derive a relationship between the input and output values. The machine follows the instructions as outlined in the model and does its best to come up with a function that maps the input to the output.&lt;/p&gt;

&lt;p&gt;The engineer can then compare the outputs predicted by the model to the already known output. He checks the accuracy of the model, and if need be, he fine tunes the model to better increase its accuracy. This machine learning process is supervised, as the input and output values are known.&lt;/p&gt;

&lt;p&gt;Supervised learning problems can be further classified into two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Classification
&lt;/h3&gt;

&lt;p&gt;Classification is a type of supervised learning problem where the output is a category. The output values of a classification problem are distinct classes, and our output can belong to only one of these classes. Examples of classification problems are spam or no-spam predictions, cat or dog predictions, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;
  
  
  Regression
&lt;/h3&gt;

&lt;p&gt;Regression problem is where the output is a real value and can take on any value within a continuous range. Examples are weight, height, or salary predictions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Unsupervised Learning
&lt;/h2&gt;

&lt;p&gt;Unsupervised learning is when there are inputs but no output in the training data. In unsupervised learning, there are no correct answers or teachers. &lt;br&gt;
The model will study the distribution of the data and derive insights into the underlying structure and presentation of the data. &lt;br&gt;
Unsupervised learning can further be grouped into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clustering&lt;/li&gt;
&lt;li&gt;Anomaly detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reinforcement Learning
&lt;/h2&gt;

&lt;p&gt;Reinforcement learning is a branch of machine learning concerned with making machines make decisions. Reinforcement learning employs a trial-and-error approach in deciding the best strategy or decision to make. An example of a reinforcement learning problem is a model for playing chess games.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Machine Learning Workflow
&lt;/h2&gt;

&lt;p&gt;To solve any machine learning problem, here is the basic workflow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxslyi44uwvymnx7wbs8e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxslyi44uwvymnx7wbs8e.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Gather datasets&lt;/li&gt;
&lt;li&gt;Extract features&lt;/li&gt;
&lt;li&gt;Split the dataset into training and testing sets.&lt;/li&gt;
&lt;li&gt;Train the model on the training set&lt;/li&gt;
&lt;li&gt;Evaluate the model on the testing set&lt;/li&gt;
&lt;li&gt;Fine-tune the model&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Machine learning is all about modeling. &lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;To further learn about machine learning, here are some helpful resources:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://machinelearningmastery.com/supervised-and-unsupervised-machine-learning-algorithms/" rel="noopener noreferrer"&gt;Supervised and Unsupervised Learning&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/what-is-reinforcement-learning/" rel="noopener noreferrer"&gt;Reinforcement Learning&lt;/a&gt; &lt;br&gt;
&lt;a href="https://deepsense.ai/what-is-reinforcement-learning-the-complete-guide/" rel="noopener noreferrer"&gt;Reinforcement Learning; the Complete Guide &lt;/a&gt;&lt;br&gt;
&lt;a href="https://towardsdatascience.com/workflow-of-a-machine-learning-project-ec1dba419b94" rel="noopener noreferrer"&gt;Machine Learning Project Workflow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy modeling!🎉&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Importing Data From The Web Into Python</title>
      <dc:creator>Olayinka Atobiloye</dc:creator>
      <pubDate>Wed, 10 Feb 2021 16:47:28 +0000</pubDate>
      <link>https://dev.to/olayinkaatobiloye/importing-data-from-the-web-into-python-3h0n</link>
      <guid>https://dev.to/olayinkaatobiloye/importing-data-from-the-web-into-python-3h0n</guid>
      <description>&lt;h1&gt;
  
  
  Importing Data From The Web Into Python
&lt;/h1&gt;

&lt;p&gt;Throughout your journey as a Data Scientist, you will find yourself regularly dealing with data. Sometimes, these data are readily available, while other times, you have to source for and gather the data yourself.&lt;/p&gt;

&lt;p&gt;Your data can be gathered from various sources, but more often than not, you would get these data from the web.&lt;/p&gt;

&lt;p&gt;Now imagine you found a website that has this gigantic enormous data that you find very useful. Unfortunately, there is no way you can download the contents on this website onto your device for analysis.&lt;/p&gt;

&lt;p&gt;Manually collating the data from the website would cost you a great amount of time. Fortunately, you can seamlessly import these data using some Python packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importing data using urlretrieve
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Import the function &lt;code&gt;urlretrieve&lt;/code&gt; from the &lt;code&gt;urllib.request&lt;/code&gt; subpackage.
           from urllib.request import urlretrieve&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Assign the url of the website to a variable - ‘url’ is used as example here.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```url = 'https://google.com'```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the function &lt;code&gt;urlretrieve&lt;/code&gt; to save this file locally. Pass two arguments to the function - the url of the website (which has been assigned to the variable ‘url’) and the name you wish to save the file as.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```urlretrieve(url, 'file.txt')```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The data is now saved as a file on your device, which you can manage and wrangle as you wish.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Importing data using urlopen and Request
&lt;/h2&gt;

&lt;p&gt;To fully understand how this works, you need to have a basic understanding of HTTP requests. But worry not, even if you do not understand requests, you can follow the steps below and import data from the web.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Import the functions &lt;code&gt;urlopen&lt;/code&gt; and &lt;code&gt;Request&lt;/code&gt; from the subpackage &lt;code&gt;urllib.request&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```from urllib.request import urlopen, Request```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the url.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```url = 'https://google.com'```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Package the request by calling &lt;code&gt;Request&lt;/code&gt; on the url.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```request = Request(url)```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Send the request and catch the response.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```response = urlopen(request)```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The response gotten from your request is an object. To extract the content of the html, call the read method on the response object.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```response = response.read()```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can then print, wrangle and manage the content of the webpage.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```print(response)```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Importing Data With requests
&lt;/h2&gt;

&lt;p&gt;Then here comes the almighty &lt;code&gt;requests&lt;/code&gt; package. It is an easier and more recommended way of performing the same import performed with &lt;code&gt;urllib&lt;/code&gt; above.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Import the request package.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```import requests```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the url.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```url = 'https://google.com'```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Call requests' get method on the url. This packages the request, sends it and catches the response. All with one command. Pretty cool, right?&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```request = requests.get(url)```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The response is an HTTP object. To access the contents of the response, call the text attribute on the object.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ```print(request.text)```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that there are several other actions you could take with the packages used above, like interacting with an API. However, for the context of this article, we are only concerned with using them for importing data from a webpage.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Woohoo! You can now easily import data from the web with Python.&lt;br&gt;
The data imported however are HTML contents, with html tags, and other html attributes. They are therefore not quite ready for use or analysis.&lt;/p&gt;

&lt;p&gt;To make them ready for use, you have to format them using a package called BeautifulSoup. This will be discussed in a follow-up article.&lt;/p&gt;

&lt;p&gt;Till then, keep importing data with these packages and doing wonders with Python.&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
