Promo Simulator

Data Scientists have to deal with multiple languages and tools in their every day life. We code in languages like Python, R, Julia, Matlab or Octave, among others; we also query databases with languages like SQL, and generate reports with tools like or RMarkdown.
[Read More]I recently took the excellent course on Machine Learning with Python from MIT. In one of the forums somebody asked about how to perform calculations of the expectation maximization (EM) algorithm without for loops. I wrote an answer about how broadcasting can be implemented in numpy to perform vectorized operations that simplify and speed up execution of the code. Because of the relevance of the topic and response from my fellow classmates, I have decided to extend the explanation and share it in this post. First I’ll show how broadcasting works with arrays of different dimensions, and then I’ll use it to implement the K-means clustering algorithm. My goal is to show in a visual way how broadcasting works, hoping it will help anybody struggling with the concept.
[Read More]