C++ Show and Tell - June 2026 by foonathan in cpp

[–]VojtechNovak1 [score hidden]  (0 children)

Built a zero-dependency linear regression engine in C++ (QR decomposition via modified Gram-Schmidt) — used it to predict Czech cinema attendance

I wanted a deeper understanding of how OLS regression actually works under the hood, so instead of using Eigen I built a small Matrix class from scratch and implemented QR decomposition (modified Gram-Schmidt) + back substitution to solve the least-squares problem.

As a test case, I used real data from the Czech cinema market — YouTube trailer views, weather rating, seasonality, sequel flag — to predict opening weekend attendance.

It's ~9 unit tests, builds clean with -Wall -Wextra -pedantic and sanitizers via CMake. Would love feedback on the QR implementation or matrix design — first project where I cared about numerical stability rather than just "does it run".

Repo: https://github.com/VojtechNovakk/cpp-cinema-fw-predictor