<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ML from scratch on Low Latency Log</title><link>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/</link><description>Recent content in ML from scratch on Low Latency Log</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 14 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/index.xml" rel="self" type="application/rss+xml"/><item><title>K-Nearest Neighbors from scratch</title><link>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/knn-from-scratch/</link><pubDate>Wed, 16 Sep 2026 00:00:00 +0000</pubDate><guid>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/knn-from-scratch/</guid><description>&lt;h2 id="k-nearest-neighbors"&gt;K-Nearest Neighbors&lt;/h2&gt;
&lt;p&gt;The K-Nearest Neighbors (KNN) algorithm is a simple and intuitive algorithm that can be used for classification and regression tasks.&lt;/p&gt;
&lt;p&gt;In discrete distributions any new data point is given, the algorithm will find the K-nearest neighbors of new points and predict the class of the new point based on the majority vote of the K-nearest neighbors(Generally, K is odd to avoid ties).
In case of continuous distributions, the distance between the new point and the K-nearest neighbors is calculated and averaged to get the predicted value.
Unlike linear and logistic regression, KNN does not require a linear model to be trained. There are no parameters to be tuned. Its a lazy learning algorithm, the calculations are done at the time of prediction.
The distance between the new point and the K-nearest neighbors is calculated using the Euclidean distance. However, other distance metrics can be used as well such as Manhattan distance, Minkowski distance, Cosine distance etc.&lt;/p&gt;</description></item><item><title>What's Logistic Regression?</title><link>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/logistic-regression-from-scratch/</link><pubDate>Mon, 14 Sep 2026 00:00:00 +0000</pubDate><guid>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/logistic-regression-from-scratch/</guid><description>&lt;p&gt;Previously, I talked about how linear regression worked and implemented it in Python from scratch. This post is about understanding and implementing logistic regression from scratch. I will talk about what logistic regression is, how it works, and why we use it.&lt;/p&gt;
&lt;h1 id="intro"&gt;Intro&lt;/h1&gt;
&lt;p&gt;Unfortunately or fortunately, the field of ML cannot be discussed without understanding the underlying mathematics on which it is built.&lt;/p&gt;
&lt;p&gt;Similar to linear regression, we are approximating some parameters and then using them to make predictions. However, unlike linear regression, we are not predicting a particular value but rather trying to classify an input into a category.&lt;/p&gt;</description></item><item><title>What's Linear Regression</title><link>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/linear-regression-from-scratch/</link><pubDate>Mon, 24 Aug 2026 00:00:00 +0000</pubDate><guid>https://loonins.github.io/lowlatencylog/posts/ml-from-scratch/linear-regression-from-scratch/</guid><description>&lt;p&gt;Machine Learning works by training a set of parameters and using them to predict future data. But what are these parameters and how do they work? Why are there so many of these algorithms?&lt;/p&gt;
&lt;p&gt;Each ML model is essentially a mathematical function whose parameters are optimized to best fit our data&lt;/p&gt;
&lt;p&gt;In this blog, I demonstrate how a linear regression model works, why we use it and understand how it predict data and what&amp;rsquo;s it&amp;rsquo;s &amp;ldquo;learning&amp;rdquo;.&lt;/p&gt;</description></item></channel></rss>