Photo by Sam Moqadam on Unsplash

Getting Started

Lean ML

How do the principles of Lean Software Development apply to Machine Learning projects? Let’s take a look!

--

Introduction

Born in the auto industry (compliments of Toyota), lean manufacturing principles have been enthusiastically embraced by the software engineering community. Overall the lean principles seek to minimize wasted effort during software development and maximize customer delight with your product. If it works for building cars and building traditional software, it’s worth taking a look at for your next ML project!

Here are the principles:

  • Eliminate waste
  • Build quality in
  • Accelerate learning
  • Defer decisions
  • Deliver fast
  • Empower your team
  • Optimize the whole

Get your board going

Kanban board on Microsoft Azure (image by author)

Before I do anything on a project I make sure I have my Kanban board setup! In the spirit of staying lean it doesn’t get much simpler to manage a project than by defining the tasks (as they reveal themselves) and tracking each task from To Do -> Doing -> Done!

This is the simplest, lightest-weight version of the Agile methodology. The full methodology involves scheduling things like Features, Stories, and Tasks into Sprints — which can be overkill for a lot of projects.

Best of all — Kanban boards are free! Follow this link from Microsoft to get started doing this in the cloud:

POC vs MVP vs Product

Microsoft word processing products (image by author)

When it comes to succeeding on an ML project it’s important to walk before you run. I always start out with a no-tech or low-tech POC to tease out whether or not the project is worthwhile. There’s no reason to invest a lot of time or money in building a sophisticated ML model when the payoff is nowhere in sight.

As I move from the shallow to the deeper end of the pool it’s imperative to challenge myself regarding the value-proposition of my ML project.

For illustrative purposes we can think of Microsoft’s word processing offerings along these lines: Notepad is a bare-bones text editor; Wordpad takes it a step further with rudimentary rich text formatting; Microsoft Word is the end-all-be-all word processor aimed at professionals.

Proof of Concept (POC)

This is the prototyping phase where I prove out that the overall concept for applying machine learning technologies to my project is valuable. It’s important to move fast / fail fast at this point: I just use out-of-the-box algorithms and frameworks to quickly stand up a barely-functional version of what I’m thinking about.

Minimum Viable Product (MVP)

Now it’s time to get serious about constructing a machine learning model that can withstand the rigors of deployment to production. If I’ve cleared the POC hurdle and made it this far it’s time to invest in an exhaustive model selection / tuning effort and ensure that the plumbing in my MLOps pipeline will hold up under pressure.

The key to success in this phase is to curb my enthusiasm for product features. This version of my machine learning project doesn’t need to delight customers — it just needs to provide them with some basic functionality and give them a taste of what’s to come.

Product

Assuming my MVP generated a lot of excitement, it’s time to rollup my sleeves and get serious about features. The plumbing and scaffolding should be in place by now, so most of the effort at this point revolves around teasing out which specific features would delight my customer, and what an optimal workflow might be.

I strive to never underestimate how important workflow is. Back in the day there were these cumbersome-to-use portable MP3 players for listening to music. The early models were anything but intuitive and required reading the user manual to operate. Then along came Apple with their iPod and the game changed completely. We all now expect to be able to use apps on our phones without instruction — our machine learning products should embrace that level of usability.

Evolutionary not revolutionary

At their essence the lean principles are about evolving from a rudimentary prototype to a fully-functioning product in production. I find one of the hardest parts about this process is letting go of dead-ends: when I find myself heading in a direction that’s not bearing fruit I need to STOP, BACKUP, and TRY AGAIN! Easier said than done. But it’s not about mapping out the perfect product with the perfect plan — it’s about discovering the ideal product through rapid, iterative attempts.

The 7 principles

Photo by Fabrizio Chiagano on Unsplash

The lean principles are more of an attitude or philosophy than a concrete project lifecycle methodology. I try to keep them in mind on my ML projects — but avoid getting too rigorous about it — it’s all about staying lean!

Eliminate waste

The imperative here is to streamline the development process — trimming away anything that is slowing down the delivery of value to the customer. This can mean overly bureaucratic processes, excessive context-switching, requirements churn, too lofty of goals — to name a few.

Build quality in

Bugs are a waste of everyone’s time. The surest way to reduce software quality is to setup a QA department. Quality needs to be everyone’s concern — all along the pipeline — not just those that have the noun in their title.

Accelerate learning

The team on an ML project should walk away at the end with more knowledge than they started with. Peer reviews, frequent brainstorming sessions, training presentations, thorough documentation and meaningfully commented code are some examples of how to make this happen.

Defer decisions

I try to lock in assumptions and decisions to my ML model as late as possible — embracing an iterative approach to fleshing out my project and resisting the temptation to commit before I have to.

Deliver fast

The sooner my ML project is placed in the hands of the customer the sooner I’ll receive valuable feedback — setting me up for success on the next iteration.

Empower your team

Team members must feel a sense of ownership to reach their highest productivity, so making sure the communication lines stay open and everyone’s opinion is being respected is paramount here.

Optimize the whole

What we’re focusing on with this principle is improving our velocity of delivering value to customers — across the entire ML project team. It’s about all team members and stakeholders reducing friction wherever it appears in the pursuit of maximizing speed.

Conclusion

Challenge yourself to use a Kanban board on your next ML project — even if it’s just a quick tutorial. Keep the 7 lean principles in front of you and consider how they might apply to what you’re currently working on. Is there an opportunity to separate your deliverables into a POC / MVP / Product? What might that look like?

--

--

Writer, guitarist, AI/ML enthusiast, software engineer & architect: Azure | .NET | C# | Blazor | Web APIs | JSON | Microservices