AI/ML experiments
The first models I trained where I could see why one beat another.
Sole developer ยท High school
These are program coursework, and the structure was given to me rather than chosen. What I got out of them was the comparison. Running KNN, naive Bayes and logistic regression over the same vectors, then watching a convolutional network beat a multilayer perceptron on the same images, made the accuracy-versus-complexity tradeoff concrete instead of a sentence in a lecture. I have kept them on the site because the demo makes a classifier legible to someone who has never opened a notebook.
The sentiment notebook
Reviews above three stars are labelled good and everything at three or below is labelled bad, which turns a star rating into a binary target. Text goes through spaCy for tokenization and lemmatization, stop words and punctuation come out, and each review ends up as a sparse 800-feature word-count vector from CountVectorizer. A logistic regression learns a weight per word. Two alternatives run against the same data. Multinomial naive Bayes swaps the model but keeps the bag-of-words representation. The word2vec version swaps the representation instead, averaging spaCy's 300-dimensional embeddings, and feeds that into a second logistic regression. Having both comparisons in one notebook makes it clear that the features and the classifier are separate choices. Ten thousand or so samples were preprocessed and vectorized. I do not have a recorded accuracy figure for any of the three models and will not guess at one.
The vision notebook
The same idea applied to images, run as a ladder. A K-nearest-neighbours classifier goes first, because it needs no training and gives a floor to beat. Then a multilayer perceptron, then a convolutional network with Conv2D, max-pooling and dropout layers. Every model is scored with stratified K-fold cross-validation so the comparison is not one lucky split. The point of the exercise was watching where the extra complexity paid for itself and where it did not. The demo on this site does none of that. It is a keyword scorer with negation and intensifier handling, written by hand so you can see every term that moved the score. It is not the trained model, and the explainer panel inside it says so.