Linear Regression from Scratch: A Step-by-Step Guide

Introduction: Linear regression is one of the fundamental techniques in machine learning and statistics used for modeling the relationship between a dependent variable and one or more independent variables. In this tutorial, we’ll delve into the implementation of simple linear regression from scratch using Python. By understanding the mathematical intuition behind linear regression and its … Read more

Decision Trees | Machine Learning from Scratch

Like SVMs, Decision Trees are versatile Machine Learning algorithms that can perform both classification and regression tasks, and even multioutput tasks. They are very powerful algorithms, capable of fitting complex datasets. For example, you trained a DecisionTreeRegressor model on the California housing dataset, fitting it perfectly (actually overfitting it).Decision Trees are also the fundamental components … Read more

SVM Regression | Machine Learning from Scratch

Support Vector Machines

Introduction As we mentioned earlier, the SVM algorithm is quite versatile: not only does it support linear and nonlinear classification, but it also supports linear and nonlinear regression. The trick is to reverse the objective: instead of trying to fit the largest possible street between two classes while limiting margin violations, SVM Regression tries to … Read more

Gaussian RBF Kernel | Machine Learning from Scratch

Support Vector Machine Cover Pic

Introduction In Previous blog we talked about Polynomial Kernel. In this blog we will talk about Gaussian RBF Kernel. Just like the polynomial features method, the similarity features method can be useful with any Machine Learning algorithm, but it may be computationally expensive to compute all the additional features, especially on large training sets. However, … Read more

Polynomial Kernel | Machine Learning from Scratch

Support Vector Machine Cover Pic

In Previous blog we talked about Non Linear SVM Classifications. In this blog we will talk about Polynomial Kernel. Introduction Adding polynomial features is simple to implement and can work great with all sorts of Machine Learning algorithms (not just SVMs), but at a low polynomial degree it cannot deal with very complex datasets, and … Read more

How can A linear model learn non-linear/discrete patterns?

Introduction During model development, one of the techniques that many don’t experiment with is feature discretization. The core idea is to transform a continuous feature into discrete features, mostly one-hot encoded. 𝐖𝐡𝐲 𝐰𝐨𝐮𝐥𝐝 𝐰𝐞 𝐝𝐨 𝐭𝐡𝐚𝐭? My rationale for using feature discretization has almost always been simple: “It just makes sense to discretize a feature.” … Read more

Questions asked in Data Scientist Interviews Part 7

Interview

In this series we bring new Data Scientist Interview Questions. You can read other tutorials related to same topic on our website. What is Cross Validation? Cross-Validation in Machine Learning is a statistical resampling technique that uses different parts of the dataset to train and test a machine learning algorithm on different iterations. The aim … Read more

Nonlinear SVM Classification | Machine Learning from Scratch

Support Vector Machine Cover Pic

In previous blog, We read about Soft margin Classification. In this blog we will talk about Non Linear SVM Classification. Introduction Although linear SVM classifiers are efficient and work surprisingly well in many cases, many datasets are not even close to being linearly separable. One approach to handling nonlinear datasets is to add more features, … Read more

Soft Margin Classification | Machine Learning from Scratch

In previous blog, We read about Linear SVM. In this blog we will talk about soft margin classification. If we strictly impose that all instances be off the street and on the right side, this is called hard margin classification. There are two main issues with hard margin classification. First, it only works if the … Read more

ROC and AUC in Evaluating Classification Models

In the dynamic world of business, where data-driven decisions reign supreme, the accuracy and reliability of classification models play a pivotal role. Whether you’re involved in lead scoring or any other binary classification system, understanding the intricacies of evaluation metrics is key. Among these, the ROC (Receiver Operating Characteristic) curve and its integral companion, AUC … Read more

Support Vector Machines (SVM) Algorithms

A Support Vector Machine (SVM) is a very powerful and versatile Machine Learning model, capable of performing linear or nonlinear classification, regression, and even outlier detection. It is one of the most popular models in Machine Learning, and anyone interested in Machine Learning should have it in their toolbox. SVMs are particularly well suited for … Read more

What is early stopping? | Machine Learning from Scratch

Machine learning models, particularly those trained iteratively using algorithms like Gradient Descent, face the risk of overfitting the training data. One powerful and elegant solution to this challenge is known as “Early Stopping.” In this blog post, we’ll delve into the concept of Early Stopping, explore its effectiveness, and showcase a practical implementation using a … Read more

Information Gain in Machine Learning

Information Gain

Information Gain (IG) is critical in machine learning and decision tree algorithms, particularly in data classification and 𝐟𝐞𝐚𝐭𝐮𝐫𝐞 𝐬𝐞𝐥𝐞𝐜𝐭𝐢𝐨𝐧. Information Gain Information Gain is a concept used in the field of machine learning and decision trees to measure the effectiveness of an attribute in classifying a dataset. It is commonly employed in the construction of … Read more

Extracting Financial Year from Date in Pandas and PySpark DataFrames

Python

Introduction Working with date data often involves extracting relevant information, such as the financial year. In this blog post, we’ll explore how to extract the financial year from a date column in both Pandas and PySpark DataFrames. Extracting Financial Year in Pandas DataFrame Sample Data Let’s start by creating a sample Pandas DataFrame with a … Read more

What is Lasso Regression? | Machine Learning from Scratch

Least Absolute Shrinkage and Selection Operator Regression (simply called Lasso Regression) is another regularized version of Linear Regression: just like Ridge Regression, it adds a regularization term to the cost function, but it uses the ℓ1 norm of the weight vector instead of half the square of the ℓ2 norm. Figure below shows the same … Read more

Regularized Linear Models(Ridge Regression) | Machine Learning from Scratch

As we saw in previous posts, a good way to reduce overfitting is to regularize the model (i.e., to constrain it): the fewer degrees of freedom it has, the harder it will be for it to overfit the data. For example, a simple way to regularize a polynomial model is to reduce the number of … Read more

Learning Curves | Machine Learning from Scratch

bias-and-variance.

Till now, We have read about Gradient Descent,Min-Batch Gradient Descent,Stochastic Gradient Descent and other type of Gradient Descents and Polynomial Regression. In this post we will learn about Learning Curves in Machine Learning . Introduction Learning curves are graphical representations of how a model’s performance changes over time as it learns from training data. These … Read more

Polynomial Regression | Machine Learning from Scratch

Polynomial regression

Introduction Till now, We have read about Gradient Descent,Min-Batch Gradient Descent,Stochastic Gradient Descent and other type of Gradient Descents. In this post we will learn about Polynomial Regression. What if your data is actually more complex than a simple straight line? Surprisingly,you can actually use a linear model to fit nonlinear data. A simple way … Read more

Datasets Importing and exporting in Python.

Python Feature Image

What is Dataset? Datasets are container of data in python. It can work as data storage for the various algorithms in python. and also a primary storage of data in Data Science. Below I will be discussing how to import a datasets as dataframe in python. For this post I’ll be using a public dataset … Read more