Machine Learning From Scratch

  • Finding the Top K Most Frequent Elements in an Array

    Finding the Top K Most Frequent Elements in an Array

    Finding the top ( k ) most frequent elements in an array is a common question in coding interviews and a useful task in various applications like data analysis and natural language processing. This guide will walk you through three effective methods to solve this problem: using a HashMap with sorting, Min-Heap, and Bucket Sort.… Read more

  • Finding the Top K Largest Elements in an Array

    In many coding interviews and real-world applications, finding the top ( k ) largest elements in an array is a common problem. This tutorial will guide you through three popular methods to solve this problem: Sorting, Min-Heap, and the Quick select algorithm. We’ll focus on the Min-Heap approach due to its efficiency and practical use… Read more

  • XGBoost: A Comprehensive Tutorial

    XGBoost: A Comprehensive Tutorial

    Introduction: In the realm of machine learning algorithms, XGBoost stands tall as a powerhouse, renowned for its efficiency, effectiveness, and versatility. This tutorial aims to provide a thorough understanding of XGBoost, covering its inner workings, advantages, practical applications, and best practices for implementation. Whether you’re a seasoned data scientist or an aspiring machine learning enthusiast,… Read more

  • Counting Odd and Even Occurrences in an Array

    Counting Odd and Even Occurrences in an Array

    Introduction: In programming, it’s common to encounter scenarios where you need to count the number of elements occurring an odd number of times and the number of elements occurring an even number of times in an array. This tutorial will guide you through the process of solving such a problem efficiently using Python. Understanding the… Read more

  • How to Check if a Number is Prime in Python

    How to Check if a Number is Prime in Python

    Introduction:Prime numbers are natural numbers greater than 1 that have no positive divisors other than 1 and themselves. Determining whether a given number is prime or not is a common problem in mathematics and computer science. In this tutorial, we’ll learn how to write a Python program to check if a number is prime or… Read more

  • Deleting Nodes with Greater Values on the Right Side in a Linked List

    Deleting Nodes with Greater Values on the Right Side in a Linked List

    Introduction:In programming, efficiently managing linked lists is a crucial skill. Deleting nodes with greater values on the right side is a common problem encountered while working with linked lists. In this tutorial, we’ll explore an optimized algorithm to tackle this problem using Python programming. We’ll delve into the implementation details, algorithmic insights, and optimization techniques… Read more