Skip to content

About

This repository is a structured collection of core Machine Learning and Deep Learning concepts, implemented from scratch wherever possible and supported with controlled experiments. Each topic aims to serve as a singular resource for learning that topic, and provides theoretical understanding, code implementations, and a mathematical foundation.

Resources

Stars

13 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML-Starter-Kit

This repository is a structured collection of core Machine Learning and Deep Learning concepts, implemented from scratch wherever possible and supported with controlled experiments. Each topic aims to serve as a singular resource for learning that topic, and provides theoretical understanding, code implementations, and a mathematical foundation.

The goal is not just to run models, but to understand how they behave.

Each section follows a consistent structure:

  • Intuition
  • Core mathematical functions
  • Implementation
  • Visualizations
  • Boundary conditions and failure cases

Instead of treating algorithms as isolated techniques, this repository treats them as systems with assumptions, strengths, and limitations.


What This Covers

Logistic Regression
  • Introduces logistic regression as a shift from rigid yes/no classification to smooth, probability-based decision making, helping you understand how models can express confidence instead of just outcomes.

  • Explains how a simple linear combination of inputs becomes a powerful classifier through the sigmoid transformation.

  • Walks through the training process step by step, showing how predictions, error calculation and gradual parameter updates work together to refine the decision boundary.

  • Demonstrates how learning rate choices and activation functions directly affect stability and performance.

  • Concludes with practical insight into where logistic regression shines as a reliable, interpretable baseline model and where more complex approaches may be necessary.


K-Means Clustering
  • Starts by building intuition around grouping data, walking through why K-Means keeps reassigning points and adjusting centroids until things naturally settle into stable clusters.

  • Breaks down the core idea behind the algorithm in geometric terms, showing how it tries to create tighter, more compact groups and why that leads to the familiar assign-and-update cycle.

  • Implements the entire algorithm from scratch using NumPy, guiding you step by step through initialization, point assignment, centroid updates, convergence checks, and inertia tracking.

  • Includes clear visualizations that let you actually see clustering happen, from centroid movement across iterations to how space gets partitioned as the error gradually decreases.

  • Tests different values of K, random starts, scaling effects, and outliers, helping you understand not just how K-Means succeeds, but where it can mislead you.


Decision Trees and Random Forest
  • This notebook explores three supervised learning topics: Decision Trees, Random Forests, and Hierarchical Clustering.

  • Introduces Decision Trees through simple, relatable examples, showing how complex classification problems can be solved by asking a sequence of small, structured yes or no questions that gradually narrow down possibilities.

  • Explains how trees decide where to split by measuring how mixed or confused a group of data points is, helping you understand why certain questions create cleaner, more meaningful separations.

  • Builds into Random Forests by showing how combining many slightly different trees creates a more stable and reliable model, demonstrating how diversity and aggregation reduce the risk of overfitting.

  • Walks through how multiple trees are trained on varied subsets of data and features, and how their collective decision, whether through voting or averaging, produces stronger predictions than a single tree alone.

  • Explores Hierarchical Clustering as a different perspective altogether, showing how data can be gradually grouped based on similarity and visualized through dendrograms, allowing you to uncover structure without predefining the number of clusters.


Support Vector Machines (SVM)
  • Builds an intuitive understanding of Support Vector Machines by starting with simple separation problems and gradually introducing the idea of maximizing margins instead of relying on arbitrary thresholds.

  • Explores how real-world complications like outliers affect decision boundaries, and demonstrates how soft margins make the model more stable and practical.

  • Illustrates the role of support vectors and shows how only a small subset of critical points actually determine the boundary, making the geometric intuition behind SVM easy to grasp.

  • Introduces higher-dimensional thinking and kernel functions in a simplified way, helping you understand how complex patterns can be handled without overwhelming mathematical detail.

  • Concludes with a from-scratch implementation of an SVM-based loan approval system, connecting intuition, optimization, visualization and real-world application into one cohesive workflow.


DBSCAN vs K-Mean
  • Compares two completely different clustering philosophies by placing K-Means and DBSCAN side by side, helping you see how distance-based and density-based thinking lead to very different outcomes.

  • Uses a carefully designed “smiley face” dataset to clearly demonstrate where centroid-based clustering struggles and how density-based logic preserves natural structure.

  • Shows how DBSCAN identifies clusters by looking at local neighborhoods instead of global centers, allowing it to naturally detect noise and separate irregular shapes.

  • Includes controlled parameter stress-testing to reveal how tuning ε and MinPts directly affects clustering behavior, making the algorithm’s sensitivity easy to observe.

  • Concludes with practical guidance on when density-based clustering is a better fit than distance-based approaches, reinforcing the importance of aligning model choice with data geometry.


