Home

Create PDF reports with Python and Jinja2

This post is a summary of the code I wrote in Python for my then-desperate wife to automatically generate hundreds of invoices. Suppose you have an excel sheet with hundreds of rows and a couple of columns (a sample is shown below), and would like to generate pdf reports for individual rows according to column values. With MS office, the sheet...

Read more

Remote jupyterlab without SSH and sudo

Disclaimer: this guideline is only suggested for servers within secure local connections, e.g. within an institution or corporation’s network. SSH port forwarding is a common way of connecting to remote jupyter notebooks. This typically takes three steps: run jupyter on the server, ssh tunneling to the jupyter instance, and then type the localh...

Read more

What is modeling? A not so gentle explanation

Here we mean scientific models, not fashion models;) What is a model? Supposing we want to know how fast the enzymes in our stomach catalyze the digestion of the proteins in our food, we first need to understand in general how enzymatic reactions work. As early as 1903, Victor Henri discovered that the enzymatic reactions were initiated by a bin...

Read more

Bayesian basics II - Inference for univariate Gaussian, Maximum a Posteriori vs Maximum likelihood

In an earlier post, we get to know the concept of Bayesian reasoning. In this post we show Bayesian way of inferring basic statistics and briefly compare the Maximum a Posteriori to Maximum likelihood. As a simple example of Bayesian inference in action, we estimate the expectation \(\mu\) of univariate Gaussian with known variance \(\sigma^2\)...

Read more

Why can cross entropy be loss function?

This post is an expansion of my answer on Cross Validated Intuitively we can take Kullbach-Leibler(KL) divergence which quantifies the distance between two distributions as the error function, but why the cross entropy arises for classification problems? For answering it, let us first recall that entropy is used to measure the uncertainty of a...

Read more