Combinatorics: permutations, combinations and dispositions

Combinatorics is that field of mathematics primarily concerned with counting elements from one or more sets. It can help us count the number of orders in which something can happen. In this article, I’m going to dwell on three different types of techniques:
• permutations
• dispositions
• combinations

Building simple data pipelines in Azure using Cosmos DB, Databricks and Blob Storage

Thanks to tools like Azure Databricks, we can build simple data pipelines in the cloud and use Spark to get some comprehensive insights into our data with relative ease. Combining this with the Apache Spark connector for Cosmos DB, we can leverage the power of Azure Cosmos DB to gain and store some incredible insights into our data. It’s been a while since I’ve written a post on Databricks and since I’ve been working with Cosmos DB quite a bit over the past few months, I’d thought I’d write a simple tutorial on how you can use Azure Blob Storage, Azure Databricks and Cosmos DB to build a straightforward data pipeline that does some simple transformations on our source data. I’m also going to throw a bit of Azure Key Vault into the mix to show you how simple it can be to protect vital secrets in Databricks such as Storage account keys and Cosmos DB endpoints! This blog post is mainly aimed at beginners. Ideally you would have some idea of what each component is and you’d have some understanding of Python.

Six Important Steps to Build a Machine Learning System

Creating a great machine learning system is an art. There are a lot of things to consider while building a great machine learning system. But often it happens that we as data scientists only worry about certain parts of the project. Most of the time that happens to be modeling, but in reality, the success or failure of a Machine Learning project depends on a lot of other factors.
1. Problem Definition
2. Data
2. Data
4. Features
5. Modeling
6. Experimentation

Bayesian Priors and Regularization Penalties

Bayesian Linear Models are often presented as introductory material for those seeking to learn probabilistic programming, coming in with an existing understanding in frequentist statistical learning models. I believe this is effective because it allows one to scaffold new knowledge on top of existing knowledge, and even fit something that was already understood – perhaps as just one tool among many – into a wider and more theoretically satisfying framework. The relationship between the prior distribution of parameters chosen in a Bayesian linear model and the penalty term in regularized least-squares regression is already well known. Despite this, I feel that I was able to come to a more visceral and intuitive understanding of this equivalence by empirically examining the effect of tweaking hyperparameters of each model. I hope my small experiment can do the same for you, and be supplemental to the existing proofs that are available.

30 Helpful Python Snippets That You Can Learn in 30 Seconds or Less

1. All unique
2. Anagrams
3. Memory
4. Byte size
5. Print a string N times
6. Capitalize first letters
7. Chunk
8. Compact
9. Count by
10. Chained comparison
11. Comma-separated
12. Count vowels
13. Decapitalize
14. Flatten
15. Difference
16. Difference by
17. Chained function call
18. Has duplicates
19. Merge two dictionaries
20. Convert two lists into a dictionary
21. Use enumerate
22. Time spent
22. Time spent
24. Most frequent
25. Palindrome
26. Calculator without if-else
27. Shuffle
28. Spread
29. Swap values
30. Get default value for missing keys

3 Python Tools Data Scientists Can Use for Production-Quality Code

It is an unfortunate fact that many data scientists do not know how to write production-quality code.
Production-quality code is code that is:
• Readable;
• Free from errors;
• Robust to exceptions;
• Efficient;
• Well documented; and
• Reproducible.
Producing it is not rocket science.

Practical Experiment Fundamentals All Data Scientists Should Know

A How-to for Non-Parametric Power Analyses, p-values, Confidence Intervals, Checking for Bias. This post will enable you to do a power analysis, calculate p-values, get confidence intervals, and check for bias in your design without making any assumptions (non-parametrically). This post will enable you to do a power analysis, calculate p-values, get confidence intervals, and check for bias in your design without making any assumptions (non-parametrically).

Universal Transformers

This post will discuss the Universal Transformer, which combines the original Transformer model with a technique called Adaptive Computation Time. The main innovation of Universal Transformers is to apply the Transformer components a different number of times for each symbol.

Feature Selection for Machine Learning (1/2)

