Cluster a Correlation Matrix (in python)

Below is a function to rearrange variables in a correlation matrix (either pandas.DataFrame or numpy.ndarray) to group highly correlated variables near each other.

It turns a correlation matrix that looks like:

Correlation matrix before grouping

Into one...

Read More

Scikit-learn Tree Design

Scikit-learn has a well designed, extensible implementation of decision trees. The design pays dividends for techniques that rely on decision trees such as random forest. Overall, the design is a great example of thoughtfully designed machine learning code and is...

Read More

Understanding Stochastic Gradient Descent

Until recently, I thought of stochastic gradient descent as gradient descent… with a little bit of randomness. However, when I first looked up the details of stochastic gradient descent I was confused how it could possibly work. This post is...

Read More

Narrow language features; the case for avoiding reduce

A narrow language feature leaves little ambiguity to the intent of the code. Therefore, an experienced reader can selectively skip details of the expression without loss of understanding. In contrast, a reader is forced to carefully inspect an expression that...

Read More

Exploring backoff

Back off is the amount of time to wait before retrying a failed action. There are many choices for how to back off, including constant backoff (wait 10 seconds, then try again), random backoff (wait x seconds, where x is...

Read More

Error Handling with Clojure Async

If you are reading this, there is a good chance an Exception was thrown in one of your async blocks and something unexpected happened. If you are using at least Clojure 1.6.0, your exception printed to stderr and the go...

Read More