Why Write This Comparison
Key point
Putting my two personal projects side by side, I noticed they share the same collect → preprocess → analyze → visualize skeleton yet made opposite technical choices at every stage. That is because when the shape of the data and the goal of the project differ, the right choice differs too. This is my review of why, from both theory and practice.
- F1 is a live service on Cloud Run that does analysis, ML prediction, and live commentary on race results, telemetry, and regulation data.
- contents does recommendation, trend, era, and person analyses on film data (music and books to follow) and is at the local-validation stage.
1. Storage — Files (CSV/Parquet) vs a Database (PostgreSQL)
In theory, the criteria are the shape of the data and the questions you will ask.
| File-based (F1) | Relational DB (contents) | |
|---|---|---|
| Data shape | Flat table — each row is an independent observation | A web — tables referencing each other |
| Typical question | "Sweep the whole season and give me stats" | "Which actors worked with Bong Joon-ho 3+ times?" |
| Key concept | Analysis-oriented (OLAP-ish) access | Normalization |
An F1 row such as "2021, round 5, Verstappen, grid 1, finished 1st" is a self-contained fact. Per-season CSVs read wholesale by pandas are the simplest and fastest option. contents revolves around many-to-many relationships between work, person, and genre. Stuffing it into one table causes update anomalies, where the same person must be fixed in many rows, and broken counts, where a different spelling is counted as a different person. To avoid that it splits into person (stored once), credit (relations only), and work (stored once). It is textbook normalization.
In practice, F1's data is 44 CSVs (1.2MB), so no DB server is needed. That let the CSVs ship inside the Docker image, which made deployment very simple. Only the heavy lap data uses Parquet, a column-compressed format. contents pays the operational cost of running PostgreSQL and in return prepares for a future of thousands of works and complex queries. F1 skipping the DB was also a practical call to avoid over-engineering. It is noted to expand when demand shows up.
2. Preprocessing — Different Enemies: Leakage vs Entity Resolution
F1's enemy is data leakage. If future information that cannot be known at prediction time sneaks into training, validation scores look great but the model is useless in production. It is the most common and most fatal mistake in applied ML. Driver form uses shift(1) to include only previous races, and circuit shuffle uses expanding()+shift(1) to include only previous seasons. Validation is a time-series split (train 2016–2023 / test 2024–2026) instead of a random one, which blocks any future-to-past reversal.
contents' enemy is entity resolution. If "봉준호" / "Bong Joon-ho" / "Joon-ho Bong" are not merged into one person, every aggregate above them is wrong, from filmography to collaborations to recommendations. One canonical person is stored in person and per-source spellings in person_alias. A future Spotify source can then attach to the same person.
The enemies differ because of the nature of the data. F1's API guarantees a unique driverId, so there is no identity problem. Instead it predicts over time, so leakage is the risk. contents does person-centric aggregation instead of prediction, so leakage is no worry and merging spellings is the problem.
3. Analysis — Supervised Prediction vs Unsupervised Similarity
F1 is supervised learning. It learns from labeled past results to predict the future. Podium is formulated as classification with logistic regression and finishing position as regression with Ridge. One thing happened here. The initial GradientBoosting overfit the old Mercedes/Red Bull era and could not even beat the "finish in grid order" baseline in the 2024–2026 McLaren era. Only after deliberately retreating to a simpler, more regularized model did it win fairly. The more complex model was not the better model. The penalty analysis even went counterfactual, re-ranking finishers as if the penalty seconds had never been added.
contents is unsupervised similarity. It computes likeness from the works' attributes without labels. Text is vectorized with TF-IDF (weighting words frequent in this document but rare overall), cosine similarity (0–1) is computed, and the top results are recommended. This is content-based filtering, one of the two main branches of recommendation theory; collaborative filtering needs user logs and comes later. As a practical detail, Korean text is handled with character n-grams instead of a morphological analyzer. It is a classic works-well-enough trade-off that avoids heavy installs.
The methods differ because of the question. F1 asks what will happen, so it learns from labeled history. contents asks what is similar among what already exists, so it uses similarity, which needs no labels. The kind of question decided the methodology.
4. Visualization — an Exploratory Product vs Explanatory Reports
In theory, visualization splits by purpose into exploratory, where users discover by interacting, and explanatory, which delivers what has already been found.
F1 is an exploratory product. It uses Plotly interactive charts (zoom, hover, track maps) and a 4-tab Streamlit dashboard. In return, Streamlit needs a persistent WebSocket, which rules out static hosting, so it took on the deployment complexity of Docker + Cloud Run with --session-affinity.
contents is explanatory reporting. It uses three static matplotlib PNGs, a minimal Flask screen, and a Jupyter notebook for exploration. It is still at the stage of validating the pipeline, not yet showing it to others, so this is enough. The difference in maturity maps directly onto the visualization stack.
5. Collection — Layered Multi-Source vs Single Source + Fixtures
F1 uses a per-source adapter pattern. Sources with different coverage (Jolpica 2016+, FastF1 2018+, OpenF1 live) are layered so each does what it is best at. Practical details include full pagination sweeps, a 0.3s wait between requests with exponential backoff on 429, and local caching for heavy telemetry. A real missing-field case from the 2017 season was absorbed with defensive parsing. Real data always has gaps like this.
contents uses the fixture pattern. There was no TMDB key, so the whole pipeline was completed first with 12 sample films shaped exactly like real API responses. It applies the mocking concept from testing to a data pipeline. When the key arrives, only the collection command changes and everything downstream runs without touching code. It is a pragmatic way to keep development moving despite an external dependency.
At a Glance
| Question | F1's answer | contents' answer | Why they diverge |
|---|---|---|---|
| Data shape? | Flat time series | Work↔person web | The domain's inherent structure |
| Where to store? | CSV/Parquet | Normalized PostgreSQL | Whether relational queries are needed |
| Preprocessing enemy? | Future-information leakage | Scattered person spellings | Prediction vs aggregation |
| Analytical question? | "What comes next?" (supervised) | "What is similar?" (similarity) | Presence of labels |
| Visualization goal? | A product to explore | Reports to validate | Project maturity |
| How far along? | Live in the cloud, instrumented | Local validation, awaiting real data | Enough data to ship? |
In short, F1 is a project of depth that completes a prediction service on time-series data, and contents is a project of breadth that extends to several domains on a relational data model. Opposite choices came from the same skeleton because at every stage the tools followed the nature of the data and the goal.