Convolutional Neural Networks (CNNs)
  • Begins by building intuition around what it means for a machine to “see,” explaining how images are just grids of numbers and how small learnable filters scan across them to detect patterns like edges and textures.

  • Walks through the core building blocks of a CNN, including convolution, activation, pooling and classification, showing how these simple steps combine to transform raw pixel values into meaningful predictions.

  • Implements a minimal CNN from scratch using TensorFlow on the MNIST dataset, guiding you through data normalization, layer construction and how image shapes evolve as they pass through the network.

  • Uses visualizations to track accuracy, loss and internal feature separation, helping you see how the model improves over time and how different digits become distinguishable in learned feature space.

  • Includes controlled experiments that intentionally modify architecture choices such as pooling size, number of filters, normalization, and even label correctness, demonstrating why CNNs work when their assumptions align with image data and how performance drops when those assumptions are disturbed.


N-Gram Models
  • Introduces language modeling from first principles, starting with the simple idea of predicting the next word and building toward structured N-gram models in a clear and approachable way.

  • Explains how unigram, bigram, and trigram models balance simplicity and fluency, helping you understand the tradeoff between capturing context and managing data sparsity.

  • Demonstrates why higher-order N-grams struggle with unseen word combinations, and walks through smoothing techniques that make these models usable in practice.

  • Covers evaluation using cross-entropy and perplexity, showing how language models are measured and compared beyond raw probabilities.

  • Concludes by connecting N-gram models to modern neural language models, highlighting how today’s architectures build on the same fundamental goal of predicting words from context.


Word2Vec
  • Introduces different tokenization strategies and shows how breaking text into words, characters or subwords affects vocabulary size and model learning.

  • Explains Byte Pair Encoding in a practical way, demonstrating how subword units help models handle rare and unseen words more effectively.

  • Compares word-level and subword tokenization to highlight why modern NLP systems rely on more flexible approaches.

  • Trains a Word2Vec model using both CBOW and Skip-gram architectures to show how context is used to learn meaningful word vectors.

  • Explores the learned embeddings using cosine similarity and t-SNE visualization, helping you see how related words cluster together in vector space.


Recurrent Neural Networks (RNN) and LSTM
  • Builds intuition around memory in sequence processing, explaining how RNNs maintain a hidden state that carries forward contextual information.

  • Walks through how a basic RNN updates this hidden state at every time step, allowing information to accumulate across a sequence.

  • Examines training challenges like vanishing and exploding gradients, clarifying why simple RNNs struggle with long-term dependencies.

  • Introduces LSTMs as a more stable alternative, showing how gated memory cells control what information is kept or forgotten.

  • Discusses when sequence models are appropriate and how they compare to newer approaches, encouraging thoughtful model selection.


Q-Learning
  • Begins with a simple maze analogy to build intuition, showing how an agent learns action preferences over time rather than memorizing fixed paths.

  • Walks through the learning cycle step by step, demonstrating how repeated interaction with the environment slowly transforms random movement into goal-directed behavior.

  • Explains the core update idea behind Q-Learning, showing how rewards and future estimates combine to refine action values and allow useful information to propagate backward through states.

  • Implements a clear and interpretable 5×5 gridworld where the Q-table, exploration strategy and learning progress can be directly observed and visualized.

  • Explores parameter sensitivity and limitations, helping you understand how exploration rate, learning rate and environment size influence stability and performance.


Deep Learning Fundamentals
  • Explores loss functions as the definition of “error,” comparing different choices and showing how they influence gradient behavior and overall training stability.

  • Examines activation functions by explaining why nonlinearity is necessary and how different activations affect gradient flow and learning dynamics.

  • Walks through common optimizers and learning rate behavior, illustrating how different update strategies change the path a model takes during training.

  • Introduces normalization techniques as tools for stabilizing learning, clarifying how they make deeper networks easier to train and less sensitive to hyperparameters.

  • Covers regularization methods that prevent overfitting, demonstrating how controlled constraints improve generalization and help models perform reliably on unseen data.


Acknowledgements

These notebooks were created by the contributors listed below, under the technical leadership of Manya Pandey, AI/ML Lead.

Simar Walia

  • Logistic Regression
  • Decision Trees and Ensembles

Arnav Mahapatra

  • K-Means Clustering
  • Deep Learning Fundamentals

Srijoy Ganguly

  • Support Vector Machines
  • Forward and Backpropagation

Ayush Kanta Bhattacharya

  • DBSCAN vs K-Means
  • N-Gram Models

Shourja Banerjee

  • Convolutional Neural Networks (CNNs)
  • Recurrent Neural Networks (RNN) and LSTM

Sayan Ghosh

  • Word2Vec
  • Q-Learning

About

This repository is a structured collection of core Machine Learning and Deep Learning concepts, implemented from scratch wherever possible and supported with controlled experiments. Each topic aims to serve as a singular resource for learning that topic, and provides theoretical understanding, code implementations, and a mathematical foundation.

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages