Machine Learning From Scratch

  • The Hurdle Race | Hackerrank

    A video player plays a game in which the character competes in a hurdle race. Hurdles are of varying heights, and the characters have a maximum height they can jump. There is a magic potion they can take that will increase their maximum jump height by 1 unit for each dose. How many doses of the potion… Read more

  • What is Bagging and Pasting? Machine Learning from Scratch

    Introduction One way to get a diverse set of classifiers is to use very different training algorithms, as just discussed. Another approach is to use the same training algorithm for every predictor, but to train them on different random subsets of the training set. When sampling is performed with replacement, this method is called bagging… Read more

  • What is Ensemble Learning? | Machine Learning from Scratch

    Introduction: Welcome to our comprehensive tutorial on Ensemble Learning! In this guide, we’ll delve into the fascinating world of Ensemble methods, exploring how they harness the collective intelligence of multiple models to achieve superior performance in machine learning tasks. Whether you’re a seasoned practitioner or just stepping into the realm of machine learning, understanding Ensemble… Read more

  • Decision Tree Regression | Machine Learning from Scratch

    Decision Trees are also capable of performing regression tasks. Let’s build a regression tree using Scikit-Learn’s DecisionTreeRegressor class, training it on a noisy quadratic dataset with max_depth=2: from sklearn.tree import DecisionTreeRegressor tree_reg = DecisionTreeRegressor(max_depth=2) tree_reg.fit(X, y) The resulting tree is represented below This tree looks very similar to the classification tree you built earlier. The… Read more

  • Gini Impurity or Entropy? How to decide the root node in decision tree?

    By default, the Gini impurity measure is used, but you can select the entropy impurity measure instead by setting the criterion hyperparameter to “entropy”. The concept of entropy originated in thermodynamics as a measure of molecular disorder: entropy approaches zero when molecules are still and well ordered. It later spread to a wide variety of… Read more

  • 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