Queue is one of the simplest and most useful data structure, not just in computer science, queues are relevant in our day to day life in lot of different fields.

In this post, we will discuss why queues are so important, how they are used in computer science and finally look at its implementation in Python and C++. The goal is to understand the queue pattern, and understand why they exist, this will hopefully help you appreciate queues and want to learn it.

So what makes queues special ? A queue is a data structure that follows First In First Out — which means the first item to enter the queue is the first to leave the queue. …

Stack is one of the most popular and widely known data structures in computer science, and one of the easiest to learn and understand. But often, maybe because of the way it is introduced or taught, it seems kind of useless and boring to learn.

Stacks are not one of those useless things that you need to learn just to pass your exams or to crack the coding interview, but they are actually used for a lot of things that you do daily on the computer.

- They are the building blocks of function calls and recursive functions. Yes, this is a common application that you maybe aware of, but think about it — right now there are hundreds (if not thousands) of functions existing on your call stack in memory maintained by your OS. Every time a function is called, some memory is reserved (PUSH) for it on the call stack, and when it returns, the memory is deallocated (POP). …

Neural Networks have taken over the world and are being used everywhere you can think of. There are a lot of posts out there that describe how neural networks work and how you can implement one from scratch, but I feel like a majority are more math-oriented and complex, with less importance given to implementation. My main focus today will be on implementing a network from scratch and in the process, understand the inner workings.

The goal of this post is to walk you through on translating the math equations involved in a neural network to python code. …

COVID-19 has taken over the world and brought the entire world to a stand still in just a few months. Total cases in the world will be half a million soon and over 20,000 deaths have been confirmed. The worrying part is the graph of total cases is still exponentially increasing, and showing no signs of slowing down.

Flattening the curve by social distancing seems to be the only way out of this. Many countries have been locked down in the past few weeks, and people have been asked to strictly stay at home. …

In statistics logistic regression is used to model the probability of a certain class or event. I will be focusing more on the basics and implementation of the model, and not go too deep into the math part in this post.

*This is a written version of this video. Watch the video if you prefer that.*

Logistic regression is similar to linear regression because both of these involve estimating the values of parameters used in the prediction equation based on the given training data. Linear regression predicts the value of some continuous, dependent variable. Whereas logistic regression predicts the probability of an event or class that is dependent on other factors. Thus the output of logistic regression always lies between 0 and 1. …

First of all make sure you have OpenCV installed. You can install it using pip:

`pip install opencv-python`

Face detection using Haar cascades is a machine learning based approach where a cascade function is trained with a set of input data. OpenCV already contains many pre-trained classifiers for face, eyes, smiles, etc.. Today we will be using the face classifier. You can experiment with other classifiers as well.

You need to download the trained classifier XML file (haarcascade_frontalface_default.xml), which is available in OpenCv’s GitHub repository. Save it to your working location.

To detect faces in…

I just turned 20 last month. So here are 20 lessons that I have learned from life over all these years.

Hard work eventually pays off and there are no shortcuts or substitutes to replace it. If you want to master any skill then you have to put in the work. All you can do is improve efficiency by doing focused and smart work.

Health is a huge factor for success in any field. By health I mean physical as well as mental health. You need to have the physical energy to work as well as a healthy mind to focus your attention and deal with stress. …

Every time we read an article about how to be more productive, we feel motivated for the next week, or maybe few days or even the next few hours. Then the drive slowly wears out and we are back to our old ways again.

I think that rather than trying to be productive, our goal should be to be more consistent. Making progress every day, taking small steps and being patient. So I thought of putting together 4 productivity ideas that I use and have worked for me.

Always start with why. Why do you work? Why is it that you do what you do? Once you have a clear sense of why, you are half way there. Your why is your motivating force. It should be something that makes you jump out of bed every morning and drives you throughout the day. …

In this quick post, I wanted to share a method with which you can perform linear as well as multiple linear regression, in literally 6 lines of Python code.

In statistics, linear regression is a linear approach to modelling the relationship between a dependent variable and one or more independent variables. I you would like to know more about linear regression and how it is implemented, check out these two methods to perform Linear Regression from scratch:

Today to perform Linear Regression quickly, we will be using the library scikit-learn. If you don’t have it already you can install it using…

In this tutorial you can learn how the gradient descent algorithm works and implement it from scratch in python. First we look at what linear regression is, then we define the loss function. We learn how the gradient descent algorithm works and finally we will implement it on a given data set and make predictions.

*This is the written version of this video. Watch it if you prefer that!*

In statistics, linear regression is a linear approach to modelling the relationship between a dependent variable and one or more independent variables. Let **X** be the independent variable and **Y** be the dependent variable. …

About