In my last article, I explained Linear Regression which is used to predict a continuous value like a stock or a house price. The value can be any real number. But there is another type of important problem in machine learning, the classification problem. This article will cover how logistic regression works and how it can be used to solve the classification problem. If you have not read my last article (https://ahaanpandya.medium.com/linear-regression-explained-868914443188), I highly recommend to read it before this.

We will first take a look at Binary Classification which involves classifying inputs into only two classes. For example, classifying…

In my last article, I focused on how the algorithm works and the theory behind linear regression but now in this article, I will focus on implementing it in Python, which is an excellent programming language for Data Science and Machine Learning. If you have not read my last article, I highly recommend to read it here: https://ahaanpandya.medium.com/linear-regression-explained-868914443188

Note- I will be using Pandas and Numpy which are python data science libraries and if you are not comfortable with Numpy and Pandas then you might want to look up a tutorial on those libraries. …

Linear Regression is one of the most fundamental algorithms in Machine Learning you will ever encounter. Linear Regression involves fitting a linear function through the data which can be used to predict a continuous linear value like prices, stocks, houses, etc. A continuous value is anything that can be any real number. Regression involves predicting continuous real values and classification involves predicting classes. But this article will only cover regression.

Note: This article will use university mathematics so a strong grasp on multivariable calculus (especially partial derivatives) and linear algebra is recommended.

This article will teach you how single variable…