<?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 Abdul Rahim Jalloh on Medium]]></title>
        <description><![CDATA[Stories by Abdul Rahim Jalloh on Medium]]></description>
        <link>https://medium.com/@jallohx86?source=rss-d47018dc53eb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X4Hg8lZo44la5QrRAffRfw.jpeg</url>
            <title>Stories by Abdul Rahim Jalloh on Medium</title>
            <link>https://medium.com/@jallohx86?source=rss-d47018dc53eb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:45:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jallohx86/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[Why Should Sierra Leone Bother About 5G Technology]]></title>
            <link>https://medium.com/@jallohx86/why-should-sierra-leone-bother-about-5g-technology-f8a524b4679e?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8a524b4679e</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[5g-technology]]></category>
            <category><![CDATA[sierra-leone]]></category>
            <category><![CDATA[african]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 08:01:02 GMT</pubDate>
            <atom:updated>2023-10-27T08:01:02.947Z</atom:updated>
            <content:encoded><![CDATA[<p>Three Years ago, I wrote an Essay for a competition organized by a Sierra Leonean Senior Software Reliability Engineer in the United States. Following recent “progress”, it feels like the perfect time to republish this article on my medium. Oh, I was the runner-up in the competition with submissions from various universities across the country :) Enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XKot3rXyNRluKQWG" /><figcaption>Photo by <a href="https://unsplash.com/@julian21?utm_source=medium&amp;utm_medium=referral">Julian</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With Huawei reporting speeds of over 1 GB per second, and latency of less than 30 milliseconds, the fifth-generation technology seems like a technology from Hollywood fiction. As Dr. Sergey Andreev, a senior research scientist at the Tampere University of Technology affirmed “5G has the potential to enrich our very lives beyond what we can imagine today”. It is no joke, but why should Sierra Leone a third-world nation even bother about it?</p><p>5G is the fifth generation mobile network which is a new global wireless standard after 1G, 2G, 3G, and 4G networks. The first generation (1G) technology introduced in the 1980s delivered analog voice, while the second generation in the 1990s was responsible for cellular communications. The 3G brought about data and the app revolution and currently in use is the 4G which enables smart and connected devices. These paved the way for the fifth generation (5G) technology which would deliver higher multi-peak data speed and ultralow latency and it would enable massive network capacity.</p><p>Regardless of all its advantages, one may say we are not ready to use such technology as we are still down the technological hierarchy, and with poverty being a strong firewall to people accessing the riches of the internet age in Africa, what use would this “God Technology” even be to them. There have been genuine concerns raised that African consumers cannot even afford 4G, so why bother with 5G or the new devices necessary to use them? Well, it is not surprising that Governments worldwide and research institutions are the first to invest in 5g worldwide as most of the issues that it solves are related directly to their work. In Sierra Leone, it would help in different sectors such as Education, Health, Agriculture, research etc.</p><p>To start with 5g would be a marvel for the health sector in Sierra Leone. Among the top ten causes of death in the country include lower respiratory infections, ischemic heart disease, stroke, and congenital defects. The rates at which people die from these diseases can be greatly reduced with its application. Ischemic heart disease is caused by narrowed heart arteries that supply blood to the heart. Techniques used in monitoring it and others like congenital defects are Computed Tomography (CT) scans, Magnetic Resonance Imaging (MRI), and nuclear scanning. These scans return large files, and sending these results to the experts for review takes time, and in medicine the longer you wait the lesser the chance of survival. With the low latency of 5G networks, this would be done in seconds.</p><p>Telemedicine is another area where 5G would be amazing in the country. Most people who live in the rural areas of the country would find it difficult to access advanced medical facilities and would often have to travel to urban centers to see a medical professional. With the technology,<br>diagnosis would be done remotely by the best healthcare professionals in the country and worldwide. Even as something like this is ongoing in some places, 5G would highly increase the reach of these professionals from all around the world, and language translators can communicate remotely through video with a patient and doctor at the network edge with low<br>latency. Following the introduction of free and quality education, 21% of the country’s budget was allocated for its purpose. Part of this money could be invested in improving the quality of education through 5g, but how? The internet contains databases of many high-quality Massive Open Online<br>Courses (MOOC). These videos can be used in various classrooms around the country.</p><p>Also, the best tutors in the country can teach thousands of classrooms in the country simultaneously using 5G. The performance of assistive technology can be greatly improved with 5G. The Government could capitalize on the technology to improve the Agricultural Sector. This is one of the largest sectors in the country and the implementation of 5g technology would help in its development. Artificial Intelligence and machine learning could be integrated into agriculture equipment and drones are used for data to be collected on the crops and fields. It would accelerate the rate at which this data is transmitted and processed. Autonomous harvesters could communicate with each other to harvest a field. 5G-connected collars could be put on livestock to monitor their health and nutrition properly which would keep the disease from spreading on a farm. Also, this could skyrocket research and innovation. With the establishment of the Directorate of Science and Technology (DSTI) in Sierra Leone, which works with the Government and provides data for decision-making, these could be done at an accelerated rate. It would also help young innovators across the country.</p><p>As the President of the Republic affirmed that Science and technology are the bedrock of the development of any modern economy, 5g is the latest technological innovation that Sierra Leone<br>could use to propel the nation’s development.</p><p><strong><em>If you like this article, please leave an applause or more, and follow me for more!</em></strong></p><p><strong><em>If you have suggestions to improve the article or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a><strong><em> or </em></strong><a href="https://twitter.com/Rahim202k"><strong><em>Twitter</em></strong></a></p><p><strong><em>Check out my previous articles:</em></strong></p><ul><li><a href="https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a></li><li><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></li><li><a href="https://medium.com/@jallohx86/a-great-comprehensive-guide-to-classification-in-machine-learning-96ba79ebd986">A Great Comprehensive Guide to Classification in Machine Learning</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8a524b4679e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Web Scraping Easily by Actually Scraping Cute Cat Images]]></title>
            <link>https://medium.com/@jallohx86/learn-web-scraping-easily-by-actually-scraping-cute-cat-images-bf6a447cfcc4?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf6a447cfcc4</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 09:16:10 GMT</pubDate>
            <atom:updated>2023-09-02T09:16:10.683Z</atom:updated>
            <content:encoded><![CDATA[<p>At the end of this article, we will be able to scrape cat images on Pinterest. Before diving further, it is obvious that we should clearly define what is web scraping and try to understand it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bf1LCAQDlzc1ZTpx" /><figcaption>Photo by <a href="https://unsplash.com/@muzaluiza?utm_source=medium&amp;utm_medium=referral">Luiza Sayfullina</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As simple as possible, web scraping is the automatic extraction of data from websites. This data can be in various forms such as plain text or image form. Why scrape data that you can manually extract? Long answer short, you would not be so pleased trying to manually extract a very huge text, or downloading thousands of images manually would you?</p><p>A technical individual can say that currently, information that one might need from a website can be accessed by means of an API. This is in part correct but is not entirely the case. One might need information that is not available through an API. That is if an API is even available for the website. For our task at hand, we will be scraping cat images from Pinterest. This will be done using various Python libraries</p><h3>Excited yet?</h3><p>Before diving into the code, please ensure you have these modules installed. You Can also access the full code <a href="https://colab.research.google.com/drive/1CGULTHp6EFCa07E0QyOpu_0QEZwRCz34?usp=sharing">HERE</a></p><ol><li><a href="https://pypi.org/project/urllib3/">urllib</a></li><li><a href="https://pypi.org/project/beautifulsoup4/">BeautifulSoup</a></li><li>requests</li></ol><p>Let us also understand the libraries in short concise sentences</p><p><strong>Understanding the Libraries</strong></p><p><strong>urllib</strong> — This is a Python module that enables us to work with urls simply. This provides us various functions which can be used to open URLs, get the content of a webpage, get specific parts of a full URL, etc. eg urllib.request, .parse, .error.</p><p><strong>Beautiful Soup</strong> — This is another useful library that is used for the extraction of data from HTML &amp; XML files. It gives parse trees which help to extract the data easily. Parse trees basically represent the basic structure and form in which the HTML file is written in.</p><p><strong>requests</strong>— This is a Python library commonly used for making HTTP requests. It simplifies the process of sending HTTP GET, POST, and other types of requests to web servers. With Requests, you can easily retrieve web data, interact with APIs, and more.</p><p>Let us start by importing the various libraries. We will also be using urlopen from urllib.request</p><pre>from bs4 import BeautifulSoup <br>from urllib.request import urlopen <br>import requests<br>import os</pre><p>We will be scraping the cat images from unsplash.com</p><p>You can check out the images in the link.</p><p><a href="https://unsplash.com/s/photos/hosuse-cat">Hosuse Cat Pictures | Download Free Images on Unsplash</a></p><p>Let us use set the URL above to a “url” variable</p><pre>url = &quot;https://unsplash.com/s/photos/house-cat&quot;</pre><p>Also, let us use the <em>urlopen()</em> future to establish a connection to the URL above, read its content, and store it in the html variable.</p><pre>html = urlopen(url)</pre><p>We will need to analyze the HTML that will be returned from above, hence “parse” it. We will be using the BeautifulSoup() function from bs4 for that. The BeautifulSoup function takes in two parameters. One is the html that we viewed from the above, and the other is the parser. Hence, we create the beautiful soup object below</p><pre>soupObj = BeautifulSoup(html, &quot;html.parser&quot;)</pre><p>Now, we have stored the entire html representation of the page which contains the cat images and we can easily use the html tags to access.</p><p>From the soupObj, we can find all heading tags (h1), heading 2 tags (h2), links, and even attributes by using our tags.</p><p>Beautiful Soup is an extensive library with various functionalities which you can check out <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/">here</a>. For this tutorial, we will be using its <em>findall</em> function.</p><p>The <em>find</em> function in Beautiful Soup returns only the first occurrence, the <em>findall</em> function returns all the possible occurrences of a particular search. For example, if we have several <em>a </em>tags, find returns only the first while <em>findall</em> returns all <em>a</em> tags on a particular page. The <em>findall</em> function takes in the following arguments <em>findAll(tag, attribute, recursive, text, limit, keywords)</em></p><p>For our purposes, let us explain the first two. The tag specifies the type of tags that we want to target, whether<em> a, img,</em> or <em>h,</em> etc</p><p>The attributes section should have a dictionary that has key values of the targetted attribute, and the value of what is captured there. Eg, we might have a tag</p><pre>&lt;h1 class=&quot;red&quot;&gt; This is a Header &lt;/h1&gt; <br></pre><p>To get this particular type of elements, we can use the tag and attributes</p><pre>.findall(h1, {&quot;class&quot;: &quot;red&quot;})</pre><p>To understand how to locate the specific images we are dealing with, we need to inspect the images to find something that they have in common.</p><p>If we want to inspect an image, hover with your mouse to the top, then right click and you will see inspect. Inspect the image, and you will see something shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIs2cjD93BP3P1aE5gp5qQ.png" /></figure><p>from the above, we see that within the <em>img</em> tag, there exists an attribute name src. This should be where the image is hosted. We have a class which is named “JObFE tB6UZ a5VGX”. If we inspect other cat images on the web page, we will see that they have the same class name as the above. With this, we can use it as a determinant to scrape all the cat images on the page.</p><p>Hence, we need to findall the objects which have that particular class.</p><pre>image_tags = soupObj.find_all(&#39;img&#39;, class_=&#39;JObFE tB6UZ a5VGX&#39;)</pre><p>Also, we see that there are other images on the web page, but the images we need which are the cat images mainly are external links. The above will give us a beautiful soup result set of all the image tags and their attributes found in the document. If we want to extract the specific link where they are stored, we should look in the src.</p><pre>image_links = [image_tag[&#39;src&#39;] for image_tag in image_tags if image_tag]</pre><p>Let us breakdown the above code shortly. We already have all of the img elements stored in a list like the one illustrated above. Using a for loop, we iterate through each of those image tags, then extract the src from them by using image_tage[‘src’]. So, according to our list comprehension, if there is an image tag in the list, iterate through each of them, then extract the src attributes and store them in image_links.</p><p>if you print the list above, it should give you the following.</p><pre>[&#39;https://media.istockphoto.com/id/1498838344/photo/grumpy-persian-waiting-on-food.webp?b=1&amp;s=170667a&amp;w=0&amp;k=20&amp;c=LjAK_5FedDnEnip4MwdaV32Jbp9aNix0VRk2Lb4uaag=&#39;,<br> &#39;https://media.istockphoto.com/id/1413985191/photo/bengal-cat-looking-up-isolated-on-white.webp?b=1&amp;s=170667a&amp;w=0&amp;k=20&amp;c=ALBZdi9lmDFiAuZjoZkT4EMEuRlRVe2_8KjtpepyF5s=&#39;,<br> &#39;https://media.istockphoto.com/id/1366990539/photo/a-cute-domestic-tabby-kitten-with-a-white-chest-looks-sadly-at-the-camera.webp?b=1&amp;s=170667a&amp;w=0&amp;k=20&amp;c=PHLznYfsbNcIV-jCbN6pRyvoxB3-SF2Sju3SItkhn1o=&#39;,<br> ........]</pre><p>Now, we have several image_links stored in our image_links list. We need to download all of them to our local directory.</p><p>Let us write the download_image function to achieve this task.</p><pre>def download_image(image_urls, download_directory):<br>    <br>    try:<br>        <br>        os.makedirs(download_directory, exist_ok=True)<br>        for index, url in enumerate(image_urls, start=1): <br>            response = requests.get(url)<br>        <br>            file = f&#39;Cat_{index}.jpg&#39;<br>            filename = os.path.join(download_directory, file)<br>            <br>            if response.status_code == 200:<br>                with open(filename, &#39;wb&#39;) as file:<br>                    file.write(response.content)<br>                print(f&quot;Image downloaded successfully: {filename}&quot;)<br>            else:<br>                print(f&quot;Failed to download image. Status code: {response.status_code}&quot;)<br>                <br>    except requests.RequestException as e:<br>        print(f&quot;Error downloading image: {e}&quot;)<br>        <br>    except Exception as e:<br>        print(f&quot;An unexpected error occurred: {e}&quot;)</pre><p>The function above takes in two arguments. It takes in the image urls which is a list, and a download directory where the images should be downloaded to.</p><p>We then have a try and except block which provides error handling functionality, so that in the case there is an error, the Except Block will gracefully handle it for us instead of everything crashing. We have two different exceptions. One if when there is an error downloading the image, and the other is when we do not know what the error is.</p><p>In our try block, we create our directory where the files are going to be stored into.</p><p>We then iterate through the list using the enumerate function. The reason for using the enumerate function is so that we can get the index of each link which will be used to append to the end of each image. eg. Cat_1, Cat_2, Cat_3 etc. Start=1 is used because indexes in Python start at 0 and we need to tell the function that we need it to start at 1. The request library is used to fetch the images from where they are stored by sending in an HTTP get request.</p><p>A status code checker is also added to the function. If the status code is equal to 200, it shows that the download was successful.</p><p>Let us call the function that we have written and test our work.</p><pre>download_directory = &quot;C:\\Users\\UserName\\Downloads\\Scraping\\images_1&quot;<br><br>download_image(image_links, download_directory)</pre><p>Replace the ‘UserName’ with the actual username on your device. Run the above and see what it will give you.</p><p>If you made it this far, Congratulations!</p><p>Check out the full code <a href="https://colab.research.google.com/drive/1CGULTHp6EFCa07E0QyOpu_0QEZwRCz34?usp=sharing">HERE</a></p><p>You have just completed scraping images from the internet. There are several adjustments and improvements to be made to this. As a challenge, make some on your own. Also, as practice, you can try to scrape other types of images. More on web scraping in the future! Till then, happy coding :)</p><p><strong><em>If you like this article, please leave an applause or more, and follow me for more!</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a><strong><em> or </em></strong><a href="https://twitter.com/Rahim202k"><strong><em>twitter</em></strong></a></p><p><strong><em>Check out my previous articles:</em></strong></p><ul><li><a href="https://blog.gopenai.com/overcome-overfitting-maximize-predictions-explore-easy-to-understand-regularization-4ed9531f1a32">Overcome Overfitting, Maximize Predictions: Explore Easy To Understand Regularization</a></li><li><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></li><li><a href="https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf6a447cfcc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overcome Overfitting, Maximize Predictions: Explore Easy To Understand Regularization]]></title>
            <link>https://blog.gopenai.com/overcome-overfitting-maximize-predictions-explore-easy-to-understand-regularization-4ed9531f1a32?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ed9531f1a32</guid>
            <category><![CDATA[overfitting]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[regularization]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 11:02:50 GMT</pubDate>
            <atom:updated>2023-06-27T15:59:43.044Z</atom:updated>
            <content:encoded><![CDATA[<p>When models perform very well on the training data it is being fed but fail to generalize to unseen data, this is one of the characteristics that the model has overfit the training data. One very good way to avoid overfitting is by constraining some of the models’ parameters by means of regularization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-6EouYzNF84AYKQL" /><figcaption>Photo by <a href="https://unsplash.com/@m_____me?utm_source=medium&amp;utm_medium=referral">m.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Regularization in models occurs by adding a penalty to the cost function.</p><p>Different Regression types provide different ways to constrain the weight of these models. We have Ridge Regression, Lasso Regression, and Elastic Net. But, before moving forward with these regression types of the penalty added, let us understand two types of norms.</p><p><strong>The <em>l2</em> and <em>l1</em> norm</strong></p><p>Generally, norms are used to calculate the distance between two vectors. These are usually used to calculate errors. This is done by calculating the distance between the vector of <em>actual values</em> and the vector of the <em>predicted values.</em></p><p>The <em>l2</em> norm which is also known as the Euclidean norm calculates the distance between the two vectors by drawing a line directly from one point to the other. The distance of this line determines the error in calculation.</p><p>In its simple form, the known Pythagorean formula can be used to calculate this norm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/203/1*DzusA3mxH3SbSvMFeUzDOw.png" /><figcaption>image credit: <a href="https://builtin.com/data-science/vector-norms">Built In DS</a></figcaption></figure><p>The l1 or Manhattan distance is used to calculate the distance between two vectors by taking the sum of the absolute sum of the elements.</p><p>To understand this, let us take it from the name. Imagine a place in Manhattan. To reach a certain point, we need to move in the form of a grid and cannot move in the form of a straight diagonal line due to buildings between. Hence, we need to move in vertical and horizontal distances within the grid. We will explore more of the norms in depth later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/203/1*NIX8Cw9TzWaZfL6yXfITew.png" /></figure><p>Now that we have understand that, let us understand the penalities that are added and the models.</p><h3>Ridge Regression</h3><p>In ridge regression, we have a penalty of half the square of the l2 norm being added to the cost function which is the mean squared error. The penalty added to the cost function ensures that the weights of the parameters are as small as possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*4n_1HcSUslWhvBSvH0kKrQ.png" /><figcaption>Image Credit: <a href="https://www.amazon.com/Hands-Machine-Learning-Scikit-Learn-TensorFlow-dp-1098125975/dp/1098125975/ref=dp_ob_title_bk">Hands On ML — Aurelion Geron</a></figcaption></figure><p>alpha controls the amount of regularization that should be applied to the model. This is usually considered in the form of intervals such as 0.001, 0.01, 1, 10, 100, etc. If alpha equals 0, we have a normal regression model. If we have a very large value of alpha, then all the weights end up very close to zero, and we have a flat line that passes through the mean of the data.</p><p>let us apply the below with a randomly generated dataset with a single parameter to get an understanding of how to implement this.</p><p>X denotes our feature vector, and we are generating a single feature with values from -10 to 20. y denotes the label or the target values and is of the equation y = 1 + 0.5X which gives a linear equation. We added some noise to the labels as shown.</p><pre>import numpy as np<br>from matplotlib import pyplot as plt<br><br>np.random.seed(42)<br><br>m = 20 <br><br>X = 30 * np.random.rand(m, 1) - 10 # creates random X values from -10 to 20<br><br>random_noise = np.random.randn(m, 1) / 0.5 # where 0.5 is the scale factor<br>y = 1 + 0.5 * X + random_noise<br><br></pre><p>from the below, alpha can be adjusted which shows the regularization. You can play around with it noting the changes. random_state ensures we have the same result on rerun without which the values will be changing due to the randomness of the data. We can use other solvers such as Stochastic Average Gradient (sag), Single value decomposition (svd), etc.</p><pre>from sklearn.linear_model import Ridge, LinearRegression<br>from sklearn.metrics import mean_squared_error<br><br>ridge_model = Ridge(alpha=1, solver=&quot;cholesky&quot;, random_state=42)<br>ridge_model.fit(X, y)<br><br>ridge_model.coef_, ridge_model.intercept_<br><br>## outputs below<br># (array([[0.46527694]]), array([0.58392585]))<br><br>ridge_model.predict([[50]])<br># outputs 23.84777305<br><br># The ideal value for the above is gotten from the equation y = 1 + 0.5x<br># hence y = 1 + 0.5(50) = 26<br></pre><p>from the above, the ridge model estimated the weight of the coefficient to be 0.47 which is close to the 0.5 original value. The predicted intercept is 0.58 and predicted value is approx. 23.85</p><p>Try playing around with the regularization term alpha and see what you can find on your own.</p><p>Manually adjusting the alpha value will not be the most ideal situation. To help pick the best alpha, we can employ grid search in trying to achieve what we want. The code below tests for various values of alpha.</p><pre>from sklearn.model_selection import GridSearchCV<br><br># Set up the model and grid search<br>model = Ridge()<br>parameters = {&#39;alpha&#39;: [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]}<br>ridge = GridSearchCV(model, parameters, cv=5)<br><br><br>ridge.fit(X, y)<br><br># Outputthe best alpha<br>print(f&quot;Best alpha: {ridge.best_params_}&quot;)<br><br># Try out prediction yourself using this model<br># Hint: use ridge.predict()</pre><h4>LASSO REGRESSION</h4><p>Contrary to Ridge Regression, lasso regression adds a penalty that employs the use of the l1 or Manhattan norm to the weight vector. The l1 norm produces a sparse solution drawing most of the model weights down to zero. Unimportant feature values are forced down to 0 hence, tends to eliminate the weight of the least important features. Hence, it tries to neglect features that are not useful and performs automatic feature selection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*zebEB4vzgLAjrC4WsbW6Kg.png" /><figcaption>Image Credit: <a href="https://www.amazon.com/Hands-Machine-Learning-Scikit-Learn-TensorFlow-dp-1098125975/dp/1098125975/ref=dp_ob_title_bk">Hands On ML — Aurelion Geron</a></figcaption></figure><p>Lasso regression can be implemented as below with grid search for getting the best value of alpha as</p><p>To implement Lasso on it’s own, we can do the following.</p><pre>from sklearn.linear_model import Lasso<br><br>lasso_model = Lasso(alpha=10, random_state=42)<br>lasso_model.fit(X, y)<br><br>lasso_model.coef_, lasso_model.intercept_</pre><p>But let us compare the performance of lasso regression as opposed to Ridge regression by adding a non-useful feature to the feature vector X below.</p><pre># generate non-useful feature <br>non_useful_feature = 100 * np.random.rand(m, 1) - 50 # random numbers between -50 and 50<br><br><br># Add the non_useful_feature as a column in the new feature vector X_new <br># by horizontally stacking the previous feature vector X with the non_useful features<br><br>X_new = np.hstack([X, non_useful_feature])<br><br>X_new</pre><p>Perform grid search for the Ridge Model on new feature vector X_new with the label y remaining the same</p><pre>from sklearn.model_selection import GridSearchCV<br><br># Set up the model and grid search<br>model = Ridge()<br>parameters = {&#39;alpha&#39;: [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]}<br>ridge_m = GridSearchCV(model, parameters, cv=5)<br><br><br>ridge_m.fit(X_new, y)<br><br># Outpits the best alpha<br>print(f&quot;Best alpha: {ridge_m.best_params_}&quot;) </pre><p>Perform grid search for the Lasso Model on new feature vector X with the label y remaining the same</p><pre><br>model = Lasso()<br>parameters = {&#39;alpha&#39;: [0.0001, 0.001, 0.01, 0.1, 1, 10, 100]}<br>lasso_m = GridSearchCV(model, parameters, cv=5)<br><br><br>lasso_m.fit(X_new, y)<br><br># Outputs the best alpha<br>print(f&quot;Best alpha: {lasso_m.best_params_}&quot;)</pre><p>let us run prediction using both of the models above.</p><p>For Ridge</p><pre>print(f&quot;Prediction for Ridge: {ridge_m.predict([[250, 50]])}&quot;) <br># outputs - Prediction for Ridge: [[122.27607691]]</pre><p>For Lasso</p><pre>print(f&quot;Prediction for Lasso: {lasso_m.predict([[250, 50]])}&quot;)<br>#outputs - Prediction for Lasso: [122.69694706]</pre><p>From the above, we see that if we have a non-useful feature in the dataset, Lasso generally performs better than ridge regression.</p><h4>Elastic Net</h4><p>Elastic Net is a combination of Ridge and Lasso and tends to act as a middle ground for the two. It acts as linearly combining both the penalties for the l1 and l2 norm. When r is exactly 1, we have the Cost function equal to that of the Lasso regressions. When r is exactly 0, we have the cost function equal to that of ridge regression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*iOWhUVBEDNA41WEvJ4EaBA.png" /><figcaption>Image Credit: <a href="https://www.amazon.com/Hands-Machine-Learning-Scikit-Learn-TensorFlow-dp-1098125975/dp/1098125975/ref=dp_ob_title_bk">Hands On ML — Aurelion Geron</a></figcaption></figure><p>Let us implement an elastic net below!</p><pre>elastic_model = ElasticNet()<br><br># Define the parameter grid<br>param_grid = {<br>    &#39;alpha&#39;: [0.0001, 0.001, 0.01, 0.1, 1, 10, 100],<br>    &#39;l1_ratio&#39;: [0.1, 0.2, 0.3,0.4,0.5,0.6, 0.7, 0.8, 0.9]<br>}<br><br><br>elastic_grid = GridSearchCV(elastic_model, param_grid, cv=5)<br><br><br>elastic_grid.fit(X_new, y)<br>elastic_grid.best_estimator_</pre><pre>elastic_grid.predict([[250, 50]]) <br># outputs 120.34651985</pre><h4>When to use What?</h4><p>If you take a look at the predictions above, you might have noticed that ElasticNet performs seemingly worse than the two above, altho that can be up to cross validation to decide. So, how do you decide when to use which type of regularization or if ever?</p><p>In general, it is not advisable to use a LinearRegression model without regularization. Ridge performs better when Ridge when you know when most of your features are important. Use Lasso or Elastic Net when you have a few important features. Lasso should be avoided if we have several correlated features. ElasticNet is generally preferred when we have a large number of features. In the ElasticNet result above, we have a very low number of features, hence we see Elastic Net not performing well.</p><p>To conclude, Ridge, Lasso, and Elastic Net are robust regularization techniques for handling overfitting and improving model generalization. Regardless of the use cases highlighted above, it should be known that there&#39;s no universal best choice - the selection depends on your problem&#39;s context and dataset. This is why it is advisable to test and compare results.In contrary to the comparison per instance we did above, the best way to compare regression models is to look at the error. We can take either the mean squared error or the root mean squared error of each model and compare the values. Tools like cross-validation or grid search can assist in choosing the best model and hyper parameters. Remember, the goal is to build models that generalize well to new data, and regularization, paired with a good understanding of your data and a systematic model selection approach, will aid in achieving this.</p><p><strong><em>If you like this article, please leave an applause or more, and follow me for more!</em></strong></p><p><strong><em>I write to understand more.</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a><strong><em> or </em></strong><a href="https://twitter.com/Rahim202k"><strong><em>twitter</em></strong></a></p><p><strong><em>Check out my previous articles:</em></strong></p><ul><li><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></li><li><a href="https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ed9531f1a32" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/overcome-overfitting-maximize-predictions-explore-easy-to-understand-regularization-4ed9531f1a32">Overcome Overfitting, Maximize Predictions: Explore Easy To Understand Regularization</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Great Comprehensive Guide to Classification in Machine Learning]]></title>
            <link>https://medium.com/@jallohx86/a-great-comprehensive-guide-to-classification-in-machine-learning-96ba79ebd986?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/96ba79ebd986</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Mon, 05 Jun 2023 08:01:20 GMT</pubDate>
            <atom:updated>2023-06-05T10:42:20.435Z</atom:updated>
            <content:encoded><![CDATA[<p>Can you perfectly tell the two letters in the image below?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ufWBPyKPiSMteLUI" /><figcaption>Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=medium&amp;utm_medium=referral">Hitesh Choudhary</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you say A and I for the letters in the image above and are comfortably reading this, chances are you probably are very good at telling the differences between letters. It also means you can simply differentiate between a 6 and an 8. For a computer, it is not always as straightforward. Computers will go through a process to place a particular letter, number, or object in a group or class.</p><p>The process of computers placing a name or labels on a particular data be it an image or anything else, is known as classification.</p><p>For a more ML definition, we can say <em>classification is a type of supervised learning that involves assigning labels or classes to input data based on their input attributes</em>. If we want to show a computer an image of the number 5, and we want it to tell us what exactly is that shape, it tries to classify the image based on several features which include the number of pixels.</p><h3>Different types of classification</h3><p>There are various types of classification. These are based on how many different classes should be predicted and the number of labels that should be given for input, and how many classes are available for prediction</p><h3><strong>1. BINARY CLASSIFICATION</strong></h3><p>The word binary essentially means two. This type of classification deals with whether an image is a particular class or not. For example, if you show me the number 6, I should tell you clearly if it is a 6 or not 6. In this case, it is not a 6. In Binary classification, we just have to prove or determine if an input is positive or negative to a specific class (It is or is not). Various models are used to train Binary Classifiers such as SGD Classifiers, Random Forests Classifiers, Naive Bayes Classifiers, Logistic Regression, Support Vector Machines (SVMs), etc.</p><p>Note, some of the models above such as Logistic Regression and SVMs are strictly binary classifiers, tho they can be tweaked to perform other types of classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*p91pMePNuf_LYO5DsDv3sQ.png" /><figcaption>Credit: Binary Classification <a href="https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html">Mathworks Deep learning</a></figcaption></figure><h3><strong>2. MULTICLASS CLASSIFICATION</strong></h3><p>Previously, we dealt with Binary Classification, which determines whether an input belongs to a particular class. While Binary deals with determining a positive or negative for a single class, Multi deals with more than one class.</p><p>To understand the differences, let us look at it this way.</p><p>If we develop a classifier and name it the “SixClassifier” this takes in inputs and tries to determine if the input is the number six in which case it will give a positive output, and if it is not a 6 and say the number is 7 or 8, it will give a negative output. This is a Binary Classification and the SixClassifier Built is a Binary Classifier that is limited to finding 6 or not 6.</p><p>For a Multiclass Classifier, we can look at it from the angle of the classifier not being limited to determining if a number is only a 6 or not, but rather, it can find its actual class. We can build a multiclassifier which will tell us if a number is either 0, 1, 2, 3, etc.</p><p>Say we have an animal-type classifier. If we develop a multi-classifier, it can look at an image of an animal, and the classifier can actually pinpoint the specific type of animal it is whether it is a cat or a dog, a mouse, a lion, etc depending on the training data used. a Binary classifier can only tell us for example if it is a cat or not a cat while multiclass tells us for different types of animals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*BdYvZg4wAFMxmcTP69YJAw.png" /><figcaption>source: Classification <a href="https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html">Mathswork Deep Learning</a></figcaption></figure><h3><strong>3. MULTILABEL CLASSIFICATION</strong></h3><p>From our now-known pattern in trying to interpret from the name, you will, of course, say multilabel is a type of classifier that gives multiple labels to an input. Yes, of course, you will be correct in saying that. To understand it, let us picture an input image of a bird that is flying. We can call this image of the bird a single instance. In multiclass classification, we can only have a single label (If it is a cat, dog, etc ) for a single instance. It does not give us more than one label to instance. What if we want to know the breed of dog, or whether the dog is sitting or standing? or other things in the input image like the plant below? Those require more than one label per instance. That is where multilabel classification comes in. It allows us to give<em> multiple labels simultaneously to an instance rather than giving a single label</em>. In Multilabel, this deals with assigning binary labels to the instances.</p><p>It is like us having multiple binary classifiers for a single picture. If we look at the picture below, multilabel tells us if a dog is present or not — which it is. Or if a plant is present or not — which it also is. It does this with high confidence levels of .8 and .7 respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*fTDiC26H1rO_7ISAZLMTOQ.png" /></figure><h3><strong>4. MULTIOUTPUT CLASSIFICATION</strong></h3><p>This is also known as Multioutput-Multiclass Classification. This is usually referred to as a generalization of Multiclass classification where we have multiple labels that can belong to multiple classes. Here, we can predict multiple labels which can belong to not one, but multiple classes. In Multilabel classification, the individual labels are predicted in binary form or in the form of using a binary classifier. Multioutput is not limited to Binary classification but employs multiclass for each label. As Aurelion Geron rightly said, we can say that the main difference between multilabel and multioutput is that “multilabel classification involves predicting multiple labels for a single input, while multioutput classification involves predicting multiple output variables, each of which may have a different interpretation or meaning.” Multioutput classification often blurs the line between regression and classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*36Ec5jV0l37ulHhgm4Ij-w.jpeg" /><figcaption>Credits — <a href="https://www.123rf.com/photo_94186634_iot-machine-learning-with-human-and-object-recognition-which-use-artificial-intelligence-to-measurem.html">Object Recognition</a></figcaption></figure><h3><strong>Brief Intro. to Performance Measures Used in Classifiers</strong></h3><p>In this article, we would not be diving deep into performance measures, but let us understand some of the most basic concepts as to how performance is measured in classifiers. This on its own is a whole topic that we will be discussing later. Before that, let us understand that when a model is built, it is primarily tested to see how well it performs or generalizes to new instances (how well it performs to examples that it has never seen). For regression, we basically try to determine the accuracy of the model using performance measures such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), etc. For classifiers, this should not be used.</p><p>Say we build a classifier that determines if a number is 6 or not in a dataset. If we have a skewed dataset where only 10 percent of these images are not 6. This means that, due to the high rate of 6 present, there is a very high chance that the classifier can guess that a number is 6 and will be right 90% of the time, hence a very high accuracy. This is one of the reasons that accuracy is not a perfect measure for determining how well a classifier performs.</p><p>In determining how well a model performs, we can use the following.</p><p>The Confusion Matrix, Receiver Operating Characteristics Curve (ROC Curve), etc. All of these will be dived into in a later article.</p><p>In conclusion, understanding classification is a very important part of machine learning. The basics of which go into very complex tasks which involve image classification, fraud detection, and medical diagnosis.</p><p><strong><em>If you like this article, follow me for more!</em></strong></p><p><strong><em>I write to understand more about what I learn</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a></p><p><strong><em>Check out my previous article:</em></strong></p><ul><li><a href="https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a></li><li><a href="https://blog.gopenai.com/bigger-isnt-always-better-how-efficiency-can-make-a-big-difference-for-beginner-programmers-f8652ef2dc7b">Bigger Isn’t Always Better in Programming: Be Efficient</a></li><li><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></li><li><a href="https://medium.com/@jallohx86/overview-of-data-science-workflow-and-roles-697a69daec54">OVERVIEW OF DATA SCIENCE WORKFLOW AND ROLES</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ba79ebd986" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bigger Isn’t Always Better in Programming: Be Efficient]]></title>
            <link>https://blog.gopenai.com/bigger-isnt-always-better-how-efficiency-can-make-a-big-difference-for-beginner-programmers-f8652ef2dc7b?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8652ef2dc7b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 17:40:12 GMT</pubDate>
            <atom:updated>2023-03-19T17:53:51.712Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first discovered the world of computer programming, my search history was filled with; “How many lines of code did it take to build google”, “How many lines of code did it take to build Facebook” etc. Sounds Familiar?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bVXpgT02gPG5J1sc" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Well, a lot of beginners are curious about this question, thinking it is about the number of lines you write. This usually brings into context the first assumption beginners usually make which is the more lines of code one writes, the better it is.</p><pre>def my_sum(vals):<br>    result = 0<br>    for element in vals:<br>        result += element<br>    return result</pre><p>Is the code above familiar? We will come later to it.</p><p>Early after I wrote my first hello world, I pride myself in writing “hardcore” code — this was my way of saying I solved coding challenges from first principles. I cared little about things like execution speed.</p><p>I enjoyed my first hacker rank questions as everyone did theirs. Sometimes after doing this, I will look at the “better” answers provided and be like “mine worked, so no big deal to it”.</p><p>This was something I gradually learned was bad and that one needs to actually write better code. I will say after that, some things changed a bit.</p><p>My point here is, one should be aware of writing efficient code from the early onset of learning. It is not about the number of lines of code you write, but what the code does and how efficiently it does what is expected.</p><p>Let me share a recent story. I started doing my first internship as a Data Science Intern early this year. My first task was to clean a dataset — sighs. I am not going to lie, I am one of those that enjoy the pain that comes with cleaning data. After that, the next task was to perform Exploratory Data Analysis (EDA) on it. Then came the day I had to submit my result and do a code review. A Data Scientist in my team looked at the code and said “Ahh, so you love writing lines of code right ?”.</p><p>Immediately, I think it occurred to me what are the issues. It is one of those old habits again which is implementing functions from scratch. He replaced several lines of code with about three different lines which incorporated some pandas functions. No !, I am not going to shame myself and show that particular code. Upon replacement, the execution time on the dataset was faster and the code was more readable and cleaner. This actually made me revisit something I forgot a while back. That is if you need to perform a certain task, try to look up the documentation if there is a function for it. In most cases, there is. Do not go around implementing pre-available functions from scratch in a very inefficient manner.</p><p>Now to the code above. The function performs the same thing as the sum function in python. It will sometimes look as if there is no difference in execution time. That said, lets us open a notebook and inspect these differences.</p><p>If we execute our hardcore written function in a new cell from the above, we have</p><pre>%timeit my_sum(a)<br><br># gives the result below <br># 346 ns ± 9.97 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)</pre><pre>%timeit sum(a)<br><br># gives the result <br># 141 ns ± 2.55 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)</pre><p>Can you clearly see the difference in execution time?</p><p>The above is just a basic example. There are several examples one can highlight. This is why people study algorithms and try every day to find a way to maximize the efficiency of these algorithms in every field including Machine learning.</p><p>A faster runtime is why we can comfortably sit and query google and it will efficiently filter millions or billions of results in trying to find what we ask for. That is why over a million people can query our GPT friend and it will spit out results efficiently. Efficiency is what makes programming. Next time you ask, try to ask how efficient is the code rather, than how many lines of code a particular developer has written.</p><p>Always remember, Simple is better than complex!</p><p><strong><em>If you like this article, follow me for more!</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a></p><p><strong><em>Check out my previous article:</em></strong></p><ul><li><a href="https://medium.com/@jallohx86/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a></li><li><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8652ef2dc7b" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/bigger-isnt-always-better-how-efficiency-can-make-a-big-difference-for-beginner-programmers-f8652ef2dc7b">Bigger Isn’t Always Better in Programming: Be Efficient</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[15 Valuable Machine Learning Terms You Need To Know Today]]></title>
            <link>https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/7853418d4b31</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Wed, 08 Mar 2023 17:14:20 GMT</pubDate>
            <atom:updated>2023-03-16T20:10:18.798Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the jargon before you get lost in the sea of ML terms</p><p>The world is shifting towards AI. Many witnessed the computer revolution and how these machines integrated into our everyday lives. It will be us fooling ourselves if we think that AI will not be directly integrated into our everyday work. Shocker, Shocker; The revolution has already started. I will most likely sound funny if I ask about your awareness of the new smart kid around with a name ending in GPT. Yeah, there will be more where that came from! One can say the development of these systems is as complex as they get. Regardless, it will be of great importance to know some of the most used terms when they are being built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*91KyGvYxrTp6Ktln" /><figcaption>Photo by <a href="https://unsplash.com/@emilianovittoriosi?utm_source=medium&amp;utm_medium=referral">Emiliano Vittoriosi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li><strong>Dataset </strong>— A Dataset is a file that contains data or several records collected for a specific purpose. For example, we can have a dataset for educational institutions in a country. This dataset contains the record for these institutions. These records can be the name of the institution, the location, the number of students, and much more. Datasets are not limited to text only but several others. We can also have a dataset for images of animals such as dogs, cats, etc.</li></ol><p><strong>2. Model</strong> — This is an interesting one. A model is simply a mathematical representation of a system that is used to make predictions. A model can range from a simple linear model to very complex systems. Aurelion Geron who led the Youtube Classification team rightly stated how confusing this term can be. He stated that “ the same word ‘model’ can refer to a type of model (e.g., Linear Regression), to a fully specified model architecture (e.g., Linear Regression with one input and one output), or to the final trained model ready to be used for predictions”.</p><p><strong>3. Training Set</strong> — The training set is part of the overall dataset that the model is trained on before being tested. This usually constitutes 70–80% of the total dataset with some exceptions when the data is extremely large. The main reason we have a training set is to teach the model how to make accurate predictions. It functions as the “notes” that the model uses to study to know how to perform or predict several tasks.</p><p><strong>4. Training Instance</strong> — Assuming we have 100,000 rows in a training set. A single row in that training set is what is referred to as a training instance. Training Instances consist of Features and Labels</p><p><strong>5. Test Set — </strong>A test set is also part of the dataset that is used for testing the model that have being developed using the training set. The test set usually forms 20–30 % of the data set. This percentage is also not constant as it can change with the amount of data we have. Care should be taken to let no part of the test set be leaked when training. This will risk the model <em>overfitting ( see 10).</em></p><p>6. <strong>Attributes &amp; Features —</strong> Features and attributes are words that most see as synonymous. An attribute is a data type of the dataset. An example is “height”, “color”, and “age”. Generally, features refer to an attribute plus its value. Example: Color=black, age=98, height=4&#39;5&quot;. Please note that these two words are mostly used interchangeably.</p><p>7. <strong>Labels</strong> — Labels are the desired output or target variable that we are building the system to achieve. An example is if one is trying to predict the price of a particular item. The price of the item is what is referred to as a label.</p><p><strong>8. Data Pipeline — </strong>A Data pipeline is a series of data processing components. This makes it easier to collect, process and transform from one or more sources and deposit it into a bucket. Say, for example, we have a predefined function that collects data from a database or flat flies, then they are run through a specified cleaning function. This is a simple example of a Data Pipeline.</p><p>9. <strong>Underfitting </strong>— Underfitting of a Model occurs when the model is too simple in comparison to the amount of data that is fed into the system for training. We say simple because it is not complex enough to capture underlying patterns in the dataset. To address this, we can simply change the model used from a simple model to a more complex one.</p><p>10. <strong>Overfitting</strong> — Overfitting occurring in a model means that a model has performed well on the training data, but it does not generalize well. This basically means that it performs badly when given new examples that it has not seen before in the training set. This usually happens if the model is too complex relative to the amount of data. A common solution is collecting more data, or reducing the complexity of the model.</p><p>11. <strong>Regularization</strong> — Regularization is a technique that is often done to reduce the risk of a model overfitting. This is done by adding constraints to a model to make it simpler. Regularization when done right will greatly improve the generalization of models.</p><p><strong>12. Hyperparameters</strong> — These usually control the amount of regularization to apply during learning to prevent overfitting of the model. These are parameters of a training model which are usually set before training. They are essentially different from model parameters. Increasing the regularization hyperparameter to a very large value will almost always guarantee not overfitting, but you will not get a very good solution. Please note that this will result in a flat model with a gradient equal to 0.</p><p>13. <strong>Feature Engineering</strong> — Feature Engineering is the art of taking raw data, and extracting useful features from it to train the system on. This involves selecting the most useful features from the dataset — Feature selection, combining different existing features to produce a more useful one, etc. An example for the second part is we can have said the number of hospitals in 10 different cities, and the population of those cities. The number of hospitals and the population on their own cannot tell us much if we are trying to know access to hospital facilities. But, if we combine the two and have the no of hospitals per 100000 people, this can give more insights.</p><p>14. <strong>Batch Learning </strong>— In Batch Learning systems, the training has to be done all at once. Models cannot be trained incrementally. The training data is divided into batches and fed into the model one batch at a time. Batch Learning does not allow the model to adapt to new data. If one has new data and wants to train a system on it, we have to retrain the whole system again taking into consideration old and new data.</p><p>15. <strong>Online Learning </strong>— This is when a system is trained incrementally. Online learning is done when the system must be continuously trained. This is very vital when the system needs to be updated without having to be retrained each time. This can be for systems that receive a continuous flow of data from sources such as sensors, social media, financial markets, etc. Online learning</p><p><strong>BONUS</strong></p><p><strong>16. Learning rate </strong>— It is obvious that if a system is continuously taking in data to update its model, the susceptibility to noise is very high. The learning rate gives the flexibility to adjust that, This is how fast a learning system adapts to a continuous flow of training data.</p><p>Setting a low learning rate ensures that the system is less sensitive to noise in new data or outliers. But, this leads to the system learning slowly. Setting a high learning rate gives the exact opposite outcome. Finding a sweet balance between the two is where the magic happens.</p><p><strong>17. Transfer Learning</strong> — Instead of building a model from scratch, we can use an already pre-trained model and build on it. This process is known as transfer learning and it can save time considerably and resources. There are several available pre-trained models for tasks such as image recognition, object detection, etc. More on those later!</p><p><strong><em>If you like this article, follow me for more!</em></strong></p><p><strong><em>I write to understand more about what I learn</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a></p><p><strong><em>Check out my previous article:</em></strong></p><p><a href="https://medium.com/@jallohx86/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7853418d4b31" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning Terms You Need To Know Today</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Know It All — Get A Strong Understanding of Machine Learning Systems]]></title>
            <link>https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d10733caa90</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 18:59:13 GMT</pubDate>
            <atom:updated>2023-03-17T14:42:11.951Z</atom:updated>
            <content:encoded><![CDATA[<h3>Know It All — Get A Strong Understanding of Machine Learning Systems</h3><p>Understand the Basics of Machine Learning Systems</p><p>With the recent explosion of AI systems into everyday work, everything seems magical. From Generative AI models to out-of-the-world systems, everything about machine learning seems so out of normal. But for people with a newfound interest in this world who want to learn more, it will be nice to understand everything from the ground up and know the foundation of these life-changing technologies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m6U74lBjjQB0PhPO" /><figcaption>Photo by <a href="https://unsplash.com/@possessedphotography?utm_source=medium&amp;utm_medium=referral">Possessed Photography</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Simply put, Machine learning is defined as the art or science of getting computers to learn without them being given explicitly a set of instructions to follow.</p><p>Tom Mitchell in his 1997 paper laid out a more technical term and gave out the following definition.</p><p>A computer is said to learn from experience E with respect to some task T and some performance P if its performance on T as measured by P improves with experience E.</p><p>To break this down, let us take an example.</p><p>If we want an ML system to serve an AI robot that crosses the road, we can consider the following.</p><p>Task T is to cross the road in a street with no street lights from one end to the other.</p><p>Experience E from which the computer is learning is the data that is being fed into it when it attempts to cross the road.</p><p>On the first try, it might attempt to directly move ahead and cross the road. Then, it is very possible that it will get hit by an oncoming car from the left side.</p><p>Hence, the system will rate its performance P with respect to Task T — on crossing the road. Maybe 0.2 — Not good. Hence, it has gotten an experience E which is to look left before crossing. It might repeat the task, and the next might be that it will be hit again because of not look right.</p><p>Overtime, this system will learn that to cross the road, you must learn the best policy which is to</p><ol><li><em>Look Left</em></li><li><em>Look Right</em></li><li><em>Look Left Again</em></li></ol><p>Then Cross!</p><p>Hence, the performance on performing Task T has improved greatly with experience E.</p><p>The above task is a classical Machine Learning Type known as Reinforcement Learning. Reinforcement learning systems are greatly employed and played a great part in the Defeat of the Go champion in 2015 when AlphaGo played its first match against the reigning three-time European Champion, Mr. Fan Hui.</p><p>From the example above, one might ask, why shouldn’t the robot not have been told beforehand that the first step is looking left and then right then left again? Well, there are different types of systems and various ways these systems are designed.</p><p>There are types of Machine Learning Systems Such as:</p><p>1. Supervised Learning</p><p>2. Semi-Supervised Learning</p><p>3. Unsupervised Learning</p><p>4. Reinforcement Learning</p><h3><strong>Supervised Learning Systems</strong></h3><p>Machine learning systems that are usually given expected inputs and results are called Supervised Learning Systems. Supervised learning systems are trained on what we called the <em>training set</em>. Supervised learning systems fundamentally learn by understanding and building patterns around predefined data and expected outcomes. Just as how you take a test for a class after studying (training) for an exam (deployment), before deploying the models, we should always test the performance of these models using the <em>test set</em>.</p><p>The training set we feed to the algorithm contains desired solutions called <em>labels</em>. Labels are what we are trying to achieve. In its most basic form, we know 1 + 1 = 2, 1 + 2 = 3, 1 + 3 = 4</p><p>Results 2, 3, and 4 are called the <em>labels</em> because these are the results we are trying to achieve. A set of features that can be used to predict a value are known as a <em>predictor</em>. For example, predictors for life expectancy can be gender, genetics, access to health care, hygiene, diet and nutrition, exercise, lifestyle, and crime rates. Supervised learning algorithms can be used to do tasks such as image and object recognition, spam detection, and many more. To predict a numeric value, these are usually called regression tasks.</p><p>Common types of Supervised Learning Algorithms include</p><ol><li>Linear Regression</li><li>Logistic Regression</li><li>K nearest Neighbors</li><li>Support Vector Machines (SVMs)</li><li>Decision Trees and Random Forests</li><li>Neural Networks ( These are fluid as some can also be unsupervised)</li></ol><h3>Unsupervised Learning Systems</h3><p>The main difference between a supervised and unsupervised learning system is the labeling of data. In an unsupervised Learning system, the system learns without a teacher. There are no labels and the system tries to make sense of what it already has. Here, the system uses algorithms to analyze and cluster unlabelled datasets. The algorithm finds hidden patterns on its own. An example is Amazon using <em>association learning</em> to tell customers that people who have previously bought a certain product also bought products b and c as well together. Another area of application is also medical imaging.</p><p>Common unsupervised learning algorithms include</p><ol><li>Association rule Learning</li><li>Clustering</li><li>Anomaly Detection and Novelty detection</li><li>Visualization and Dimensionality Reduction</li></ol><h3>Semi-Supervised Learning</h3><p>Semi-Supervised Learning Systems deal with data that is partly labeled. This falls between unsupervised and supervised learning. Several issues arise when we try to fully label data in some instances. These include costs such as time and finances. Most semi-supervised learning is a combination of Supervised and Semi-Supervised Learning. For example, Deep Belief Networks (DBNs) which are used for Image recognition, speech recognition, and more are based on supervised learning techniques called Restricted Boltzmann Machines (RBM) which are stacked on one another.</p><h3>Reinforcement Learning</h3><p>As with our example which we started with the system trying to learn how to cross the road, this is a typical example of reinforcement learning. The learning system which is known as the <em>agent</em> selects certain types of action which it performs. It in turn gets a <em>reward</em> or <em>penalty</em> for the type of action performed. This repeats until it arrives at what seems as the optimum solution or <em>policy</em>. In the example that we started with, the robot trying to cross the road is the agent. It gets a reward if it moves a specific distance without getting hit. It receives a penalty if it gets hit by an incoming vehicular system. In the end, the best strategy which it selects is known as the policy.</p><p>In summary, here, we looked at Machine learning systems and their classification whether they are labeled or unlabeled. In the coming articles, we will be discussing various types of models, the issues they face, overfitting, underfitting, etc</p><p><strong><em>If you like this article, follow me for more!</em></strong></p><p><strong><em>I write to understand more about what I learn</em></strong></p><p><strong><em>If you noticed a mistake, have suggestions to improve the article, or want to reach out, feel free to message me on </em></strong><a href="https://www.linkedin.com/in/abdul-rahim-jalloh-b698ba200/"><strong><em>LinkedIn</em></strong></a></p><p><strong><em>Check out my other articles:</em></strong></p><ol><li><a href="https://medium.com/@jallohx86/15-valuable-machine-learning-terms-you-need-to-know-today-7853418d4b31">15 Valuable Machine Learning terms you need to know today</a></li><li><a href="https://medium.com/@jallohx86/bigger-isnt-always-better-how-efficiency-can-make-a-big-difference-for-beginner-programmers-f8652ef2dc7b">Bigger Isn’t Always Better in Programming: Be Efficient</a></li><li><a href="https://medium.com/@jallohx86/overview-of-data-science-workflow-and-roles-697a69daec54">Overview of Data Science Workflow and Roles</a></li><li><a href="https://medium.com/@jallohx86/sql-in-5-minutes-c3465a234e53">SQL in 5 Minutes</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d10733caa90" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/know-it-all-get-a-strong-understanding-of-machine-learning-systems-7d10733caa90">Know It All — Get A Strong Understanding of Machine Learning Systems</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL IN 5 MINUTES]]></title>
            <link>https://medium.com/@jallohx86/sql-in-5-minutes-c3465a234e53?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3465a234e53</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Sun, 16 Oct 2022 12:04:09 GMT</pubDate>
            <atom:updated>2022-12-29T07:59:07.033Z</atom:updated>
            <content:encoded><![CDATA[<h4>CREATE, INSERT, UPDATE &amp; DELETE</h4><p>Previously, we saw an <a href="https://medium.com/@jallohx86/overview-of-data-science-workflow-and-roles-697a69daec54">Overview of Data Science workflow and role</a>. But as usual, after we have understood the overview, we need to take a sequential approach to learning. Going forward, we know “Data is the new oil”; this is one of the most popular phrases being passed around nowadays. Like oil needs a container to be stored in, data needs a database where it should be kept. Keeping and retrieving this data definitely requires a specialised tool. Everyday, data scientists all around the world query data from databases. From that, it is obvious one should know how to use this tool if one plays with data daily in any form.</p><p>What is SQL?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UVDHd__MP4tnMFir" /><figcaption>Photo by <a href="https://unsplash.com/@sunder_2k25?utm_source=medium&amp;utm_medium=referral">Sunder Muthukumaran</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>SQL pronounced S-Q-L or Sequel is used for managing data (Create DB, Insert, Update &amp; Delete) which is held in relational databases — and no, not a movie sequel. A relational database is one in which data is contained in tables with relationships among them. Please note that for non-relational databases, NoSQL is made use of by data practitioners.</p><p>To follow along hands-on, please use the MYSQL flavor of SQL. Do not worry, there are various flavors to SQL, but the syntax is almost fully the same! Please find sample installation instructions <a href="https://www.youtube.com/watch?v=2c2fUOgZMmY">here</a> if you do not have them.</p><p><strong>Short Note On Using the MYSQL Workbench:</strong></p><p>Use the Folder like icon with the plus sign on the top left corner of your screen to create a new SQL tab for executing queries. Use the thunder-like icon to run queries. You can select queries to execute, or can run everything on your window. Be careful when running everything where there is a create DB statement. This will give an error that the database has already been created. You can create the database on one tab, then do follow-up insertions on another tab, or you can select portions of code to run which does not include the create database statements. Please note that also in MySQL, using the backtick (`…`) signifies the creation or referencing of a row.</p><p>We will be creating an Admin database.</p><blockquote>CREATE AND USE A DATABASE</blockquote><p>To Create a database, we use</p><pre>CREATE DATABASE Admin;</pre><p>To use the database,</p><pre>USE Admin;</pre><p>After creating the database, we need to create individual tables in the database. To create a table, we have to specify the table name and all its fields. Also, we have to include the type of value a field takes; whether integer (int) or Variable character (VARCHAR), which can hold both numbers, letters and special characters, etc….</p><pre>CREATE TABLE `Dept`(</pre><pre>`Dept_id` INT(20) NOT NULL AUTO_INCREMENT,</pre><pre>`Dept_name` VARCHAR(50) NOT NULL,</pre><pre>`Manager` VARCHAR(50) NOT NULL,</pre><pre>PRIMARY KEY(`Dept_id`))</pre><p>We have created the Dept table with three columns. The Dept_id only takes integer values of length 20. This column should always contain a value and should not be left blank, hence NOT NULL. The AUTO_INCREMENT tells the database to add to the integer value plus one when we input our next data. We made the Dept_id our PRIMARY KEY. Primary Keys are unique identifiers for each row of data in a table. If example we have a staff of id 1293, no other staff will have that id.</p><pre>CREATE TABLE `staff`(</pre><pre>`id` INT(50) NOT NULL,</pre><pre>`full_name` VARCHAR(255) NOT NULL,</pre><pre>`DOB` DATE,</pre><pre>`gender` VARCHAR(255),</pre><pre>`start_date` DATE,</pre><pre>`depId` INT(50) NOT NULL,</pre><pre>`status` BOOLEAN NOT NULL,</pre><pre>PRIMARY KEY(`id`),<br>FOREIGN KEY (`depId`) REFERENCES `Dept` (`deptId`))</pre><p>The above query has created for us a table named staff which has an id field for type integer(int) and NOT NULL. A Primary key was also created on the table. We added a Foreign Key which references the deptId in the Dept table.</p><blockquote>INSERT DATA INTO TABLE</blockquote><p>Let us first insert these departments into our department table.</p><pre>INSERT INTO `Dept` VALUES<br>(DEFAULT, ‘Human Resources’, ‘Wilfred Jalloh’),<br>(DEFAULT, ‘Admin’, ‘Sheikou Abu’),<br>(DEFAULT, ‘IT’, ‘Sheku Rahim Jalloh’);</pre><p>The DEFAULT Keyword indicates for the query use the Default value specified in creating the table which in this case is the AUTO_INCREMENT value. This query Above can also be achieved by specifying the fields to insert to.</p><pre>INSERT INTO `Dept` (Dept_name, Manager) VALUES <br>(‘Finance’, ‘Lia Shaw’);</pre><p>To insert data into the staff, let us input data for 3 employees with all fields provided.</p><pre>INSERT INTO `staff` VALUES</pre><pre>(DEFAULT, ‘Mark gates’, ‘1990–04–07’, ‘Male’, ‘2006–03–01’, 3,true),</pre><pre>(DEFAULT, ‘Elon Zukerburg’, ‘1992–03–01’, ‘Female’, ‘2009–01–01’, 4,  true),</pre><pre>(DEFAULT, ‘Einstein Marie’, ‘1974–12–01’, ‘Female’, ‘2003–01–03’, 1, false);</pre><p>Wait! aren’t our managers’ employees also? Let us add our managers to the staff table.</p><p>For incomplete entries, say we do not know the sex of two employees and their DOB, we can add data by</p><pre>INSERT INTO `staff` (name, start_date, status) VALUES</pre><pre>(‘Albert Jalloh’, ‘2000–10–10’, false),</pre><pre>(‘Allan Bezos’, ‘2010–12–28’, true);</pre><p>To Display all the content that we have input in the DB, tables, we can use the SELECT statement.</p><pre>SELECT * FROM staff;</pre><p>The * indicates all the columns and rows from the staff table. It is basically saying SELECT all the data from the staff table.</p><blockquote>UPDATE</blockquote><p>Updating a Single Row.</p><p>Please note that the order of operation for updating is UPDATE-SET-WHERE</p><p>Say we want to update the DOB of the staff with the name Albert Farmer.</p><p>We can achieve this by doing</p><pre>UPDATE `staff`</pre><pre>SET DOB= ‘1960–03–03’</pre><pre>WHERE id = 4; — id for employee name Albert Jalloh</pre><p>NB: to update more than one row eg SET DOB=’1960–03–03’, gender=’Male’, or using a WHERE that specifies a non-id column eg( WHERE fullName = ‘Albert Jalloh’ instead of WHERE id = 4), we have to uncheck safe update rejects in MYSQL.</p><p>Go to Edit — Preferences — SQL-EDITOR — uncheck safe updates</p><blockquote>DELETE</blockquote><p>To Delete say a specific staff, we can do</p><pre>DELETE FROM `staff` WHERE fullName = ‘Allan Bezos’;</pre><p>So far, we have learned about creating, inserting updating, and deleting data from tables.</p><p>Tasks:</p><p><em>Upon database review, we noticed that our managers are not even in our staff database. Add all 3 managers into the staff database with birth dates less than 1970 and employment dates less than 2008 — all fields should be populated.</em></p><p><em>INSERT 3 staff with the missing field of DOB and Gender</em></p><p><em>UPDATE the DOB field for 2 of the employees above.</em></p><p>In the case of facing any issues, or errors here or on your side, feel free to connect with me on LinkedIn and send in your question.</p><p>UP NEXT: QUERYING OUR DATABASE.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3465a234e53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OVERVIEW OF DATA SCIENCE WORKFLOW AND ROLES]]></title>
            <link>https://medium.com/@jallohx86/overview-of-data-science-workflow-and-roles-697a69daec54?source=rss-d47018dc53eb------2</link>
            <guid isPermaLink="false">https://medium.com/p/697a69daec54</guid>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Abdul Rahim Jalloh]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 11:21:31 GMT</pubDate>
            <atom:updated>2022-08-20T11:48:31.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Data from Forbes shows that 2.5 quintillion bytes of data are created daily. With this, understanding this new oil should be a priority and not just a mere option. This explosion of data is now what is being referred to as big data, and it is helping data scientists make crucial decisions in every single field from Business analytics to finance Health and wellness, and Biomedicine to Information security and many more.</p><p>When talking about data science, one may not even need to enter big data to understand its concept, because even in our homes and personal lives, it shows Data is everywhere. Regardless, due to all the terms being thrown around from Data Engineering, Data Analysis, and Data Scientists to Machine Learning (ML) scientists, one might still ask; What is Data Science?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ufmUmNX8n8H9gY1A" /><figcaption>Photo by <a href="https://unsplash.com/@kmuza?utm_source=medium&amp;utm_medium=referral">Carlos Muza</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A quick online search on the word data will show that it is facts and statistics collected together for reference or analysis, whiles for science, its several definitions all include a set of methodologies or processes. <strong>Data Science is simply a set of methods to collect and process thousands of forms of data to better the present and predict the futur<em>e</em></strong>. Due to us talking about methods and processes, there is a simple workflow that allows and assumes the ease and quality involved. To understand this, we should ask ourselves the steps involved.</p><p>Before moving any further let us create our simplified Data Science Workflow. In solving a problem, we have to ask certain questions for a better understanding of the problem. Hence, we should begin with <em>Business Understanding</em>. After, here comes the next stage of our simplified Data science workflow which is <em>Data Collection and Storage</em>. Also, raw collected data is not well organised. Hence, it has to be prepared which leads us to <em>Data preparation</em>.</p><p>Moving forward, we gather data primarily to convey information. To have information from data, it needs to be explored and most often visualized to get a physical feel of how the data looks; hence, <em>Exploration and visualization</em>. Also, the emergence of Big data has also pushed us towards using it to make a prediction and run various experiments. With that, we have a stage of the workflow which is<strong><em> </em></strong><em>Experimentation and Prediction</em>. Lastly, we will look at Deployment &amp; Feedback.</p><ol><li><strong>Business Understanding</strong></li><li><strong>Data Collection and Storage</strong></li><li><strong>Data Preparation</strong></li><li><strong>Exploration and Visualization</strong></li><li><strong>Experimentation &amp; Prediction</strong></li><li><strong>Deployment &amp; Feedback</strong></li></ol><p>Before moving forward, it is important to understand that fields such as Traditional Machine Learning and Deep Learning form part of Data Science. With that also, we should understand how the roles of individuals such as Data Engineers, Data Analysts, Data Scientists, and Machine Learning scientists all fit into the Data Science workflow above. Although one can rightly assume that these roles are company dependent, and a small start-up will have a “Data Scientist” perform from data collection and storage to prediction, it is important to note that these become specialised roles as the data scales. Before moving forward, let us understand and explain these roles.</p><blockquote><strong>UNDERSTANDING DATA SCIENCE ROLES</strong></blockquote><p><strong>Data Engineer</strong></p><p>The Data Engineer works on the collection and storage of data. These Engineers are information architects and are responsible for building data pipelines that ensure the easy processing of data through defined stages. Data Engineers are also responsible for giving data access to other data professionals. They work with tools such as SQL which helps to store and organize data, Python, Java, or Scala which helps with processing the data, and shell commands to automate and run tasks. They also venture into the cloud computing atmosphere for easy data storage hence making use of tools such as AWS, Azure, Google Cloud, etc.</p><p><strong>Data Analyst</strong></p><p>Subsequently, a Data Analyst cleans data to perform analysis from data to gain insights and help an organisation better the present by laying the framework for data-driven decisions. They create reports and dashboards to summarise data and present it in an easily understood visual context. All of this is made possible with tools such as SQL to retrieve and aggregate the data, Excel or google sheet to perform simple analysis and BI tools such as Tableau, Power BI, and Looker to give a visual insight through Dashboards. Data Analysts also work with tools such as Python and or R.</p><p><strong>Data Scientist &amp; ML Scientist</strong></p><p>Regardless of having the label “Data scientist”, in big cooperation, the Data Scientist is a specialised role that does not require one to be working right across all the stages in the workflow but rather focuses on the last three stages, leaving the Data Collection and storage to the Data Engineer. Despite not being an exclusive statistician, a data scientist is versed in statistical methods, runs experiments and analyses, and dives into traditional Machine Learning for predictions. They make use of tools such as SQL to retrieve data, use various python libraries and also employ the use of R.</p><p>Going further, a machine Learning Scientist’s role is almost the same as a Data Scientist&#39;s, with the difference being that there is an emphasis on the Machine Learning aspect by an ML Scientist. The ML Scientist focuses on prediction and goes beyond traditional ML. This he does by diving into areas such as Deep Learning which deals with Image recognition, Natural Language Processing, and more.</p><blockquote><strong>DIVING INTO THE WORKFLOW</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NeUplRloZ4_YCw0B" /><figcaption>Photo by <a href="https://unsplash.com/@firmbee?utm_source=medium&amp;utm_medium=referral">Firmbee.com</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li><strong>Business Understanding</strong></li></ol><p>It is often said that “Understanding the problem is half of the solution”. This still holds and is a very important aspect of Data Science. Before solving a problem, you first have to understand what the problem is, the why, and the approach to solving it. Establishing a clearly defined question starts with understanding the goal of the person asking the question. For example, a Marketing company can ask “Which customer segments are most likely to promote us on social media?” With that, we need to clearly understand if the goal is to improve customer reach, or to improve profitability. By better understanding the objectives, we can be well structured to place our priorities as this can lead to organising and planning on how to tackle the problem.</p><p><strong>2. Data Collection &amp; Storage</strong></p><p>For Data to be collected and stored, there has to be a source. These sources of data include Company data and Open data. Take a customer using a website such as amazon.com. The company collects web data on the user which includes click events, products interested in most, and spending habits. Other types of company data include survey data and logistics data. Company data helps them to make data-driven decisions such as product recommendations from amazon, movie recommendations from Netflix, etc. Open data is free and accessible to individuals and teams to work with and build on. To access open data, we need to do so by accessing Application Programming Interfaces (API) on public records. Some companies provide access to their data through APIs. One can access Youtube’s API say to know the videos with the highest subscriber count each day and more. Moving forward, Public records are accessed through Government agencies, National statistical offices which provide census data and various survey data, and International organisations such as World Bank, UN, WHO, WTO, UNHCR, etc.</p><p>Diving further, we need to understand how data is stored and retrieved. Data is mainly stored in two types of databases i.e. Document database and a Relational Database. A Document database mainly holds data such as email, text, video files, audio files, web pages, social media, etc. A relational database is a database that stores its data in tables and uses SQL to query data. In addition, we need to understand the Data types involved. To start with, we have Qualitative data and Quantitative data. Quantitative data includes things to which numerical values can be attached. E.g. Age is 50 yrs. etc. Qualitative data deals with descriptions and data that can be observed not measured. E.g. Colour is black. Other data types include Image data, Geospatial data, Text data, and Network data.</p><p>Understanding the concept of data pipelines is another important aspect. A data pipeline is a set of tools and processes used to automate the collection and storage of data between a source and target repository. Data pipelines are monitored with generated alerts. A Data pipeline is usually designed and customized by the Data Engineer. A vital data Integration process to note is Extract Transform and Load (ETL) which contains data sources into a single consistent data store that is loaded into a data warehouse or other target system.</p><p><strong>3. Data Preparation</strong></p><p>To further our understanding of the methodologies, we should understand Data preparation. Why is data preparation needed? Real-world data collected and stored is a messy form of data and is not in its ready stage. Preparation is done to prevent errors, incorrect results, and biased algorithms. Say we have a column of daily rainfall within a period, and there is a missing cell of data. What should be done? Given that there are various reasons for a missing value such as data entry error, etc. we have the option of finding the average value of rainfall and inputting it in the cell, dropping it, or keeping it as it is. Please note that one should not operate without first investigating the why.</p><p><strong>4. Exploration &amp; Visualization</strong></p><p>To understand Exploration and Visualization, let us look at a concept known as Exploratory Data Analysis (EDA). The processes that encompass EDA are <em>exploring the data</em>, <em>formulating a hypothesis</em>, <em>assessing characteristics</em>, and <em>visualisation</em>. EDA happens after preparation. The need for EDA is because descriptive statistics can be misleading and visual statistics teach the most. Going on, a proper visualisation should include the purposeful use of colours. There is usually no need to use more than one colour except when the colours can correspond to something. Visuals should always include text labels. One should also be aware of people with colour blindness and the types of fonts being used. When we have too many related visuals to present, it is best to make use of dashboards with the help of BI tools such as Tableau, Looker, Power BI, etc.</p><p><strong>5. Experimentation &amp; Prediction</strong></p><p>Furthermore, we have Experimentation and Prediction. To have predictions, there must be a statistical model. This is a representation of a real-world process with statistics. There must be a mathematical relationship between variables, including random variables based on statistical assumptions and historical data. Predictive modeling involved three main steps which include taking in a new Input, then Inputting it into the Predictive model, then there will be a predictive outcome. This model ranges in complexity from a linear equation to deep learning algorithms. Time series forecasting which is an essential area of Machine Learning deals with time series data which is a series of data points sequenced by time. Example Stock prices, Gas prices, unemployment rates, Heart rates, etc. Time Series data is usually plotted with time on the x-axis.</p><p>Traditional ML constitutes various systems, including supervised, unsupervised, semi-supervised, etc. Supervised Learning has features and Labels. If we are trying to use a dataset to predict house prices, there will be features and Labels. The features are combinations of an attribute plus its value example number of rooms = 4: where no. of rooms is the attribute and 4 is the value. Labels are the desired solutions; in this case, the actual price of the house. Unsupervised learning in contrast has no labels attached to it and uses various techniques such as clustering. Beyond traditional ML we can enter the world of Deep learning which involves tasks such as Image Recognition and Natural Language Processing.</p><p>6. <strong>Deployment &amp; Feedback</strong></p><p>Finally, once a model has been created, evaluated, and the data scientist is confident it will work, it is deployed to real-world scenarios and put to the ultimate test. Depending on the model, it may be rolled out to a limited group of users or in a test environment with the aim of building up confidence for full deployment. For this, Feedback plays a huge role. Feedback is essential to refine the model and asses how it performs in real-world cases and the impact it has.</p><p>In conclusion, one cannot over-emphasize the need for data science. We have worked through and understand its workflow from Business Understanding to Deployment &amp; Feedback. These stages in the workflow ensure a seamless process in the data science atmosphere.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=697a69daec54" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>