Projects

After completing my education, I have been working independently on some small projects. I undertake these projects to learn different things and to establish a workflow during the process. This also means that these projects don’t need to be perfect—the goal is learning.

I share them so people can get a glimpse of what I’m working on, but also because I often explore others’ projects myself to discover small tricks that are rarely shown in articles and are often hidden in the code.

Here are some of my projects:

Bee a Spelling Genius (Dashboard)

Bee a Spelling Genius

This is a live application made with the Shiny for Python version.

The intention was to create a small project and learn about reactive programming, as well as how to develop small applications and dashboards. By using Shiny for Python, I could run it directly on my GitHub page, making it easier to share with others.

Mixture of K scaled and shifted t distributions (Theoretical and Implementation)

Mixture of K scaled and shifted t distributions

The implementation was created using a combination of R and C++ via the Rcpp library.

This project is based on an assignment from one of my classes at KU. I enjoyed it because it had a nice mixture of theoretical calculations, numerical methods, and coding. When I first worked on it, I encountered many problems due to the steep gradient. It was rewarding to revisit it and learn how to handle these challenges. I also got to use C++ and see how it improved computation time.

This was one of those projects where the final product was very clean, but the process involved a lot of troubleshooting and learning about program interactions, which was a lot of fun.

For example, I used C++ overloaded functions, but due to R not allowing functions with the same name, I ran into issues. When I tested my R implementation with a set output, it worked, and when I tested my C++ implementation, it also worked. It’s easy to understand once you figure it out, but it was challenging until then.

A small note: this project is a bit technical. If you’ve stumbled upon it and want some intuition about what’s going on, I recommend starting by looking at Gaussian mixtures. Since Gaussian mixtures have closed-form solutions, the expressions are much simpler, which makes understanding the intuition easier.

For t-distributions, there is no closed form—or at least I couldn’t derive one—so I had to use numerical methods to compensate. This is why the project ends up focusing heavily on implementing fast code using C++. It also involves addressing numerical issues such as unstable gradients and explaining why the function is not convex. If it were convex, I would have used Newton’s method.

This challenge was also what made the project interesting to me. Anyone can fit a Gaussian mixture, which is why it’s so widely used. However, tackling numerical methods and figuring out how to implement solutions when the expressions don’t cooperate is a central skill I wanted to develop.

VP-search trees for cgMLST sequences (Theoretical and Implementation)

VP-search trees for cgMLST sequences

This is a project I completed for Statens Serum Institut. The goal was to develop a theoretical approach for more efficient searches in their database for cgMLST analyses. I ended up creating an adaptation of VP-search trees based on Hamming distance. Due to the significant number of missing values in the sequences, I had to modify the method and prove some minor bounds. The underlying problem was how to optimize repeated in-range searches, which are, by nature, very similar to KNN.

I implemented this in Python, making it usable for their system.

The department had a database with the data but conducted data processing in Python. Therefore, it might be more efficient to write code that worked closer to the database. Consequently, the report structure became a bit unconventional.

I wrote extensive documentation for all functions and implemented everything from scratch to ensure it could be adapted to different programming languages where Python libraries might not be flexible.

I also conducted speed testing on a smaller, published dataset to showcase how the implementation could be evaluated.

Prediction of House Prices (Applied Project)

Prediction of House Prices

This is a small project I did because I wanted to learn XG-Boost, Lasso and work on a practical prediction project. Kaggle has an open dataset where one can practice. It turns out that their version of advanced regression techniques boils down to a crazy amount of data cleaning and feature engineering, which is common in real-world problems, but not necessarily needed for a practice case. This is a common practice project, and various versions can be found online. I did some visualizations a bit differently, as well as hierarchical clustering to reduce variables.

The feature engineering and cleaning process is extensive but could be improved. Since this was not the main goal of my project. I achieved a score of 0.13755, which was considered a rather good score before people started inflating the scores by exploiting the dataset, which has been used multiple times, and feeding it into the validation set.

I made this notebook using R and created a small interface to interact with the plot. Otherwise, the notebook would have too many plots of variables.

Sequential Hypothesis Testing and Safe Anytime Inference (Theoretical and Simulation)

Sequential Hypothesis Testing and Safe Anytime Inference

In this project, I explore the mSPRT, which is a method for continuously monitoring experiments. It’s a kind of “the new black” in A/B testing. The theory is beautifully simple but has been significantly expanded to account for additional problems. In this project, I focus only on the base problem. I also conducted simulations to see how these assumptions affect coverage, especially the Type I error. Additionally, I rembered how to perform power calculations.

Update rules for least squares (Theoretical/Conceptual)

Update rules for least squares

This was a small project to practice some linear algebra and NumPy, as well as Matplotlib. I implemented a rolling prediction for a simple linear model fitted with least squares and used update rules so that the function doesn’t need to be refitted from scratch. Least squares is often used, so this method can be applied to many other applications in live settings, allowing the model to be updated as data flows in.

You Shall Not Pass — parallelisering og spilteori på en fælles server(Theoretical/Conceptual)

You Shall Not Pass

In this project, I look at resource allocation on a shared server through the lens of game theory, framing parallelization among multiple actors as a Nash equilibrium problem. I ran simulations to see the calculation times with different actors on the same server, and niceness settings. Note that the project itself is written in Danish, with Python for the simulations.

A Toy Model for Market Dynamics: Building a Agent-Based Frameworks (Conceptual)

A Toy Model for Market Dynamics: Building a Agent-Based Frameworks

This project explores the foundational concepts of agent-based simulations through a simplified market model. Using Python, it simulates shoppers navigating a fictional representation of Strøget, Copenhagen’s shopping district. Each shopper is modeled as an agent with specific preferences, budget constraints, and behaviors, while shops act as agents offering products in distinct categories.

The project emphasizes structural design choices, such as implementing interactions (e.g., buying decisions) and tracking aggregated metrics like total sales. It also addresses technical challenges, including managing dynamic effects and considering potential parallelization issues, though these aspects have not yet been fully implemented.

The implementation is written in Python and includes unit tests to verify the functionality of key components. Primarily intended as a learning exercise, this model aims to refine object-oriented programming skills and simulate agent interactions. It serves as a foundation for exploring more complex systems and optimizing efficiency in future iterations.

Recognize symbols drawn on the touchpad

github page

The idea behind this project was to create a small Python program that recognizes symbols drawn on a touchpad using a neural network trained with PyTorch.

I developed both the interface and the model. The model performs okay, achieving around 87% accuracy on the test set, though I know better models exist.

However, it performs poorly on a new dataset consisting of my hand-drawn touchpad symbols. Because of this, I have decided not to continue working on the project.

I used the tkinter.ttk library but did not find a good way to extract the drawing data. Instead, I had to register the drawing events and store them in a matrix/tensor. I also tried scanning the screen while pixelating the image, which made the letters look more similar to those in the training set. However, the coordinates from ttk.Canvas and grid do not match those in PIL.ImageGrab, making this approach unfeasible.

There is actually a valuable lesson here about generalized learning and the importance of training on diverse distributions.

The idea was really good, but it just didn’t work.

This project was always meant for learning, so it’s not a problem.

If you want to play around with it, you can download the GitHub repo.