Take a Data Science Pipeline to Production

The book to learn how to turn your Machine Learning models in a productive Data Science Pipeline

data science pipeline

Data Science in Production: who this book is for

This review covers Data Science in Production: Building Scalable Model Pipelines with Python by Ben Weber. It focuses on taking Python modeling work into repeatable batch, endpoint, and streaming workflows.

Best fit: readers who can already prepare data, train a simple model, and evaluate it, and now want to understand how predictions reach users or other systems. Beginners should complete one small modeling project first.

A useful reading exercise: package preprocessing and the fitted model together, run predictions from a script, record the model version, and add input checks and a failure path. Start with a batch job unless the use case needs immediate responses; our deployment guide explains the choice.

Build your ML foundations with a practical next step. Read the free Starter Kit excerpt on test sets to preview the €19 handbook. No email required.

What is a Data Science Pipeline?

The first step towards understanding why this book is so valuable is knowing what a Data Science Pipeline is.

A data-science project can provide value through an analysis, experiment, or decision even without a production model. When predictions must be delivered repeatedly, a reliable pipeline becomes important.

These projects also have lots of phases: Data Analysis, Feature Extraction, Model Building, Prediction, and output. Each of these phases can be done in a different environment, the definitive model has to be tuned, etc… Also, there is a clear differentiation between Model Training and Model application.

All of this can be tricky to understand, and knowning how to efficiently manage each step, and once all the analytical phases have been done, getting your model ready for its application is fundamental in the sucess of a ML/DS project.

Distinguish a preprocessing-and-model pipeline from the wider production workflow. A scikit-learn Pipeline chains transformations and an estimator; production workflows additionally manage data access, execution, outputs, monitoring, and failures.

Illustration of the 90-day machine learning roadmap PDF

Stay on track. Get the Roadmap.

Download the 90-Day Roadmap PDF + get weekly tips and resources to help you succeed

Review of Data Science in Production

By learning how to build and deploy scalable model pipelines, data scientists can own more of the model production process and more rapidly deliver data products.

This book provides a hands-on approach to scaling up Python code to work in distributed environments in order to build robust pipelines. Readers will learn how to set up machine learning models as web endpoints, serverless functions, and streaming pipelines using multiple cloud environments. It is intended for analytics practitioners with hands-on experience with Python libraries such as Pandas and Scikit-learn, and will focus on scaling up prototype models to production.

Production responsibilities vary by team. Data scientists, ML engineers, data engineers, and software engineers may share the work; understanding interfaces and ownership helps them collaborate.

Awesome, let see what the book contains!

Contents

The contents of Data Science in Production are the following:

  • Chapter 1: Introduction – Introduction to Python and the discipline of applied data science, present the data sets, models, and cloud environments used throughout the book, and provide an overview of automated feature engineering.
  • Chapter 2: Models as Web Endpoints – This chapter shows how to use web endpoints for consuming data and hosting machine learning models as endpoints using the Flask (for web applications) and Gunicorn (for HTTP interfaces) libraries, as well as Scikit-Learn and Keras for the modelling and application.
  • Chapter 3: Models as Serverless Functions – This chapter will build upon the previous chapter and show how to set up model endpoints as serverless functions using AWS Lambda and Google Cloud Platform Cloud Functions.
  • Chapter 4: Containers for Reproducible Models – This chapter will show how to use containers for deploying models with Docker. We’ll also explore scaling up with ECS and Kubernetes, and building web applications with Plotly Dash. These are deployment options to understand, not prerequisites for every small model service.
  • Chapter 5: Workflow Tools for Model Pipelines – This chapter focuses on scheduling automated workflows using Apache Airflow. We’ll set up a model that pulls data from BigQuery, applies a model, and saves the results.
  • Chapter 6: PySpark for Batch Modeling – This chapter will introduce readers to PySpark using the community edition of Databricks. We’ll build a batch model pipeline that pulls data from a data lake, generates features, applies a model, and stores the results to a No SQL database. Pipelines in Python are implemented using a mix of Pyspark and standard Python when treating large data sets, so this chapter is also highly interesting.
  • Chapter 7: Cloud Dataflow for Batch Modeling – This chapter will introduce the core components of Cloud Dataflow and implement a batch model pipeline for reading data from BigQuery, applying an ML model, and saving the results to Cloud Datastore.
  • Chapter 8: Streaming Model Workflows – This chapter will introduce readers to Kafka and PubSub for streaming messages in a cloud environment. After working through this material, readers will learn how to use these message brokers to create streaming model pipelines with PySpark and Dataflow that provide near real-time predictions.

The chapter list spans several deployment patterns. Choose one path for your exercise, and check the current official documentation before running cloud-specific examples, since service interfaces and installation requirements can change.

Summary

Data Science in Production is a text that was highly needed in the Machine Learning and Data Science landscape.

Many books like Python Machine Learning, Hands-On Machine Learning with Scikit-Learn & Tensorflow, or An Introduction to Statistical Learning, which we highly recommend for learning the theory and practice behind the Machine Learning algorithms, focus heavily on these parts, leaving aside the actual end to end implementation or ‘production’ phase all these models have to go through to provide value.

If you go through Data Science in production after being already versed in how Machine Learning algorithms work, how to train and evaluate them, you will greatly stand out from other Data Scientists around you. In that sense, this book is more similar to Building Machine Learning Powered Applications than to the other ones we’ve mentioned, and we think is an essential piece of the library of any hardcore elite Machine Learning engineering.

Before deployment: make sure preprocessing is fitted only on training data and remains consistent at inference time. The scikit-learn pitfalls guide explains why packaging these steps together helps.

As always we hope you liked the review. If you have any comments or want us to review a specific text, send us a message to howtolearnmachinelearning@gmail.com. Also, don’t forget to follow us on Twitter and have a great day!

data science pipeline python

Tags: Data Science Pipeline, Data Science in Production, Python Data Science Pipeline, Machine Learning Books.

Subscribe to our awesome newsletter to get the best content on your journey to learn Machine Learning, including some exclusive free goodies!

HOW IS MACHINE LEARNING