Blog
Python fundamentals, machine learning built from scratch, and the math behind it.
- All 22
- Python - Basic & Intermediate 6
- Machine Learning 2
- Machine Learning - from scratch 11
- LLMs 2
- Algorithms 3
LLMs · Machine Learning - from scratchGPT2 From Scratch
In a previous post I coded the transformer from scratch and trained it to translate English to Italian. In this blog post I will code GPT2 and train to generate text…
Machine LearningGeneralized Linear Models
Generalized Linear Models (GLMs) were introduced by Robert Wedderburn in 1972 and provide a unified framework for modeling data originating from the exponential family…
LLMs · Machine Learning - from scratchTransformer from Scratch
In this blog post I will code the Transformer model from scratch and trained to translate English to Italian. The code can be found HERE.
Machine Learning - from scratchHierarchical Clustering From Scratch
In this article I will walk you through the implementation of the hierarchical clustering method. The code can be found HERE. Hierarchical clustering is a method of…
Machine Learning - from scratchOrdinary Least Square: Closed Form Solution & Gradient Descent
The Jupyter Notebook for this article can be found HERE.
AlgorithmsSimulated Annealing
Simulated annealing is a well-established metaheuristic, physics-based method that seeks the parameters of a model that maximize (or minimize) the model's objective…
AlgorithmsSimple and Steepest Ascent Hill Climbing
Hill climbing is one of the simplest metaheuristic optimization methods that, given a state space and an objective function to maximize (or minimize), tries to find a…
Python - Basic & IntermediatePython Conditionals
Conditionals, as the name suggests, allow the conditional execution of a statement or series of statements based on the values of a specific expression. Conditionals…
Machine Learning - from scratchK-Means Clustering From Scratch
K-Means clustering is an unsupervised machine learning algorithm that seeks to group alike data points together. It aims to partition n observations into k clusters in…
AlgorithmsParticle Swarm Optimization
PSO is a stochastic, population-based algorithms and utilizes a population of candidate solutions, named particles, that move around in the search-space seeking for the…
Machine Learning - from scratchLogistic Regression From Scratch
Logistic regression is among the most famous classification algorithm. It is probably the first classifier that Data Scientists employ to establish a base model on a new…
Machine Learning - from scratchSVM From Scratch
In this article I will walk you through every detail of the linear SVM classifier, from theory to implementation. The Jupyter Notebook can be found HERE.
Machine Learning - from scratchSVM Margin Formula Derivation
When introduced to the SVM algorithm, we all came across the formula for the width of the margin:
Python - Basic & IntermediatePython Dictionaries
A Python dictionary is a data structure that stores items in the form of key-value pairs. The keys are unique and can only be string, numbers or tuples. Values can be…
Machine Learning - from scratchWhy Gradient Descent Works
Gradient descent is very well known optimization tool to estimate an algorithm's parameters minimizing the loss function. Often we don't not fully know the shape and…
Machine Learning - from scratchDerivation of the Binary Cross Entropy Loss Gradient
The binary cross entropy loss function is the preferred loss function in binary classification tasks, and is utilized to estimate the value of the model's parameters…
Python - Basic & IntermediatePython Tuples
Tuples store multiple items in a single variable. Tuples are immutable: values inside a tuple cannot be updated or changed.
Python - Basic & IntermediatePython Basic Data Types
Integers are positive and negative integer numbers that are written without a fractional component. Basically, every number without a decimal point.
Machine Learning - from scratchOLS Formula Derivation
OLS is most famous algorithm that estimates the parameters of a linear regression model. OLS minimizes the following loss function:
Machine LearningLinear Regression: Linear Regression Equation & OLS
Linear regression is one of the oldest algorithm in machine learning. It is an approach for modelling the relationship between a variable y (aka response or dependent…
Python - Basic & IntermediatePython Sets
Sets are used to store multiple UNIQUE items in a single variable. Sets are unordered data structure.
Python - Basic & IntermediatePython Lists
Lists are probably the most widely used data structure in Python. Lists store multiple items in a single variable. Moreover, lists are ordered data structure: the order…