Classification is one of the two branches of Supervised Learning. As the name suggests it divides objects into groups or classes based on their features.

Logistic Regression is among the most used Classification algorithms. In this paper, I will show the Python implementation of the algorithm. It will continue step-by-step and we will build the algorithm from scratch.

Now let’s dive into the code!

1. Loading and data preparation.

Initially, the pandas module will be imported and the csv file containing the dataset will be read using “read_csv” and first 10 rows will be printed out using “head” function:

import pandas as pddf = pd.read_csv('Social_Network_Ads.csv')
print(df.head(10))


Yəqin ki, hamımız dedektiv janrda yazılmış əsərlərlə tanışıq. Dedektiv problem ilə tanış olur, daha sonra sorğu-sual edərək məlumatlar toplayır və sonda həmin məlumatlar arasında məntiqi uyğunluq quraraq qatilin kim olduğunu tapır. Bəzən bizə lazım olan bütün informasiyanı bilsək də, problemi həll etmək üçün bu kifayət etmir. Həmin məlumatları sistemləşdirməli, hansının daha lazımlı olduğuna qərar verməli və məsələyə düzgün şəkildə yanaşaraq ən optimal həll yolunu tapmalıyıq.

Machine Learning mühəndislərinin işini də xəfiyyələrin işinə bənzədə bilərik – qarşıda duran problemlə tanış olurlar, müxtəlif üsullarla (ictimai sorğular, şirkətin keçmiş illərdəki nəticələri və s.) …


Python is considered the best programming language for Machine Learning and AI based projects because of its great variety of libraries and frameworks. Scikit-learn is likely the most useful library for Machine Learning in Python. The sklearn library has a lot of efficient tools for machine learning and statistical modeling including classification, regression, clustering and etc.

In this paper, I will show how to implement Linear Regression algorithm using sklearn library.

For non — library (from scratch) implementation of the algorithm, you can check my previous paper.

Going into the coding part, like any other usage of library in python…


Linear Regression is a Supervised Machine Learning which is used to predict values within a certain range, rather than classifying them into categories.

In this article you can find the implementation of Univariate Linear Regression in Python without using any machine learning library. The code will be explained step-by-step with provided mathematical background.

Outline

  • Theoretical background
  • Python code
  • Summary

Background

You may think that, “I can drive a car without knowing how the engine works”. Yes, you are right. But what if the engine causes a simple trouble while you are on a highway. To wait for the service for hours or…


Linear Regression is among mostly used Machine Learning algorithms. Univariate Linear Regression is the simpler form, while Multivariate Linear Regression is for more complicated problems.

This is my second paper about Linear Regression, first one is on Univariate Linear Regression. You can look through it for getting background knowledge on Linear Regression, basics of Machine Learning algorithms, and better understanding of this paper.

The paper contains following topics:

  • Introduction to Multivariate Linear Regression;
  • Hypothesis of the algorithm;
  • Manipulation of the dataset and matrix multiplication;
  • Cost function;
  • Gradient Descent.

Introduction to Multivariate Linear Regression

In ML problems, there are various datasets, they differ from one another with their dimensions (number of…


Linear Regression (LR) is one of the main algorithms in Supervised Machine Learning. It solves many regression problems and it is easy to implement. This paper is about Univariate Linear Regression(ULR) which is the simplest version of LR.

The paper contains following topics:

  • The basics of datasets in Machine Learning;
  • What is Univariate Linear Regression?
  • How to represent the algorithm(hypothesis), Graphs of functions;
  • Cost function (Loss function);
  • Gradient Descent.

The basics of datasets in Machine Learning

In ML problems, beforehand some data is provided to build the model upon. The datasets contain of rows and columns. …

Anar Abiyev

Process Automation Engineering Student, Machine Learning Learner

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