Feature selection, also known as variable selection, is a powerful idea, with major implications for your machine learning workflow. Why would you ever need it? Well, how do you like to reduce your number of features 10x? Or if doing NLP, even 1000x. What about besides smaller feature space, resulting in faster training and inference, also to have an observable improvement in accuracy, or whatever metric you use for your models? If that doesn’t grab your attention, I don’t know what does. Don’t believe me? This literally happened to me a couple of days ago at work. So, this is a 2 part blog post where I’m going to explain, and show, how to do automated feature selection in Python, so that you can level up your ML game. Only filter methods will be presented because they are more generic and less compute hungry than wrapper methods, while embedded feature selection methods being, well, embedded in the model, aren’t as flexible as filter methods.

Gen Z Know Automation Will Take Their Jobs

Gen Z, the generation that comes after Millennials, are graduating college and entering the workforce. Growing up as digital natives, they know machine intelligence will scale in their generation as workers in the labor force. Those headlines about ‘robots’ coming for our jobs? Well, Gen Z have an inkling. They are actually going to live it. The eldest of Gen Z are only about 24 now, in 2019 and the majority of them are still students. Gen Z is right to have the sentiment that’s in between uncertainty and actual fear regarding their future of work.

Deep learning based web application: from data collection to deployment

Build an image classifier web application from scratch, without need for GPU or credit card. This article describes how to build a deep learning web based application for image classification, without need for GPU or credit card! Even though there are plenty of articles describing this stuff, I couldn’t find a complete guide describing all the steps from data collection to deployment and some details were hard to find (e.g. how to clone a Github repo on Google Drive).

PEARL: Probabilistic Embeddings for Actor-critic RL

A sample-efficient meta reinforcement learning method. Meta reinforcement learning could be particularly challenging because the agent has to not only adapt to the new incoming data but also find an efficient way to explore the new environment. Current meta-RL algorithms rely heavily on on-policy experience, which limits their sample efficiency. Worse still, most of them lack mechanisms to reason about task uncertainty when adapting to a new task, limiting their effectiveness in sparse reward problems. We discuss a meta-RL algorithm that attempts to address these challenges. In a nutshell, the algorithm, namely Probabilistic Embeddings for Actor-critic RL(PEARL) proposed by Rakelly & Zhou et al. in ICLR 2019, is comprised of two parts: It learns a probabilistic latent context that sufficiently describes a task; conditioned on that latent context, an off-policy RL algorithm learns to take actions. In this framework, the probabilistic latent context serves as the belief state of the current task. By conditioning the RL algorithm on the latent context, we expect the RL algorithm to learn to distinguish different tasks. Moreover, this disentangles task inference from action making, which, as we will see later, makes an off-policy algorithm applicable to meta-learning.

Practical guide to Attention mechanism for NLU tasks

Chatbots, virtual assistants, augmented analytic systems typically receive user queries such as ‘Find me an action movie by Steven Spielberg’. The system should correctly detect the intent ‘find_movie’ while filling the slots ‘genre’ with value ‘action’ and ‘directed_by’ with value ‘Steven Spielberg’. This is a Natural Language Understanding (NLU) task kown as Intent Classification & Slot Filling. State-of-the-art performance is typically obtained using recurrent neural network (RNN) based approaches, as well as by leveraging an encoder-decoder architecture with sequence-to-sequence models. In this article we demonstrate hands-on strategies for improving the performance even further by adding Attention mechanism.

From Econometrics to Machine Learning

Why econometrics should be part of your skills. As a Data scientist with a master’s degree in econometrics, I took some time to understand the subtleties that make machine learning a different discipline from econometrics. I would like to talk to you about these subtleties that are not obvious at first sight and that made me wonder all along my journey.

Conditional Love: The Rise of Renormalization Techniques for Conditioning Neural Networks

Batch Normalization, and the zoo of related normalization strategies that have grown up around it, have played an interesting array of roles in recent deep learning research: as a wunderkind optimization trick, a focal point for discussions about theoretical rigor and, importantly, but somewhat more in the sidelines, as a flexible and broadly successful avenue for injecting conditioning information into models. Conditional renormalization started humbly enough, as a clever trick for training more flexible style transfer models, but over the years this originally-simple trick has grown in complexity and conceptual scope. I kept seeing new variants of this strategy pop up, not just on the edges of the literature, but in its most central and novel advances: from the winner of 2017’s ImageNet competition to 2018’s most impressive generative image model. The more I saw it, the more I wanted to tell the story of this simple idea I’d watched grow and evolve from a one-off trick to a broadly applicable way of integrating new information in a low-complexity way.