<?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[A year of ML - Medium]]></title>
        <description><![CDATA[going from novice to somewhere in the middle over the course of a year. - Medium]]></description>
        <link>https://medium.com/a-year-of-ml?source=rss----51932ea27838---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>A year of ML - Medium</title>
            <link>https://medium.com/a-year-of-ml?source=rss----51932ea27838---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:09:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/a-year-of-ml" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Recognizing digits — (the hello world of machine learning).]]></title>
            <link>https://medium.com/a-year-of-ml/recognizing-digits-the-hello-world-of-machine-learning-8e4f28c31099?source=rss----51932ea27838---4</link>
            <guid isPermaLink="false">https://medium.com/p/8e4f28c31099</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Osita Chibuike]]></dc:creator>
            <pubDate>Wed, 30 Jan 2019 20:49:50 GMT</pubDate>
            <atom:updated>2019-01-31T08:43:13.565Z</atom:updated>
            <content:encoded><![CDATA[<h3>Recognizing digits — (the hello world of machine learning).</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JT5-gE7f59fRCWiQ" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This is one of the many classic problems in machine learning, so much that it has become the hello world of machine learning, Since we want computers to recognize digits, it comes to mind to ask how do humans see digits, this, of course, implies the human mind is an optimal solution to recognizing handwritten digits, Well it is. so how exactly do we do it?</p><p>Well here’s a thought we collect a set of pixels and based on the intensity of these pixels we recognized recurring patterns in the samples and then based on our generally defined labels for this patterns we say this number is this or that, our ability to categorize these numbers is based on our memory and our previous exposure to patterns of such nature that have been pre-classified. This is the idea of learning in machine learning.</p><p>So if we are going to build a solution capable of learning how to recognize numbers, how do we learn?</p><p>This is the crux of our path today, There are many ways to solve this problem and we are going to focus on only one of them, in a later post we are going to take a very deep look at the internal functionality of this solution.</p><p>Its the Support vector machine.</p><h3>A brief introduction.</h3><p>When we think of support vector machines, imagine this, given random sets of data which match to different random positions on the Cartesian plane, we aim to find a line that clearly divides these random datasets into two or more confirmed classifications, this is really based on the dimension of the classifications, if we divide the data points into 2 major classifications, then we can say its a 2-dimension classification, when we consider more positions we can now say we have more dimensions to consider. To learn more about support vector machines you can take a look at these resources.</p><p>In this post, we are looking to see how we can utilize the support vector machines to recognize digits. In this instance, we use the support vector machines to learn.</p><p>So let&#39;s get started.</p><p>First, we have to consider our data, using the input data provided by kaggle in their digit recognizer problem set.</p><h3>Loading our data.</h3><p>we proceed to load the different libraries to read this data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d14adc58cf5e0375ff350041c98166d8/href">https://medium.com/media/d14adc58cf5e0375ff350041c98166d8/href</a></iframe><p>Here we use pandas, matplotlib and sklearn. In order to load our data</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbf4188eabe1c029676c0998c38386e2/href">https://medium.com/media/bbf4188eabe1c029676c0998c38386e2/href</a></iframe><p>here we get the train.csv data set, this is a CSV file, therefore, we have to read it with read_csv from pandas, then proceed to collect the first 5000 of these separating them into images and labels, and then split the data set randomly into test dataset and train dataset.</p><p>Since our image at the moment is one dimensional we have to get the 2-dimensional form of the images.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0a8b24d279da5dfc8d160d9be86a302/href">https://medium.com/media/d0a8b24d279da5dfc8d160d9be86a302/href</a></iframe><p>we select and index i can select a single image img from the dataset using i and proceed to represent it as a matrix, reshaped as a 28x28 grid, using plt from the matplotlib, we can proceed to visualize the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*hCvoXdRqr4E-ED_nktx0Og.png" /></figure><p>So we can recognize this as a 9, cause we can see the patterns of the pixels which make this a 9, but how does a computer recognize this? Well since this is a grayscale image, we can look at a histogram to view the range of the pixel grade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*Sx6ucfYybpSc7JP3nplATg.png" /></figure><p>From the histogram 0 to 250 represent the range of shades, where 0 means there is no shade at all and 250 means maximum shade, so from the image the areas that are black are 0 and the areas which are of maximum white are 250, therefore all the other shades in between are show between 0 and 250.</p><h3>Training our model.</h3><p>In this case, we use the svm to create a vector classifier, next we pass our training data into the fit method of the classifier which trains it into a ninja, just kidding.</p><p>Next, the test Images are tested and score to access the model</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/773fee0f5e1de630ff2e6248068a3a1b/href">https://medium.com/media/773fee0f5e1de630ff2e6248068a3a1b/href</a></iframe><p>This shows that our model has a 0.1 accuracy, this is really bad, its like randomly guessing shit. We can understand this if we look at the intricacies of support vector machines, they find it hard to classify this type of data with multiple input / pattern scale, the grayscale image shows that we have about 250 different shade levels to consider, it can we really difficult to find a straight line optimiser dividing these classifications to represent the pattern, but what if we make every grayscale shade above 0 to become 1.</p><p>Thus making our image more like black and white.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3bfc8c7e9b30cf2525746b1666708c4/href">https://medium.com/media/f3bfc8c7e9b30cf2525746b1666708c4/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*nr_a95Uxn5wReLagFJzFIA.png" /></figure><p>based on the histogram, we should be right on point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*ADwqnsB3OZ727B5-VqL6cQ.png" /></figure><h3>Retraining our model</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b948df08ea43235fa71052aba3e7670d/href">https://medium.com/media/b948df08ea43235fa71052aba3e7670d/href</a></iframe><p>Our algorithm’s proficiency just increased to 88.7 % which is certainly better.</p><p>Based on this we can see the limits of the algorithm, in this case, we have to convert to a black and white pattern or should I say distinct pattern before the Support vector machine technique could even recognize the patterns effectively, but even, 88.7 percent is not exactly the best. But its something.</p><h3>Conclusion.</h3><p>Recognizing digits — in other words recognizing patterns based on training is a tough feat for computers and programs, SVM aims to solve this by drawing distinct lines to classify the various different parameters of this patterns, but it fails sometimes pretty miserably in some more complicated data forms. we could try to improve this by changing the various parameters of the vector classifier, but there are better solutions, in our next week’s post we are going to have a look at the neural network approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e4f28c31099" width="1" height="1" alt=""><hr><p><a href="https://medium.com/a-year-of-ml/recognizing-digits-the-hello-world-of-machine-learning-8e4f28c31099">Recognizing digits — (the hello world of machine learning).</a> was originally published in <a href="https://medium.com/a-year-of-ml">A year of ML</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Vectors.]]></title>
            <link>https://medium.com/a-year-of-ml/getting-started-with-vectors-a12f3f72d179?source=rss----51932ea27838---4</link>
            <guid isPermaLink="false">https://medium.com/p/a12f3f72d179</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Osita Chibuike]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 04:59:28 GMT</pubDate>
            <atom:updated>2019-01-14T04:59:28.467Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*T2lM5S0cZdJCjb9_qMMloQ.png" /></figure><p>Machine learning seemingly at its core can be defined as a massive operation on the concepts of vectors, This is strictly my definition, my way of making this world of ours small and easy to understand. Vectors are the ways in which we represent data in machine learning, and linear algebra, the core mathematical concept behind the bulk of ML. For many people, math is not fun and seemingly can never be that’s why I decided to take a unique approach to it, not what we would consider the textbook approach. So let’s dive in one easy step at a time.</p><h3>Meet the vectors, don’t be shy.</h3><p>Many of us already know vectors, were told about them while in school, those little guys, who seem to have it all magnitude and direction, but this never really explained them, why? because it was a one angle view. you see.</p><blockquote>The Mathematician, The Physicist and the Data analyst see vectors differently, and it balances out in the Mathematician’s point of view.</blockquote><p>So how do they really see it.?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pm5wiv6RCyDbOgTnW1-5rg.png" /></figure><h3>Image of the 3 representations here.</h3><p>In physics, vectors are usually represented with an arrow, in the data scientist’s point of view, its a list of numbers, but in the mathematician’s point of view, it balances.</p><p>See with the cartesian plan vectors are really just arrow points from the origin which can be represented with paths from the x and y-axis.</p><p>And that’s what a vector is in representation because they are able to define any points in space, 2D, 3D etc, i.e with reference to an origin on the plain of sorts. To a data analyst, this is key because it means they can defined data how they see fit.</p><h3>The only things Vectors really do.</h3><p>Interestingly in the world of linear algebra, math in general and physics, vectors only really do two things.</p><ul><li>Being added together</li><li>And scaling or expanding.</li></ul><p><strong>Vector Addition</strong></p><p>The concept of adding vectors was usually about counter-intuitive to me, but it always did come together. So let’s look at it in a cooler way.</p><ul><li>Image of the representations for vector addition.</li></ul><p>Let’s consider two vectors on the plane,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*BKtN0g-I_0hn_b_9M9VfpA.png" /></figure><p>adding these two vectors can simply be viewed as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*vwV9S9woCCDBnjxcEpjNCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*iW_XVvi1TZugJVwdoMWpiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*oFberTe9au78iN6bq_Zo5g.png" /></figure><p>Based on the plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OI2CzJRKlBjwVg9QfBjsxw.png" /></figure><p>Adding one vector to another can be considered, as shown above, first, we represent one vector with the ends of another at the head of the first, (in fact in linear algebra, this is the only time we take a vector ends off the origin. and we consider the motion from the tail of the former to the new head position of the second one. Therefore adding two vectors is just like looking at the motion of the vector tail to the new vector head if they were head to head. Simple right?.</p><h3>Scaling and expansion of vectors</h3><p>Vectors can also be scaled as we mentioned earlier, so a vector with the notion</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*ar0Vog11AAfGjk7pW5jaZA.png" /></figure><p>If we are thinking of scaling it, we are thinking of increasing its length. So if we scale this vector by 3, we are increasing its length by 3, i.e</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*j3CO0byv5P5H3lFTKrtpIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*LWXX_ym-2NwxcbR4LI0Qww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*Xsde2k2ZSoVErg2i77xqLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*NMUQCXgrtJn4hTfBqnY_UQ.png" /></figure><p>e.g We can consider this graphically on a vector</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*whbUpw9IrcrBF8OTMk3QFQ.png" /></figure><p>Being scaled by a factor of 3, this would transform the vector from this..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*s1BTGVc3l3zHcKCL0STL8w.png" /></figure><p>to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*lQJxfys-wNaogNQrNgssRA.png" /></figure><p>Thus scaling is simply extending.</p><h3>Vectors in Machine Learning.</h3><p>The idea of vectors in really important in machine learning as it gives us the abilities as data scientists to express groups of data, in may different nearly unlimited dimensions. This is important especially when we look to place labels and features.</p><blockquote>Features are inputs, labels are output.</blockquote><p>Imagine this for a certain dataset of multiple items having one or more features and labels. Vectors also for the premise around tensor and how they are manipulated and created.</p><h3>Tricks around Vectors.</h3><p>Vectors themselves, mathematically are a function of the plane upon which they operate, For example, let’s consider the cartesian plane. with x and y-axis.</p><p>If we consider the smallest unit of the direction on the plane, in each direction x and y, we could tag them</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*xOsB_2c0QWv82oITufLAWA.png" /></figure><p>with the i-vector pointing to a unit direction in the x-axis, and j-vector a unit direction in the y-axis, therefore all vectors on this plane can be described by these two unit vectors, e.g let consider</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*ar0Vog11AAfGjk7pW5jaZA.png" /></figure><p>the unit vectors representation would be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/112/1*WSKwcjNN5-TdtUhrb9eiWA.png" /></figure><p>i.e a single unit vector in the x-axis and 3 unit vectors on the y-axis.</p><p>Pretty simple right?.</p><h3>Little on linear transform.</h3><p>With these operations in place, we are poised to consider the intricacies of linear transformations, This is one of the crucial aspects of linear algebra, they are key to understanding matrices and the various processes operating on them. In our next session, we shall take a deep dive into this.</p><h3>Conclusion.</h3><p>In this session, we got to simplify and understand vectors they are pretty little concepts to understand data and its representation in both physics and mathematics, understanding these two is key to understanding its meaning and implications as a data scientist, In our next post we shall look at linear transformations and Matrices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a12f3f72d179" width="1" height="1" alt=""><hr><p><a href="https://medium.com/a-year-of-ml/getting-started-with-vectors-a12f3f72d179">Getting Started with Vectors.</a> was originally published in <a href="https://medium.com/a-year-of-ml">A year of ML</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started — from novice to somewhere in the middle]]></title>
            <link>https://medium.com/a-year-of-ml/getting-started-from-novice-to-somewhere-in-the-middle-e66bd0e39715?source=rss----51932ea27838---4</link>
            <guid isPermaLink="false">https://medium.com/p/e66bd0e39715</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Osita Chibuike]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 21:29:54 GMT</pubDate>
            <atom:updated>2019-01-06T21:29:54.517Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started — from novice to somewhere in the middle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*yCrFCAmgOukq6SKrO-dBJw.png" /><figcaption>Image source, Digital ocean, just have to say its kinda rad.</figcaption></figure><h3>Introduction</h3><p>Late last year I decided to learn the 3 major development trends in modern day technology. I can’t remember the third, A decision which leads me to 2 major fields of computing technology which I felt would really change the future. These were Machine learning and Blockchain development. but they both had their constraints. One dealt with a lot of data and the other dealt with developing totally decentralized systems.</p><p>Machine learning gives computers the ability to understand patterns and relationship between a set of inputs and output data, for example between a set of Images representing handwritten numbers and a set of actual integers or numbers. While Blockchain development allowed us to build systems which do not run on a centralized server or service, therefore allowing applications to existing as their own entities without any need for central control.</p><p>These two technologies combined can create a future whereby we’d have software capable of initiating transactions out of their own will (will here meaning decision, I’m not implying Skynet). Machine learning is possibly the future of Artificial intelligence, but its such a crucial fields, such that one can’t sit on the sidelines while someone else develops sky-net. More people have to get involved because computers are going to get smarter and better, continually doing more and more of what man can do.</p><p>In this path, I decided to take on a personal process in learning Machine learning and I aim to share my process as I learn the ropes. therefore this is for the beginners in Machine learning, from one beginner to another, welcome.</p><p>I could go on about the history of Machine learning, but I’m quite certain you can google them and get to learn its history, but we are going to learn from the present. I’m a big advocate of sequential learning, and it’s important to follow a learning path, like a curriculum to help get the ideas and process down and right.</p><h3>Our Learning path.</h3><ul><li>Regression and Regressions theories</li><li>R squared Theory, Best fit line, Best fit slope</li><li>Data representations.</li><li>Classification</li><li>Supervised learning</li><li>K nearest neighbors</li><li>Support vector machines</li><li>Deep learning</li><li>Unsupervised learning</li><li>Decision Trees.</li></ul><p>For the first portions, we are going to have to find our roots in the basic math for machine learning and getting on with it. If you were a good student, I’m pretty sure you’d remember most of these, in minute versions though, but we are going to hone in our focus on the following fields of math.</p><ul><li>Linear algebra</li><li>Multivariate Calculus</li><li>Principal Component Analysis</li><li>Baysean Theorems</li></ul><p>here’s our curriculum.</p><h4>Linear Algebra</h4><p>Vectors</p><ul><li>Vector operations</li><li>Dot products</li><li>Modulus and inner product</li><li>Projection</li><li>Basis, Vector space and linear independence.</li><li>Dot product of vectors.</li><li>Linear dependency of a set of Vectors</li></ul><p>Matrices: Objects that operate on vectors.</p><ul><li>Matrices vectors and solving simulataneous equations.</li><li>How matrices transform space</li><li>Matrix Transformation.</li><li>Composition or Combination of matrix transforms</li><li>gaussian elimination.</li><li>Determinants and inverse</li></ul><p>Matrices making Linear Mappings.</p><ul><li>Einstein Summation convention and symmetry of the dot product.</li><li>The Gram-Schmidt process.</li></ul><p>Eigenvectors and Eigenvalues</p><ul><li>What are eigenvalues and eigenvectors.</li><li>Eigenvalues and Eigenvectors in Page rank.</li></ul><h4>Multivariate Calculus.</h4><p>Multivariate Calculus</p><ul><li>Functions</li><li>Derivatives</li><li>Product rule</li><li>Chain rule</li><li>Variables, Constants and Context</li><li>Jacobian</li><li>Hessians</li></ul><p>Multivariate chain rule and its application.</p><ul><li>Multivariate chain rules.</li><li>Simple Neural networks</li></ul><p>Taylor series and linearisation.</p><ul><li>Introduction to Optimizations</li><li>newton-raphson</li><li>Langrange multipliers</li><li>Gradient descent.</li></ul><p>Regression.</p><ul><li>Simple linear regression.</li><li>General non-linear least squares.</li></ul><h4>PCA: Principle Component Analysis</h4><p>Statistics of datasets</p><ul><li>Mean of a dataset</li><li>Variance of a one dimensional datasets.</li><li>Variance on higher dimensional datasets.</li></ul><p>Inner products.</p><ul><li>Definition of Inner products.</li><li>Length of vectors</li><li>The distance between vectors.</li><li>Angles and orthogonality</li></ul><p>Orthogonal Projections.</p><ul><li>Projections on 1D subspace</li><li>Projections on higher-dimensional subspaces.</li></ul><p>Principal Component Analysis.</p><ul><li>Problem setting and PCA objective</li><li>Finding the coordinates of the projected data</li><li>Reformulation of the objective</li><li>Finding the basis vectors that span the principal subspace</li><li>Steps of PCA</li><li>PCA in high dimensions</li></ul><p>Seems like a lot right, well each category is supposedly a week of study and writing, therefore, that would probably be about. 13 weeks of mathematical acclimatization. Before we get into the nitty-gritty of ML. Like I said earlier this is my learning experience.</p><p>These we’ll have to take into account clearly before we proceed into the machine learning path, laid above. Machine learning as a field is really broad and deep, therefore there a lot we can get lost in. This series aims to get us on a path, via which we can learn the ropes and not feel like a fish out of water when machine learning is mentioned.</p><p>In order to provide an adequate balance between math jargons and code, most of the code references in the series would be compiled into a jypyter note which would be provided on a GitHub link for running testing and checking shit out. The idea is to get up and running in as little time as possible and learning via doing.</p><p>Some theory here and there, rooted with practice and practical approach.</p><h3>Conclusion.</h3><p>Machine learning is a field that changes really fast, deeply rooted in mathematics and therefore requires a real good understanding of mathematical concepts around vectors, matrices, calculus, and statistics.</p><p>It’s a tough beast, but I believe I’ll be able to take it down.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e66bd0e39715" width="1" height="1" alt=""><hr><p><a href="https://medium.com/a-year-of-ml/getting-started-from-novice-to-somewhere-in-the-middle-e66bd0e39715">Getting Started — from novice to somewhere in the middle</a> was originally published in <a href="https://medium.com/a-year-of-ml">A year of ML</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>