Posts

Computing Expressions

So, right now I'm applying for various internships. And one of them reached out to me with an assessment link. The link had 90 mins and gave me 2 questions to solve. I'll be sharing those questions and my answers here. I'll make it a 2 part series, because (I'll be honest) I couldn't solve the second question. So, I guess I have another week to figure it out, and the solution to the next question would be my next blog.  Anyways, without further ado, here's the first question : Write a program that takes a single line of input, representing an arithmetic expression. The expression will consists of numeric digits (0-9), the plus operator (+) and the multiplication operator (*). The given expression will be a valid arithmetic expression (i.e., "*2++" is not valid). Your task is to evaluate the arithmetic expression, following the normal rules of operator precedence, and print the result without any leading or trailing whitespace. The resulting number will

Blogging Again

It's a blog, ain't it? It's been a good 2 years since I was last actively posting. So, here's a personal blog of things that have been going around with my life and with this blog, and where it's headed I've been thinking about the direction I want to take with this blog. But first, a little bit of history Why did I create this blog? The motive was to teach along as I learnt. Often, the experts of the field forget the small challenges they faced when they were new to the field. So my idea was to target this and provide a beginner's perspective to the topics I was learning. This didn't work out for me because teaching any particular topic would require me to research further into that particular topic and this would take a lot of time. Time that I could invest in better moving forward in the path of learning ML. I couldn't just write what I learnt because then it wouldn't be any different from notes. So, I stopped. Eventually, after completing man

Data Mining

Image
Image Source :  https://www.stitchdata.com/resources/what-is-data-mining/ Once a spam filter has been trained on enough spam, it can easily be inspected to reveal the list of words that it believes  are the best predictors of a spam. Sometimes, this will reveal unsuspected correlations or new trends, and thereby leas to a better understanding of the problem. Applying ML techniques into large amount of data can help discover patterns that were not immediately apparent. This is called data mining . Data mini ng is a process of extracting and discovering patterns in large data sets involving methods at the intersection of machine learning , statistics , and database systems

Navigating Around Bash

Image
The directories in Ubuntu are in the following order: By default when you open Ubuntu, you'll land on /home/<username> which in my case is /home/saatweek To confirm this, type in  pwd pwd stands for p resent w orking d irectory, and will show the absolute path of whatever directory you happen to be in (as seen above). To go to the previous directory, type cd .. Since we're currenly at /home/saatweek/ , typing that once would take me to /home/ and typing it again would take me to the root, i.e., / Check it out for yourself and type in pwd to see the present working directory at each step Remember, / means you're in the root directory To l i s t all the directories and files that are in the present working directory, type in  ls It's not all though, ls may take in 3 types of arguments as well -a , -l , and -la Ubuntu has some hidden files, that are by default, not shown, or listed by the ls command. To show all the hidden files, type in  ls -a Notice the additi

Setting up Ubuntu and GCC

Image
  While there are lots of flavors of Linux and lots of ways to install each of them, I think this way to go, if you're just starting with Linux and just want something light to get started with. Ubuntu can be freely downloaded on Microsoft Store. Just open the store and search for "Ubuntu" Download that plain vanilla Ubuntu. I wish I could say that this is it and you can now start using Ubuntu, but as with everything else in Linux, it's not that simple. You'll now have to enable the "Windows Subsystem for Linux" To do that, click on the start button and type, "Turn Windows features on or off" After clicking on that option, scroll down and enable "Windows Subsystem for Linux" by checking on the blank box beside it Enabling that will prompt the restart for your system, do that. And now Finally! Installation complete!!! You should now see Ubuntu's icon on your start menu When you first open Ubuntu, it will ask for a username. Select

Plotly

Image
Plotly is a python library used for data visualization. That's all there is to it.  And while the most commonly used data visualization tool is MatPlot, we'll be using Plotly simply because it's newer, more interactive, provides more features and is usually much more attractive (this one is actually the main reason I'm using this :D ) For Example, here's a sample graph from their own website  Later in the article, we'll see how to make it ourselves, so keep on reading... This is something I made..(PS. You can interact with it) Alright!  Now let's begin with installing the necessary package, i.e., Plotly I'm sure that by now, you already have some decent  experience on working with environments and downloading packages and libraries. If you don't, or if you just need a reference, check out the following  link . Now the basics. Plotting in Plotly follows a similar (almost same actually...wait, that's what similar means....yeah, so... similar) patte

Activation Functions

Image
Why Do We Need Activation Functions? Let's take the previous equations in the earlier simple neural network, remove the activation functions and see what happens. We had the following equations: $Z^{[1]} = W^{[1]}A^{[0]} + b^{[1]}$   $A^{[1]} = \sigma (Z^{[1]})$  $Z^{[2]} = W^{[2]}A^{[1]} + b^{[2]}$  $A^{[2]} = \sigma (Z^{[2]})$  Let's remove the activation function now. No Actually. A better way to do it, would be to replace the sigmoid activation function with a linear one, such that g(z) = z. Therefore, applying a linear activation function, we now have $Z^{[1]} = W^{[1]}A^{[0]} + b^{[1]}$   $A^{[1]} =  g(Z^{[1]}) = Z^{[1]} $  $Z^{[2]} = W^{[2]}A^{[1]} + b^{[2]}$  $A^{[2]} =  g(Z^{[2]}) = Z^{[2]}$  All of which are linear functions Now we have $A^{[2]} =  Z^{[2]} = W^{[2]}A^{[1]} + b^{[1]}$ Substituting $A^{[1]}$ with  $W^{[1]}A^{[0]} + b^{[1]}$, we have $A^{[2]} = W^{[2]}(W^{[1]}A^{[0]} + b^{[1]}) + b^{[2]}$ $\implies A^{[2]} = (W^{[2]}W^{[1]})A^{[0]} + (W^{[2]}b^{[1]}+b^{[