Python decorator patterns

Marton Trencseni - Sun 08 May 2022 • Tagged with python, decorators

I show toy implementations of Python decorator patterns such as @measure, @repeat, @trace, @count, @singleton, and @app.route (made famous by Flask).

Python enum

Continue reading

Building a toy Python Enum class - Part II

Marton Trencseni - Thu 05 May 2022 • Tagged with python, enum

I extend my previous toy implementation of Python's Enum class to add more features.

Python enum

Continue reading

Building a toy Python Enum class - Part I

Marton Trencseni - Tue 03 May 2022 • Tagged with python, enum

I write a toy implementation of Python's Enum class to learn about Python metaclasses.

Python enum

Continue reading

"Over 70% of all Porsche vehicles ever built are still on the road today"

Marton Trencseni - Sat 30 April 2022 • Tagged with porsche, timeseries, fit, survival

Porsche proudly advertises "Over 70% of all Porsche vehicles ever built are still on the road today". Is this a testament of the quality and longevity of Porsche cars, or simply a result of the brand switching from niche sportscar manufacturing to mass production around the year 1999?

Over 70% of all Porsche vehicles ever built are still on the road today

Continue reading

"The company is all hot air"

Marton Trencseni - Tue 26 April 2022 • Tagged with startups, theranos, wework, scalien

Theranos, WeWork and the startup hustle.

Bayes vs z-test

Continue reading

Python types for Data Scientists - Part III

Marton Trencseni - Fri 22 April 2022 • Tagged with python, types

I show slightly more advanced aspects of type checking in Python for Data Scientists.

Mypy

Continue reading

Python types for Data Scientists - Part II

Marton Trencseni - Sun 17 April 2022 • Tagged with python, types

I show slightly more advanced uses of type checking in Python.

Python snake

Continue reading

Python types for Data Scientists - Part I

Marton Trencseni - Fri 08 April 2022 • Tagged with python, types

I show how to use basic type hints and get type checking working in ipython notebooks.

Python types for Data Scientists

Continue reading

Solving 5 algorithmic interview questions

Marton Trencseni - Sat 26 March 2022 • Tagged with interview, python

Recently I was considering whether to introduce some CS style algorithmic interview questions into our Data Science hiring loop, since having an understanding of algorithms and data structures can be useful for Data Scientists. Not having done this soft of interview for a few years I picked up my copy of Daily Coding Problem and starting solving a few problems to refresh my feeling for what it feels like as a candidate, and whether it would give us any useful signals.

Daily coding problem

Continue reading

Fair coin from biased coin

Marton Trencseni - Tue 22 March 2022 • Tagged with probability, statistics

Given a biased coin, construct a fair coin.

Fair coin from biased coin

Continue reading

The german tank problem in World War II

Marton Trencseni - Sat 12 March 2022 • Tagged with statistics, war

I run Monte Carlo simulations to show the frequntist solution to the German tank problem.

.

Continue reading

Delightfully cynical half-truths about organizations

Marton Trencseni - Sat 12 February 2022 • Tagged with peter-principle, gervais-principle, dunning-kruger, dilbert

Five delightfully cynical half-truths about organizations: the Peter principle, the Dilbert principle, the Gervais principle, Negative selection and the Dunning-Kruger effect.

.

Continue reading

Probabilistic spin glass - Conclusion

Marton Trencseni - Mon 31 January 2022 • Tagged with entropy, physics, spin, glass

I summarize the 5 previous posts on probabilistic spin glasses.

.

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part III

Marton Trencseni - Sat 22 January 2022 • Tagged with wordle, monte-carlo

I present a simple Monte Carlo solution which finds a 25-letter-unique Worlde wordlist in about 10 minutes.

Wordle

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part II

Marton Trencseni - Fri 21 January 2022 • Tagged with wordle, monte-carlo

I improve on the previous brute-force Monte Carlo approach for attacking the Wordle coverage problem.

Wordle

Continue reading

Optimal coverage for Wordle with Monte Carlo methods - Part I

Marton Trencseni - Wed 19 January 2022 • Tagged with wordle, monte-carlo

I show a simple brute-force Monte Carlo approach for attacking the Wordle coverage problem.

Wordle

Continue reading

Probabilistic spin glass - Part V

Marton Trencseni - Thu 06 January 2022 • Tagged with entropy, physics, spin, glass

I use Monte Carlo simulations to explore the dynamic behaviour of probabilistic spin glasses, specifically how saturation scales with $p$ and $N$.

.

Continue reading

Probabilistic spin glass - Part IV

Marton Trencseni - Fri 31 December 2021 • Tagged with entropy, physics, spin, glass

This is a continuation of the previous articles on probabilistic spin glasses. I run simulations to understand the scaling behaviour for large spin glasses.

.

Continue reading

Probabilistic spin glass - Part III

Marton Trencseni - Sat 25 December 2021 • Tagged with entropy, physics, spin, glass

I run simulations to understand the dynamic probabilistic evolution of these toy models.

.

Continue reading

Probabilistic spin glass - Part II

Marton Trencseni - Sat 18 December 2021 • Tagged with entropy, physics, spin, glass

This is a continuation of the previous article on probabilistic spin glasses, with improvements to the simulation code and improved entropy computation.

.

Continue reading