This a repository for practicing various algorithm implementations, with a focus on machine learning
Also known as Multiclass Logistic Regression optimized via Gradient Descent
Implemented in Python from scratch without using any ML libraries
Three layers: 400/25/10 nodes with sigmoid activations, 94% accuracy
Optimal Margin Classifier + Kernel Trick = Support Vector Machine
Also known as L1 Norm Soft Margin Support Vector Machine
Shown are scans of decision boundaries for different choices of regularization (C) and scale (λ)
2D feature vectors mapped to 6th order polynomials
Shown with different values of regularization parameter λ (over/under fit)
Linear decision boundary - no feature mapping
Python implementations of Batch Gradient Descent along with cost function
Python implementation to find the minimum number of steps to complete a maze
Part of the Google FooBar challange
code to generate fake datasets
- normal distributions
- gaussian jitter along a line
c++ examples of functions executing bitwise operations
- logical operators
- right/left shift div/mult by 2
- & 1 for odd/even
- XOR find singly-occurring element in array
c++ examples of recursive fucntions
- write number in binary
- calculate compound interest minus a commission after some set time
- count up and down from min to max
- calculate factorial
- find the maximum number in an array
- sort an array from min to max (selection sort)
- find the sum of all numbers between a and b
python examples of sorting algorithms
- quicksort
- bubblesort
- mergesort
python implementation of a hash set, then using the hash set to solve a few problems
- check if an array contains any duplicate numbers
- find the intersection of two arrays
- determine if an integer is "happy" (number theory definition) https://en.wikipedia.org/wiki/Happy_number
- binary tree, breadth first search, depth first search (pre/post/in order)
- binary search tree
Solutions to questions from https://projecteuler.net/
- Sum of multiples of 3 or 5 < 1k :: 233168
- Sum of even Fibinocci numbers < 4M :: 4613732
- Largest prime factor of 600851475143 :: 6857
- Largest palindrome made from the product of two 3-digit numbers: 913 x 993 = 906609
- Smallest positive number that is evenly divisible by all of the numbers from 1 to 20 :: 232792560
- It has a prime factorization of [1, 2, 3, 2, 5, 7, 2, 3, 11, 13, 2, 17, 19]
- Difference between the sum of the squares of the first one hundred natural numbers and the square of the sum :: 25164150
- The 10001st prime number :: 104743
- Given a 1000-digit number, find the group of 14 sequential numbers with largest product :: 23514624000
- There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. :: 200 x 375 x 425 = 31875000
- Sum of all primes less than 2M :: 142913828922
Find all unique combinations of 4 numbers in an array which add to a given target