Selecting the Number of Clusters

With K-Means, you could use the inertia or the silhouette score to select the appropriate number of clusters, but with Gaussian mixtures, it is not possible to use these metrics because they are not reliable when the clusters are not spherical or have different sizes. Instead, you can try to find the model that minimizes … Read more

Tokenization in NLP

Word Level Tokenzation Splitting text into individual words “the quick brown fox” -> [“the”,”quick”,”brown”,”fox”] BUT Character Level Tokenization Splitting text into individual characters “the quick brown fox” -> [“t”,”h”,”e”,” “,”q”,”u”,”i”,”c”,”k”, …] But N-GRAM MODELS Splitting text into groups of consecutive words. N is the no. of words in a token. For a trigram model, “the … Read more

What is Exploratory Data Analysis (EDA)?

Exploratory Data Analysis

Exploratory Data Analysis (EDA) is an essential step in any data science project. It involves investigating and analyzing datasets to understand their characteristics, identify patterns, detect outliers, and uncover relationships between variables. EDA helps in gaining initial insights into the data before diving into more complex analyses. The Foremost Goals of EDA Types of EDA … Read more

SQL | Alias Operator

SQL Webp

SQL Alias Syntax for Columns: Also read Alias Example Assume we have a table called “Persons” and another table called “Product_Orders”. We will give the table aliases of “p” and “po” respectively. Now we want to list all the orders that “Ola Hansen” is responsible for. We use the following SELECT statement: The same SELECT … Read more

SQL | The LIKE Operator

SQL Webp

SELECT column_name(s) FROM table_name WHERE column_name LIKE pattern LIKE Operator Example The “Persons” table: Now we want to select the persons living in a city that starts with “s” from the table above. We use the following SELECT statement: SELECT * FROM Persons WHERE City LIKE ‘s%’ The “%” sign can be used to define … Read more

Using clustering for image segmentation

Image segmentation is the task of partitioning an image into multiple segments. In semantic segmentation, all pixels that are part of the same object type get assigned to the same segment. For example, in a self-driving car’s vision system, all pixels that are part of a pedestrian’s image might be assigned to the “pedestrian” segment … Read more

Accelerated K-Means and Mini-batch K-Means

Introduction Another important improvement to the K-Means algorithm was proposed in a 2003 paper by Charles Elkan. It considerably accelerates the algorithm by avoiding many unnecessary distance calculations: this is achieved by exploiting the triangle inequality (i.e., the straight line is always the shortest) and by keeping track of lower and upper bounds for distances … Read more

Web Development Project Guide for Freshers

Web Development Project Guide for Freshers Starting your journey as a web developer can be both exciting and challenging. To make the process smoother, here’s a detailed guide to beginner-friendly projects that will help you gain hands-on experience with full-stack development. Each project leverages modern technologies and includes step-by-step instructions to guide you through the … Read more

Letter Combinations of a phone number

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Example 1: Input: digits = “23” Output: [“ad”,”ae”,”af”,”bd”,”be”,”bf”,”cd”,”ce”,”cf”] Example 2: … Read more

3 Sum Closest | LeetCode

Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution. Example 1: Input: nums = [-1,2,1,-4], target = 1 Output: 2 Explanation: The sum that is closest to the target is … Read more

RAG with Llama 2, LangChain and ChromaDB: A Practical Implementation

Introduction Learn how Retrieval-Augmented Generation (RAG) works by building an end-to-end RAG pipeline with Llama 2, LangChain, Hugging Face embeddings, and ChromaDB — and understand how this early architecture compares with modern production RAG systems. Originally published: August 2, 2024Updated: September 2026 Introduction Large Language Models (LLMs) can answer questions, summarize text, generate code, and … Read more

Finding the Top K Most Frequent Elements in an Array

Python

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 in Machine Learning: How It Works, When to Use It, and Python Implementation

Learn how XGBoost works from decision trees and boosting intuition to gradient boosting, regularization, hyperparameter tuning, SHAP explainability, and production deployment. Includes practical Python examples for classification and regression. Originally published: April 18, 2024Updated: 3rd September 2026 Introduction If you have worked with tabular machine learning problems, you have probably encountered XGBoost. XGBoost, short for … Read more

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

Finding the Longest Palindromic Subsequence

Introduction: Dynamic Programming (DP) is a powerful algorithmic technique used to solve a variety of optimization problems. One classic problem where DP shines is in finding the longest palindromic subsequence in a given string. In this tutorial, we’ll delve into the intricacies of this problem and learn how to tackle it using DP. Problem Statement: … Read more

Titanic – Advanced Feature Engineering Tutorial

Introduction I decided to write this kernel because Titanic: Machine Learning from Disaster is one of my favorite competitions on Kaggle. This is a beginner level kernel which focuses on Exploratory Data Analysis and Feature Engineering. A lot of people start Kaggle with this competition and they get lost in extremely long tutorial kernels. This is a short kernel compared … Read more

Regression and Classification Multi Layer Perceptrons

Introduction In the dynamic landscape of machine learning, Multilayer Perceptrons (MLPs) emerge as formidable tools capable of handling both regression and classification tasks with finesse. Whether you’re predicting housing prices or sorting emails, understanding how to tailor MLP architectures and activations is pivotal for optimizing performance. Regression MLPs Crafting an MLP architecture for regression tasks … Read more