Test-Driven Machine Learning

Control your machine learning algorithms using test-driven development to achieve quantifiable milestones

Test-Driven Machine Learning

This ebook is included in a Mapt subscription
Justin Bozonier

1 customer reviews
Control your machine learning algorithms using test-driven development to achieve quantifiable milestones
$0.00
$16.00
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781784399085
Paperback190 pages

Book Description

Machine learning is the process of teaching machines to remember data patterns, using them to predict future outcomes, and offering choices that would appeal to individuals based on their past preferences.

Machine learning is applicable to a lot of what you do every day. As a result, you can’t take forever to deliver your first iteration of software. Learning to build machine learning algorithms within a controlled test framework will speed up your time to deliver, quantify quality expectations with your clients, and enable rapid iteration and collaboration.

This book will show you how to quantifiably test machine learning algorithms. The very different, foundational approach of this book starts every example algorithm with the simplest thing that could possibly work. With this approach, seasoned veterans will find simpler approaches to beginning a machine learning algorithm. You will learn how to iterate on these algorithms to enable rapid delivery and improve performance expectations.

The book begins with an introduction to test driving machine learning and quantifying model quality. From there, you will test a neural network, predict values with regression, and build upon regression techniques with logistic regression. You will discover how to test different approaches to naïve bayes and compare them quantitatively, along with how to apply OOP (Object-Oriented Programming) and OOP patterns to test-driven code, leveraging SciKit-Learn.

Finally, you will walk through the development of an algorithm which maximizes the expected value of profit for a marketing campaign by combining one of the classifiers covered with the multiple regression example in the book.

Table of Contents

Chapter 1: Introducing Test-Driven Machine Learning
Test-driven development
The TDD cycle
Behavior-driven development
Our first test
TDD applied to machine learning
Dealing with randomness
Different approaches to validating the improved models
Quantifying the classification models
Summary
Chapter 2: Perceptively Testing a Perceptron
Getting started
Summary
Chapter 3: Exploring the Unknown with Multi-armed Bandits
Understanding a bandit
Testing with simulation
Starting from scratch
Simulating real world situations
A randomized probability matching algorithm
A bootstrapping bandit
The problem with straight bootstrapping
Multi-armed armed bandit throw down
Summary
Chapter 4: Predicting Values with Regression
Refresher on advanced regression
Generating our own data
Building the foundations of our model
Cross-validating our model
Generating data
Summary
Chapter 5: Making Decisions Black and White with Logistic Regression
Generating logistic data
Measuring model accuracy
Generating a more complex example
Test driving our model
Summary
Chapter 6: You're So Naïve, Bayes
Gaussian classification by hand
Beginning the development
Summary
Chapter 7: Optimizing by Choosing a New Algorithm
Upgrading the classifier
Applying our classifier
Upgrading to Random Forest
Summary
Chapter 8: Exploring scikit-learn Test First
Test-driven design
Planning our journey
Getting choosey
Developing testable documentation
Summary
Chapter 9: Bringing It All Together
Starting at the highest level
The real world
What we've accomplished
Summary

What You Will Learn

  • Get started with an introduction to test-driven development and familiarize yourself with how to apply these concepts to machine learning
  • Build and test a neural network deterministically, and learn to look for niche cases that cause odd model behaviour
  • Learn to use the multi-armed bandit algorithm to make optimal choices in the face of an enormous amount of uncertainty
  • Generate complex and simple random data to create a wide variety of test cases that can be codified into tests
  • Develop models iteratively, even when using a third-party library
  • Quantify model quality to enable collaboration and rapid iteration
  • Adopt simpler approaches to common machine learning algorithms
  • Take behaviour-driven development principles to articulate test intent

Authors

Table of Contents

Chapter 1: Introducing Test-Driven Machine Learning
Test-driven development
The TDD cycle
Behavior-driven development
Our first test
TDD applied to machine learning
Dealing with randomness
Different approaches to validating the improved models
Quantifying the classification models
Summary
Chapter 2: Perceptively Testing a Perceptron
Getting started
Summary
Chapter 3: Exploring the Unknown with Multi-armed Bandits
Understanding a bandit
Testing with simulation
Starting from scratch
Simulating real world situations
A randomized probability matching algorithm
A bootstrapping bandit
The problem with straight bootstrapping
Multi-armed armed bandit throw down
Summary
Chapter 4: Predicting Values with Regression
Refresher on advanced regression
Generating our own data
Building the foundations of our model
Cross-validating our model
Generating data
Summary
Chapter 5: Making Decisions Black and White with Logistic Regression
Generating logistic data
Measuring model accuracy
Generating a more complex example
Test driving our model
Summary
Chapter 6: You're So Naïve, Bayes
Gaussian classification by hand
Beginning the development
Summary
Chapter 7: Optimizing by Choosing a New Algorithm
Upgrading the classifier
Applying our classifier
Upgrading to Random Forest
Summary
Chapter 8: Exploring scikit-learn Test First
Test-driven design
Planning our journey
Getting choosey
Developing testable documentation
Summary
Chapter 9: Bringing It All Together
Starting at the highest level
The real world
What we've accomplished
Summary

Book Details

ISBN 139781784399085
Paperback190 pages
Read More
From 1 reviews

Read More Reviews