Machine Learning From Scratch

  • RAG using Llama 2, Langchain and ChromaDB

    Introduction Objective Use Llama 2.0, Langchain and ChromaDB to create a Retrieval Augmented Generation (RAG) system. This will allow us to ask questions about our documents (that were not included in the training data), without fine-tunning the Large Language Model (LLM). When using RAG, if you are given a question, you first do a retrieval… Read more

  • 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