So you’ve built a model: Now what?

Lecture 18

Dr. Benjamin Soltoff

Cornell University
INFO 4940/5940 - Fall 2024

November 7, 2024

Announcements

Announcements

  • Homework 04
  • Project exploration

You’ve built a model - now what?

A flowchart diagramming the machine learning operations lifecycle, including collecting data, understanding and cleaning data, training and evaluating models, deploying model, and monitoring model.

Documentation and deployment

Documentation

  • Document your model and its performance
  • Document the data used to train the model
  • Document the model’s assumptions and limitations

Deployment

  • Deploy the model to a production environment
  • Monitor the model’s performance in production
  • Update the model as needed

Documentation

Who is documentation for?

  • Yourself
  • Peers
  • Manager/supervisor
  • Clients
  • Jane Q Public

What to document

  • Data collection/provenence
  • Exploratory analysis
  • Feature selection
  • Model tuning/selection
  • Model evaluation

How to document

File types

  • Literate programming (aka Quarto notebooks)
  • Scripts with code comments
  • README files

Version control

  • Git and GitHub
  • Commit history
  • Branches

Deployment

Deployment is the process of integrating a trained ML model into a production environment so it can be used to make predictions or decisions.

  • Batch processing
  • Web app
  • iOS/Android app
  • API

Deployment is often in collaboration with software engineers, but you should be able to informatively participate or demo the product.

Common deployment methods

  • Batch processing locally
  • Web application with Shiny
  • API with {plumber} and {vetiver}
  • Export model to implement in different programming language (e.g. SQL, Java, C, C++, Python, Ruby)