Hand Coded Machine Learning Algorithms
While in graduate school, many of the courses had machine problems we needed to solve by coding solutions. We would learn about the theory and math behind machine learning algoritms and then were asked to hand code the algorithms to see the theory in practive. This means we were asked to code the algorithms without packages or libraries in the base R or Python. Of course many of the algorithms I built are available and optimized in Python and R libraries, but “getting under the hood” really helped solidify this knowledge.
Coded in R without using existing libraries: frequent pattern (Apriori) mining, contiguous pattern mining, k-mean clustering, hierarchical clustering, naïve Bayes classifier, support vector machine using stochastic gradient decent, principal coordinate analysis, regularized regression (l1 Lasso) using coordinate descent, linear regression through optimization (gradient descent), K nearest neighbor (KNN) regression, and decision tree.
Professionally built a test scoring algorithm that automated situational judgement test scoring which reduced scoring time from 16+ hours with Excel to seconds with R.
Algorithms hand built in Python: naïve Bayes classifier.
Links below are to the code in case you would like to inspect it. I have password protected the pages because they are solutions to coursework in my graduate program. If you are a hiring manager and would like to review them please, please email (cvalle356@gmail.com) me for the password.
Links to Projects
SL Project 1 – In this project, I wrote an R function to fit K Nearest Neighbors (KNN) regression model. The algorithm, train test split code, and evaluation code were written without use any additional R package. Part two of this project was to write a function to solve linear regression through optimization (gradient descent approach). We were then asked to test our functions on the Boston Housing data.
SL Project 2 – In this project, I explored feature selection using stepwise regression with both forward and backward and BIC and Cp criteria. I also coded my own Lasso function and compared the results with that of glmnet. The final task in this project was to use cross-validation for model selection.
SL Project 3 – In this project, I implemented code to fit a continuous piecewise linear spline without using existing packages like bs() and evaluated their performances by comparing the fitted functions with the true function value on an equispaced grid of 1000 points on [-1,1] using the squared distance metric. I compared my code with a linear model then improve on the model by selecting a more appropriate bandwith for the multidimensional kernal.
SL Project 5 – In this project, I coded a K means clustering algorithm and then wrote my own implementation of the EM algorithm.
Description
Coded algorithms from research articles and text book descriptions and formulas.