Learn how to deploy your ML models into production with confidence by load testing your APIs in Python with Flask and Locust

Photo by Danist on Unsplash

Deploying with confidence

Deploying a Machine Learning (ML) model as a live service to be consumed by a business-critical system or directly by end-users can be a scary prospect. The more in-demand the system, the higher the risk that issues with your model may disrupt it. However, you also can’t keep your models stuck in a notebook either. They need to be out there generating value for your customers and your business.

There are a number of ways to allay these anxieties. One approach is (on paper) straightforward: have a robust testing strategy. At the end of the day, an effective testing strategy…


Applying Data Science to Data Science: a deep dive into the best-loved technologies in the world of Data Science in 2020.

Photo by Christopher Burns on Unsplash

Digging in

This article takes a look at what the online Data Science community has been writing about over the last couple of years, with an aim of understanding the trends in technology over the course of 2020. To do this, I’ve sampled roughly 30,000 unique Data Science stories from across Medium between the January 2019 and mid-December 2020.

This article is broken into two parts:

  1. Technology — This section takes a deep-dive into the technologies that the Data Science world has been writing about and responding to this year. …


Getting Started

Photo by Taylor Vick on Upsplash

Getting abstract

Over the last decade or two, cloud computing has come to dominate many of the skills and processes needed to develop ‘modern’ software. This is increasingly true for adjacent fields too, including the world of Data Science (among others). One of the trends in this sweeping move towards ‘The Cloud’ has been the ever-increasing levels of abstraction with respect to how development teams interact with the infrastructure running their applications.

Arguably at the top of this pyramid of abstraction is the concept of serverless computing, and it is built on the idea that (as the name suggests), developers need not…


Data scientists: choosing whether to join a startup is a big decision. Here’s some advice to help you figure out whether life at a startup is for you.

Photo from Unsplash by artifactflash

This post is (as the title might suggest) inspired by Chip Huyen’s ‘7 reasons not to join a startup and 1 reason to’ post. While reading it, I was reminded of several conversations I’ve had over the last year or so with various ML practitioners inside and outside of startups on why I think people should join a startup. Many of the topics in Chip’s post came up in those discussions, though perspectives regularly differed. I also realised I hadn’t taken the time to lock-in my own ideas on the topic. In other words: I was inspired to get my…


Getting APIs into production can be a bewildering prospect. This post gives you tips and a template for using Flask in production.

Photo by Tim Foster on Unsplash

What is Flask?

If you work in the world of (or a world adjacent to) cloud software and are familiar with Python, the chances are you’ll have come across Flask — the excellent, minimal ‘ micro’ web framework that’s been at the heart of the Python web community for around a decade. It has found its way into a huge number of applications, reportedly including aspects of the LinkedIn and Pinterest platforms, as well as innumerable other commercial, private and research projects too. This popularity ensures it has a vibrant ecosystem of extensions, documentation and tutorials.

So why another Flask blog post? Over…


Getting Started

Erlend Ekseth on Unsplash

Deployment is hard

Deploying software regularly and reliably is hard. Deploying software that utilises Machine Learning (ML) models regularly and reliably can be harder still. At the end of the day, the long-term value of your latest model pipeline will be determined (in part) by how much your company or your customers trust the resulting service, and how quickly you can address changing customer requirements by iterating on your pipeline.

That’s where automation can come in very handy: careful automation of ML pipelines can massively boost your productivity by allowing you to rapidly iterate on a pipeline in order to account for new…


Kelli McClintock on Unsplash

In Part 1 of this series, you saw a few practical examples of how Object-Oriented Programming (OOP) can be used to help you resolve some code design problems. If you missed it, it’s over here:

Right, let’s dig in.

Getting technical

The language around OOP can seem intimidating. You’ve seen some of this language in the example in Part 1, but let’s make it a little more concrete. Firstly, let’s start with probably the most basic question: what’s the difference between a class and an object?

  • Classes — The definition of the data and procedures available to a given structure. In other…

Creating CLIs can help improve accessibility and reuse of your ML pipelines, but they can be a pain to set up. Enter Fire.

Photo by Cullan Smith from Unsplash

What is Fire?

A few months ago, I had an enthusiastic outburst in which I expressed my appreciation for a little package called TQDM for creating progress bars. This post is in the same vein but this time for Fire: a great package that can make getting a Command Line Interfaces (CLI) up and running in (literally) a couple of seconds a breeze.

So, why write a CLI? Practically, a simple CLI can make configuring a script as simple as changing a couple of command line arguments. Let’s say you’ve got a script set up on an orchestration service (maybe something like Jenkins)…


Photo by Rene Böhmer from Unsplash.

What is Streamlit?

If you’re familiar with the Data Science software ecosystem in Python, you’ll likely have come across a handful of widely used dashboarding and data visualization tools designed for programmatic usage (e.g. to be embedded in notebooks or to be served as standalone web-apps). For the last few years, the likes of Dash, Bokeh and Voila have been some of the biggest open-source players in this space. Within the world of R, there’s also the long-standing champion of dashboarding tools: Shiny.

With this relatively mature ecosystem in place, you may question the need for a yet another framework to join the…


Kelli McClintock on Unsplash

The power of OOP

If you’ve been programming for at least a little while, you’ll likely have come across (and perhaps used) Object Oriented Programming (OOP) concepts and language-features. This programming paradigm has been a central concept in software engineering since the mid-90’s, and can provide some very powerful capabilities to programmers — especially when used carefully.

However, it isn’t uncommon for many programmers to swirl around concepts like OOP for many years — perhaps gaining the odd bit of insight here and there — but not consolidating that understanding into a clear set of ideas. For beginners too, the concepts of OOP can…

Mark Douthwaite

Applied AI specialist, computer scientist, software engineer. Read more at https://mark.douthwaite.io/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store