CPSC 330 Lecture 23: Deployment and conclusion
Announcements
- Last lecture today 🥺!
- HW9 is due Friday, Dec 5th at 11:59 PM (No late submission allowed.)
- My OH next week has been moved to 11 AM. Do you prefer in-person or Zoom OH?
- For an in-person OH I’ll book a larger room.
iClicker
What percentage of machine learning projects do you think never make it into production?
- Between 20-30%
- Around 50%
- Between 60-70%
- Between 80-90%
Source
Model deployment
Model deployment is the process of making machibe learing model available for use in production enviroments.
- Carefully development machine learning models is only half the story.
- The real challenge in practice is getting ML to work reliably in the real world!!
Model deployment
Model deployment is a complex, multi-step process that requires making several important decisions, such as:
- Choosing the right infrastructure: What hardware or cloud resources are needed (CPU, GPU, memory, storage)?
- Meeting performance requirements: What latency and throughput do users expect?
- Planning for scale: How many users or requests per second must the system support, now and in the future?
- Monitoring in production: How will you track model performance, data drift, and system health over time?
- Managing model updates: When deploying a new version, how do you verify that it actually performs better than the current model (e.g., A/B tests)?
Goal of this lecture
To demonstrate, through a simple example, how you can take the models you’ve built in this course (or in your side projects) and deploy them in a lightweight, real-world setting.
❓❓ Questions for you
Imagine you’ve created a machine learning model and are eager to share it with others. Consider the following scenarios for sharing your model:
- To a non-technical Audience: How would you present your model to friends and family who may not have a technical background?
- To a technical audience: How would you share your model with peers or professionals in the field who have a technical understanding of machine learning?
- In an academic or research setting: How would you disseminate your model within academic or research communities?
What do we need?
- After we train a model, we want to use it!
- The user likely does not want to install your Python stack, train your model.
- You don’t necessarily want to share the dataset.
- So we need to do two things:
- Save/store your model for later use.
- Make the saved model conveniently accessible.
Course evaluations (~15 mins)
https://canvas.ubc.ca/courses/170662/external_tools/53187
- They help us improve our teaching!
- UBC & CS uses them to provide rewards to instructors and TAs who are doing well!
- UBC & CS uses them to identify where instructors, TAs and courses need additional supports to improve.
- UBC uses these in evaluating professors for tenure and promotion.
- I’ll very much appreciate your constructive and concrete feedback.
iClicker
What do you typically do when you get stressed?
- Talk to LLMs
- Talk to a human friend
- Spend time with myself (meditate, go for a walk, exercise etc)
- Suffer in silence
What did we cover
Part 1: Supervised learning on tabular data: ML fundamentals, preprocessing and data encoding, a bunch of models, evaluation metrics, feature importances and model transparency, feature selection, hyperparameter optimization
Part 2: Dealing with other non-tabular data types: Clustering, recommender systems, computer vision with pre-trained deep learning models (high level), language data, text preprocessing, embeddings, topic modeling, time series, right-censored data / survival analysis
Part 3: Communication, ethics, and deployment
What we didn’t cover
- How do these models work under the hood
What next?
If you want to further develop your machine learning skills:
❓❓ Questions for you
For each of the scenarios below
- Identify if ML is a good solution for a problem. If yes
- Frame the problem to a ML problem.
- Discuss what kind of features you would need to effectively solve the problem
- What would be a reasonable baseline?
- Which model would be a suitable model for the given scenario?
- What would be the appropriate success metrics.
❓❓ More scenarios for practice
| To-doList App |
Keep track of the tasks that a user inputs and organize them by date |
| SegmentSphere App |
To segment customers to tailor marketing strategies based on purchasing behavior |
| Video app |
Recommend useful videos |
| Dining app |
Identify cuisine by a restaurant’s menu |
| Weather app |
Calculate precipitation in six hour increments for a geographic region |
| EvoCarShare app |
Calculate number of car rentals in four increaments at a particular Evo parking spot |
| Pharma app |
Understand the effect of a new drug on patient survival time |
Conclusion & farewell
That’s all! We made it! I hope you learned something useful from the course. You all are wonderful students and I had fun teaching this course ♥️!
![]()
If you didn’t fill out course evaluations during class , it’ll be great if you can fill them in when you get a chance.
Time permitting
![]()