statsandstuff a blog on statistics and machine learning

Making a future in C++

I recently started looking at concurrent programming in C++ and decided to design my own future class as an exercise. Throughout several iterations of the design, I learned a lot about why C++ futures are designed the way they are. A future represents a later-known value. Values are usually computed eagerly. In the code below, the value f is co... Read more

Optimization and duality

Introduction Consider the optimization problem \[\begin{aligned} \inf_{x \in E} &\quad f(x) \\ \text{subject to} &\quad g(x) \leq 0, \end{aligned}\] where the function \(g: \mathbb{R}^n \to \mathbb{R^p}\) defines \(p\) constraints. Constraints can also be built into the set \(E \subseteq \mathbb{R}^n\). The Lagrangian The Lagrangian... Read more

What makes a better score distribution?

Suppose I train two binary classifiers on some data, and after examining the score distributions of each, I see the results below. Which score distribution is better? (And by extension, which classifier is better?) A naive answer is that the bimodal distribution on the right is better because it “discriminates... Read more

Implementing a neural network in Python

In this post, I walk through implementing a basic feed forward deep neural network in Python from scratch. See Introduction to neural networks for an overview of neural networks. The post is organized as follows: Predictive modeling overview Training DNNs Stochastic gradient descent Forward propagation Back propaga... Read more

Introduction to neural networks

In this post, I walk through some basics of neural networks. I assume the reader is already familar with some basic ML concepts such as logistic regression, linear regression, and classifier decision boundaries. Single neuron Neural networks are made up of neurons. A single neuron in a neural network takes inputs \(x_1, x_2, \ldots, x_p\), ap... Read more