Welcome back! This is part 3 of the Linear regression model from scratch. In this article, we will be exploring the famous “Stochastic gradient descent(SGD)” algorithm. I will attempt to explain the intuition of how this very popular algorithm works, and what makes it different from the simple Batch gradient descent algorithm explored in the last series. If you have not seen the previous articles on this subject, find the links embedded here: Part1 and Part 2. Do read them, as this article builds on what has been discussed earlier on.

In the previous article, we discussed the use of…

In my previous article on Linear regression, I gave a brief introduction to linear regression, the intuition, the assumptions, and two most common approaches used for solving linear regression problems. The previous article focused on one of the approaches; “the Closed Form solution(Analytical Approach)”. In this article, the focus will be on the second approach: “Numerical Approach”, in specific, one type of the numerical approach called the “Gradient Descent(GD Algorithm)”.


In real life scenario, most problems (or atleast the ones we are interested in Machine learning), do not have exact solutions as proposed by the Closed form solution. Aside this…

The Linear Regression is considered the most natural learning algorithm for modelling data, primary because it is easy to interpret and models efficiently most natural problems. It belongs to the family of “Linear Models/Predictors” in machine learning(one of the most useful hypothesis space). Although, there are various ways of implementing this algorithm(including using the Sklearn library in Python, it is just as important to understand the basic intuition behind this algorithm and how libraries such as Sklearn work behind the scenes.

Source: Wikipedia

Assumptions of the Linear Regression Model

  • It assumes a linear relationship between the dependent and independent variables.
  • It assumes…

In the previous series, we built a simple version for the ‘Hangman game in Python”. In this series, we are advancing forward, improving on the previous program, and testing our skills.

As mentioned in the previous series(view here), the HANGMAN GAME is all about solving a puzzle and guessing a word or phrase correctly before the ‘hanging man dies’. An image is usually displayed, where a hanging man slowly begins to appear, bit-by-bit, for every wrongly guessed word, and a life/chance or try in the game is lost.

Hey there Python rockstar! Welcome to another interesting Project. It’s that time of the week, put on your Coding armour , let’s go conquer another task.

Source Here


One of those classic word guessing games played between two or more players. One player sets or defines a word or list of words, and the other player(s) have to guess correctly, given a certain number of trials. It is quick, easy, educational and most times requires only a piece of paper and the ability to spell correctly. It could also be played with a computer(as the one which will be built in this…

In the previous series, ‘a simple phonebook program’ was built using basic concepts of Functions, data structures, and flow control statements. Taking a step ahead, an improved version will be built today, working towards automation and fewer yet efficient lines of codes. We will apply the knowledge of user-defined modules once again, to get more comfortable with building one.

Excited about this one? Me too. Watch out for an important announcement at the end of the article.

Let’s move on to building the Project for the day.

Source: Here


  • Define an empty dictionary to store contact information as a global…

Hey there Python rockstar! Welcome to another interesting Project. Do you have your Coding gear ready? Let’s go build a mind-blowing project.

Image Source Here

In this article, we will explore how to build a simple phonebook in Python, using a blend of all the concepts learnt so far. Are you excited? 😃Me too!😊

Wouldn’t you agree that it’s a pretty good idea to automate and explore the little daily tasks/routines around, using your programming skills?

In the previous article, we scouted the use of user-defined modules and functions in Python .

So let’s probe further, get comfortable with these concepts, revise previously…

Wow! Look how far we have come. Thumbs up👍🏼. Let’s keep the fire burning.

Remember we built a simple calculator earlier(Link here), and I mentioned we will be revisiting the project to improve its functionality, whilst also learning and exploring more concepts in Python? Well, in this project, we will build a calculator using the concepts of modules and functions in Python. The concept of Modular programming was introduced in the previous project. We explored how modules can be used to improve code efficiency and execution. Recall, I mentioned that modules can be made of variables(which could also be data…

Source: Wikipedia

One of the oldest hand games, dated far back in history, centuries and centuries ago, passed down from generation to generation. It is not known for sure when it first started, however, its first known mention was in the book “Wuzazu” — written by Xie Zhaozhi, in the then Chinese Han-dynasty around 1600, where it was called ‘Shouling’. The game later found its way into the Japanese history, where a variation was created and named ‘Janken’, around 1700.

This hand-game is not just a pass time for most, it is considered as an official game in most parts of the…

We have come so far these last few weeks. Buckle up! more exciting projects coming your way!

This project is all about creating some fun shapes in Python using nested for loops and conditional if-else statements. In this series, we will be creating several patterns, then I will share links to resources and source codes for further exploration.

The first pattern is a “Multiplication Table”. Let’s dive in!

As always, create a new python file, save as “multiplication.py”


  1. Define a variable ‘num’. Use the input function and the int function.
  2. Create an iterative condition using a…

Aminah Mardiyyah Rufai

Data Scientist/Machine learning/AI enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store