<?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 Olive B Praisy on Medium]]></title>
        <description><![CDATA[Stories by Olive B Praisy on Medium]]></description>
        <link>https://medium.com/@olivepraisy98?source=rss-985f14d96ce8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HN5QJScPPwfms0SWMxHS6A@2x.jpeg</url>
            <title>Stories by Olive B Praisy on Medium</title>
            <link>https://medium.com/@olivepraisy98?source=rss-985f14d96ce8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:12:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@olivepraisy98/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[Linear Agebra 1:Vectors For Data Science]]></title>
            <link>https://medium.com/@olivepraisy98/vectors-for-data-science-7e7eb9b5bb23?source=rss-985f14d96ce8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e7eb9b5bb23</guid>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[vectors-in-python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <dc:creator><![CDATA[Olive B Praisy]]></dc:creator>
            <pubDate>Fri, 27 Sep 2024 06:47:45 GMT</pubDate>
            <atom:updated>2024-09-27T14:05:04.721Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Key Concepts Ever Beginner Should Know…</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*DQIWNkGQrnKzIBbmpVhIaQ.png" /></figure><p>In the world of Machine Learning and Data Science, mathematical foundations are often overlooked, yet they are crucial for mastering these fields. A solid understanding of linear algebra can significantly enhance your ability to grasp and implement machine learning algorithms. In this article, we will explore the essential linear algebra topics that form the bedrock of machine learning, helping you build a strong foundation to advance in this exciting domain.</p><h3><strong>VECTORS:</strong></h3><p>Quantities in mathematics, including linear algebra, can be divided into <em>scalars</em> and <em>vectors</em>, each serving different purposes. Now let’s us understand the difference between a scalar and a vector with a simple example. If you tell a car to move 3 steps, that’s a scalar because it specifies only how far to move, without mentioning the direction. In contrast, a vector would include both the distance and the direction, like 3 steps forward and 2 steps to the right, giving complete instructions on how to move the car.</p><p>So a <strong><em>vector </em></strong>is essentially a quantity that has both<strong><em> magnitude</em></strong> and<strong><em> direction</em></strong>. It is represented as an arrow pointing from one point to another in space.</p><p><strong>Different Ways To Represent A Vector:</strong></p><p><strong><em>In Notation:</em></strong> Vectors are often represented as list of numbers enclosed in brackets or parentheses.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FU7t3i5pNe2MxpadB8ckA4&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FU7t3i5pNe2MxpadB8ckA4&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="182" frameborder="0" scrolling="no"><a href="https://medium.com/media/69875aa58fb754d59cb63b05174baaed/href">https://medium.com/media/69875aa58fb754d59cb63b05174baaed/href</a></iframe><p><strong><em>In Geometry: </em></strong>In geometry, vectors can be visualized as arrows originating from the coordinate system’s origin to a specified point in the space.</p><p><strong>Example</strong>: An arrow starting at (0,0,0) and ending at (3,4,5)</p><p><strong><em>Unit Vector Notation: </em></strong>Vectors can also be represented using unit vector <strong><em>i</em></strong>,<strong><em>j </em></strong>for 2D or <strong><em>i</em></strong>,<strong><em>j</em></strong>,<strong><em>k</em></strong> for 3D, indicating direction along the coordinate axes.</p><p>Example: V = 3<strong><em>i</em></strong>+4<strong><em>j</em></strong>+5<strong><em>k</em></strong></p><p><strong>Why Vectors matter in Machine Learning</strong></p><p>Vectors are the backbone of data representation in machine learning. They are used to represent features of data points, weights in models, and more. Understanding vectors and their operations is crucial for tasks like data preprocessing, model training and algorithm implementation.</p><h4>Vectors in Python</h4><p>In python, vectors are commonly represented using libraries like NumPy and Pandas.</p><p><strong><em>NumPy Array: </em></strong>A one-dimensional NumPy array is a direct representation of a vector.</p><pre>import numpy as np<br>vector=np.array([3,4,5])<br>magnitude=np.linalg.norm(vector)<br>unit_vector = vector / magnitude<br>print(&quot;V=&quot;,vector)<br>print(&quot;Magnitude=&quot;,magnitude)<br>print(&quot;Unit Vector=&quot;,unit_vector)</pre><pre><strong>OUTPUT:</strong><br>V= [3 4 5]<br>Magnitude= 7.0710678118654755<br>Unit Vector= [0.42426407 0.56568542 0.70710678]</pre><p><strong><em>Pandas Series: </em></strong>A pandas series is one-dimensional array with labeled data, which includes additional metadata about the labels. Its <strong><em>.values </em></strong>attribute provides a NumPy array that represents the vector itself. So to access the vector form of a pandas series, you can use <strong><em>.values</em></strong> attribute.</p><pre>import pandas as pd<br>series = pd.Series([3, 4,5])<br>vector = series.values<br>magnitude=np.linalg.norm(vector)<br>unit_vector = vector / magnitude<br>print(&quot;V=&quot;,vector)<br>print(&quot;Magnitude=&quot;,magnitude)<br>print(&quot;Unit Vector=&quot;,unit_vector)</pre><pre><strong>OUTPUT:</strong><br>V= [3 4 5]<br>Magnitude= 7.0710678118654755<br>Unit Vector= [0.42426407 0.56568542 0.70710678]<br>​</pre><p>While a pandas Series is not directly a vector due to it’s inclusion of labels and additional metadata, its <strong><em>.values</em></strong> attribute can be used to obtain the underlying NumPy array, which is a pure vector of numerical values.</p><h4>The Role Of Vectors In Machine Learning</h4><p><strong><em>Feature Vector for Each Data Point: </em></strong>In machine learning, we represent each individual data point with a feature vector. This is simply a list of numbers where each number corresponds to a feature of the data point.</p><p><strong>Example:</strong> Imagine we have a dataset with features like age, income, and spending score. For one person, their feature vector might look like this:</p><p>x=[30,60000,80]</p><p>This vector shows their age is 30, their income is $60,000, and their spending score is 80.</p><p><strong>Usage:</strong> When training a model, we use these feature vectors to make predictions and adjust the model. For example, in linear regression, we use these vectors to calculate predictions by combining them with weight vectors.</p><h4><strong>UNDERSTANDING VECTOR OPERATIONS IN MACHINE LEARNING</strong></h4><p>Here are some basic operations you can perform on vectors</p><p><strong><em>Addition Of Two Vectors:</em></strong></p><p>Vector addition involves combining two vectors or more vectors to produce a new vector. It involves adding their corresponding elements.</p><pre>import numpy as np<br>vector1 = np.array([1,2,3])<br>vector2 = np.array([4,5,6])<br>print(&quot;Vectors Addition=&quot;,vector1+vector2)</pre><pre>Output:<br>Vectors Addition= [5 7 9]</pre><p><strong><em>Subtraction Of Two Vectors:</em></strong></p><p>Subtracting two vectors involves subtracting each corresponding component of the vectors.</p><pre>import numpy as np<br>vector1 = np.array([1,2,3])<br>vector2 = np.array([4,5,6])<br>print(&quot;Vectors Subtraction=&quot;,vector1-vector2)</pre><pre>Output:<br>Vectors Subtraction= [-3 -3 -3]</pre><p><strong><em>Element Wise Division Of Two Vectors:</em></strong></p><p>Dividing corresponding elements of two vectors element wise.</p><pre>import numpy as np<br>vector1 = np.array([10,20,35])<br>vector2 = np.array([5,4,6])<br>print(&quot;Vectors Division1=&quot;,vector1/vector2) #True Division<br>print(&quot;Vectors Division2=&quot;,vector1//vector2) #Floor Division</pre><pre>Output:<br>Vectors Division1= [2.         5.         5.83333333]<br>Vectors Division2= [2 5 5]</pre><h4>VECTOR MULTIPLICATION:</h4><p>Vector multiplication can be broadly categorized into four types: element-wise multiplication of two vectors, scalar multiplication of a vector, the dot product, and the cross product.</p><ol><li><strong><em>Element-wise Multiplication : </em></strong>Element-wise multiplication, also known as the Hadamard product, involves multiplying corresponding elements of two vectors of the same length. Given two vectors, <strong>A</strong>=[a1,a2,a3] and <strong>B</strong>=[b1,b2,b3]</li></ol><p><strong>A*B</strong> = [a1*b1 , a2*b2 , a3*b3]</p><p>2. <strong><em>Scalar Multiplication Of a Vector:</em></strong></p><p>Scalar multiplication involves multiplying each element of a vector by a scalar value. This operation is fundamental in scaling vectors, adjusting their magnitude without changing their direction.</p><p>Given a Vector <strong>A</strong>=[a1,a2,a3] and a scalar c</p><p>c*<strong>A </strong>= [c*a1 , c*a2, c*a3]</p><p>3. <strong><em>Dot Product Of Two Vectors:</em></strong></p><p>Dot product or Inner product of two vectors is the sum of the products of the corresponding elements of the two vectors. Given two vectors, <strong>A</strong>=[a1,a2,a3] and <strong>B</strong>=[b1,b2,b3]</p><p><strong>A</strong>⋅<strong>B </strong>= a1*b1 + a2*b2 + a3*b3</p><p><strong>Note that the dot product of two vectors gives a <em>scalar value</em>.</strong></p><p><strong>What The Scalar Value of the dot product signifies:</strong></p><p>The scalar value obtained from the dot product quantifies the magnitude of the projection of one vector onto another. It measures how much of one vector lies in the direction of the other vector. If <strong>A </strong>and <strong>B</strong> are vectors, the dot product is given by:</p><p><strong>A</strong>⋅<strong>B</strong> = ∥<strong>A</strong>∥∥<strong>B</strong>∥cos(θ) ,where θ is the angle between the vectors</p><p>i. When the value of the dot product is positive, it means the vectors are pointing in a similar direction, i.e., the angle between them is less than 90 degrees.</p><p>ii. When the value of the dot product is negative, it means the vectors are pointing in opposite directions, i.e., the angle between them is greater than 90 degrees.</p><p>iii. A scalar value ( value of dot product) of zero means the vectors are orthogonal (perpendicular) to each other, indicating no alignment or similarity in direction.</p><p>In machine learning and linear algebra, the dot product is used to compute a weighted sum of features. For example, in a linear model, the dot product of feature vectors with weight vectors gives the weighted sum of the features, which is used to make predictions. The scalar value here represents the result of applying these weights to the features.</p><p><strong>4. <em>Cross Product Of Two Vectors:</em></strong><em> The cross product of two vectors results in a new vector that is perpendicular to both the original vectors. </em>Given two vectors, <strong>A</strong>=[a1,a2,a3] and <strong>B</strong>=[b1,b2,b3]</p><p><strong>A×B </strong>= [(a2*b3 — a3*b2), (a3*b1- a1*b3),(a1*b2-a2*b1)]</p><pre>import numpy as np<br>v1 = np.array([1,2,3])<br>v2 = np.array([4,5,6])<br>c = 3<br>print(&quot;Element-wise Multiplication=&quot;,v1*v2)<br>print(&quot;Scalar Multiplication=&quot;,c*v1)<br>print(&quot;Dot Product=&quot;,v1.dot(v2))<br>v1 = np.array([1,2])<br>v2 = np.array([4,5])</pre><pre>Output:<br>Element-wise Multiplication= [ 4 10 18]<br>Scalar Multiplication= [3 6 9]<br>Dot Product= 32<br>Cross Product= [-3  6 -3]</pre><p><em>The cross product is specifically defined for 3-dimensional vectors and does not generalize to vectors in dimensions higher than 3. It results in a vector that is perpendicular to the plane defined by the original two vectors. . When working with 2-dimensional vectors, the concept of the cross product can be extended to calculate the magnitude of the vector perpendicular to the plane defined by the two vectors, but it won’t give you a vector as the result.</em></p><pre>v1 = np.array([1,2])<br>v2 = np.array([4,5])<br>print(&quot;Cross Product=&quot;,np.cross(v1,v2))</pre><pre>Output:<br>Cross Product= -3</pre><ul><li>np.dot(a, b) and a.dot(b) compute the dot product of vectors(numpy arrays) , giving the same result.</li><li>np.cross(a, b) calculates the cross product for 3-dimensional vectors, resulting in a vector orthogonal to the plane. Note that NumPy doesn’t support a.cross(b)method .</li></ul><h4>Understanding Vector Norms: L1, L2, L∞</h4><p>In mathematics and Data Science, the norm of a vector is a measure of the length or magnitude of that vector. Different kinds of norms can be used depending on different contexts. Here are some commonly used types of norms.</p><ol><li><strong>L1 Norm (Manhattan Norm or Taxicab Norm)</strong>:It is the sum of absolute values of all the components or elements of that vector.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2F3Cce4Z8oYQy3FeLn4Zba1x&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2F3Cce4Z8oYQy3FeLn4Zba1x&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="169" frameborder="0" scrolling="no"><a href="https://medium.com/media/53184d8b1e160af4cbabe5ea98cc309e/href">https://medium.com/media/53184d8b1e160af4cbabe5ea98cc309e/href</a></iframe><p><strong>2. L2 Norm (Euclidean Norm)</strong>: It is the square root of the sum of the squared components or elements of that vector. The L2 norm of a vector is similar to calculating the Euclidean distance between the origin and a point in coordinate space.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2Fki9BxnP5PzF6Pk9ActzwqX&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2Fki9BxnP5PzF6Pk9ActzwqX&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="310" height="96" frameborder="0" scrolling="no"><a href="https://medium.com/media/160543ac79374b756da19ed8363cc50d/href">https://medium.com/media/160543ac79374b756da19ed8363cc50d/href</a></iframe><p>3. <strong>L∞ Norm (Maximum Norm or Chebyshev Norm)</strong>: It is the maximum absolute value among the components or elements of the vector.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2FhcaJqrFetp2q4SBNcVLW4d&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2FhcaJqrFetp2q4SBNcVLW4d&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="146" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab9012e0ae527a160572faa53d390a5e/href">https://medium.com/media/ab9012e0ae527a160572faa53d390a5e/href</a></iframe><p><strong>4. Lp Norm:</strong> This is the general form of the norm where p can be any positive real number.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fmath.embed.fun%2Fembed%2F3hn5S1UPZtQY3QshH8EjFM&amp;display_name=Embed+Fun&amp;url=https%3A%2F%2Fmath.embed.fun%2F3hn5S1UPZtQY3QshH8EjFM&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=embed" width="200" height="176" frameborder="0" scrolling="no"><a href="https://medium.com/media/c91e91da663ce1ef2f49ed1266659724/href">https://medium.com/media/c91e91da663ce1ef2f49ed1266659724/href</a></iframe><p>for p=1, it’s the L1 norm</p><p>for p=2, it’s the L2 norm</p><p>As p approaches to infinity, the Lp norm approaches to L∞ Norm</p><pre>import numpy as np<br>a = np.array([1,2,3,-7])<br>manhattan_norm=np.linalg.norm(a,ord=1)<br>euclidean_norm=np.linalg.norm(a,ord=2)<br>infinity_norm = np.linalg.norm(a,ord=np.inf)<br>print(f&quot;Euclidean Norm (L2): {euclidean_norm}&quot;)<br>print(f&quot;Manhattan Norm (L1): {manhattan_norm}&quot;)<br>print(f&quot;Infinity Norm (L∞): {infinity_norm}&quot;)</pre><pre>Output:<br>Euclidean Norm (L2): 7.937253933193772<br>Manhattan Norm (L1): 13.0<br>Infinity Norm (L∞): 7.0</pre><p>Mastery of these vector concepts will significantly enhance your ability to tackle machine learning challenges and improve your overall analytical skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e7eb9b5bb23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing EDA with Visualization]]></title>
            <link>https://medium.com/@olivepraisy98/enhancing-eda-with-visualization-56fa1c56bc78?source=rss-985f14d96ce8------2</link>
            <guid isPermaLink="false">https://medium.com/p/56fa1c56bc78</guid>
            <category><![CDATA[data-visualisation]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Olive B Praisy]]></dc:creator>
            <pubDate>Sat, 27 Jul 2024 07:32:07 GMT</pubDate>
            <atom:updated>2024-07-27T07:32:07.399Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>How Data Visualization Complements Pandas and NumPy for Deeper Insights…!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DI43PJJU6IdEBZ-6zXDexw.png" /></figure><p>During my initial days of learning data analytics, I often wondered why we need data visualization when we can perform amazing analytics using libraries like Pandas and NumPy. Powerful tools like pivot tables in Pandas summarize data and reveal some insights and trends. So why exactly do we need visualization?</p><p>This question lingered in my mind when I started learning about data visualization. Little did I know, data visualization is also a crucial part of Exploratory Data Analysis (EDA) and complements the capabilities of Pandas and NumPy.</p><p>Let’s use the example of ice cream sales over five months for two shops to illustrate why visualization can be more insightful than just using pandas and NumPy for data analysis.</p><pre>        January  February  March  April  May<br>Shop A       20        25     30     25   30<br>Shop B       30        25     20     30   25</pre><pre>Statistics Summary:<br>         Average Sales  Median  Standard Deviation<br>Shop A           26.0    25.0              4.1833<br>Shop B           26.0    25.0              4.1833</pre><p>By performing a statistical summary of sales data for two shops using the Pandas library, we observed that the average sales, median, and standard deviation for both shops were identical. Based on these statistics alone, it might seem that both shops have similar performance. However, this conclusion does not fully capture the nuances of their monthly performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*zfJ6Sr5SvRCQZrIy9f5j5Q.png" /></figure><p>The line chart above reveals that although the overall average sales, median, and standard deviation are the same for both shops, there are significant differences in their month-wise performance. For instance, while both shops have the same average sales over the period, Shop A and Shop B exhibit different sales trends in individual months.</p><p>This example highlights the limitations of relying solely on aggregate statistics for performance analysis. Visualization provides a clearer picture of trends and variations that summary statistics may overlook.</p><p>In the upcoming series of posts, I’ll delve deeper into data visualization in Python, exploring various libraries and techniques to enhance your data analysis skills. Stay tuned for more insights and practical examples!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56fa1c56bc78" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>