Linear Regression
This is one of machine learning’s lightly interpreted algorithms out there. Often always taught using abstractions that kills the beauty of this interesting algorithm. Let’s look at this algorithm from the ground up. First for any supervised machine learning, we need a dataset. Let’s construct a simple one. $$ (x_1, y_1), (x_2, y_2), (x_3, y_3)...(x_n, y_n) $$Here, $x_i$ is the input to the algorithm and $y_i$ is the output from the algorithm. Practically, the input $x_i$ can of arbitrary dimension belonging to $\mathbb{R}^m$, where m is the number of independent features in the input. But, for simplicity we are going to work with $x_i$ belonging to $\mathbb{R}^1$. ...
Attachments in Life
The one thing I struggle with the most in my life is attachments. There are several types of attachments: Attachment to people Attachment to objects Attachment to places Among these, objects and places seem to be of no issue to me. I can live separated from the things I love and places I love. But, that’s not the same with people. People I’m with matter to me the most. As someone, who is unfazed by web series, movie releases or social media, I prioritize person-to-person one-to-one mind-to-mind conversations with the people I love. Something I did effortlessly before COVID-19. After COVID-19, people became distraught about physical interactions. A person so comfortable talking via text, becomes distraught and overwhelmed when meeting in person. There’s always an unhinged awkwardness when meeting in real life. ...
HDFS and MapReduce: Revolutionizing Big Data Processing
HDFS and MapReduce can be confusing at times. Let’s break down the entire process step-by-step with a concrete example. The example I’m going to use is calculating the average movie rating per genre from a CSV file. First, we have to upload the CSV file into HDFS, and then we will run a MapReduce job to compute the average ratings. We assume: Data format: genre,rating Goal: average rating per genre ...
Regular Expressions
In this blog, we are going to explore the world of regular expressions Regular expressions are used for parsing and validating strings especially in applications of Natural Language Processing 1. Literals Pattern Meaning cat Match all occurences of “cat” anywhere inside the text 2. Character Classes Pattern Meaning [abc] a or b or c [a-zA-Z0-9] Any lowercase or uppercase or digit [^a-z] Anything except lowercase 3. Quantifiers Pattern Meaning * 0 or more occurence + 1 or more occurence ? 0 or 1 occurence {n} Exactly n occurences {n,} n or more occurences {n, m} Between n and m occurences 4. Anchors Pattern Meaning ^ Start of a string $ End of a string \b Word boundary \B Non-boundary 5. Grouping Pattern Meaning (abc) Grouping (useful for extraction) 6. Alternation Pattern Meaning a|b Alternation (a or b) 7. Escape Sequences Pattern Meaning \. When you want to use a “.” or any other symbol in literal sense use “\” as an escape sequence 8. Predefined Classes Pattern Meaning \d digit(0-9) \D non-digit \w word char (letters, digits) \W non-word char \s whitespace \S non-whitespace Python re module Search ( Find first occurence of the pattern in the text ) Find first word starting with capital letter ...
Forward and inverse kinematics of a 2-link manipulator
The 2-link manipulator is a fundamental robotics system that is used by robot enthusiasts to understand the principles of kinematics. A 2-link manipulator consists of two rigid links connected by revolute joints, allowing for planar motion. In this post, we will explore the forward and inverse kinematics of a 2-link manipulator. Forward kinematics - Given joint parameters, what is the position of the end-effector Inverse kinematics - Given the position of the end-effector, what are the joint parameters ...
Computer Security: Data Encryption Standard (DES)
DES is a symmetric-key block cipher that follows the Fiestal Cipher structure. The steps involved in encryption are: Apply an initial permutation to the 64-bit input block using a permutation matrix Similar to the Fiestal Cipher structure, split the 64 bit output after permutation into 2 halves \(L_0\) (32 bits) and \(R_0\) (32 bits) Compute F(\(R_0\), \(k_0\)) using expansion, XOR, S-boxes, and permutation Set \(L_1\) = \(R_0\) and \(R_1\) = \(L_0\) XOR F(\(R_0\), \(k_0\)) Now, this concludes the first round. Now, do steps 3-4 15 more times After round 16, perform a 32-bit swap like in Fiestal Cipher structure Undo the initial permutation to get the cipher text ...
Make your own site like me using Hugo with PaperMod theme
This blog will help you build your own blog site using Hugo with PaperMod theme and deploy it in github pages for $0 1. What is Hugo ? Hugo is a fast static site generator. It converts Markdown files into a full HTML, CSS, and Javascript site using a theme. Advantages: Extremely fast serving after deployment Intuitive folder based structure Great for blogs and portfolios Works effortlessly with Github Pages 2. Prerequisites Make sure git is installed. git will help you deploy your site to Github pages as well as add themes to your hugo site If you don’t have git, please refer to: Git Installation ...