Machine learning plays an increasingly important role in many scientific domains. A Python programmer can use high-quality machine learning frameworks for classic machine learning as well as for state-of-the-art algorithms.
This training concentrates on methodological and practical aspects of machine learning and how to apply those using Python.
Learning outcomes
When you complete this training you will
- understand what supervised and unsupervised learning are;
- understand the workflow required for supervised learning;
- be able to implement that workflow in scikit-learn;
- know how to use algorithms in scikit-learn such as ridge regression and naive Bayes classification;
- be able to apply k-means clustering;
- understand the main concepts in deep neural networks;
- be able to apply a convolutional neural network (CNN) to an image classification task;
- understand the concepts underpinning hyperparameter optimization;
- understand the concepts underpinning simple Physics-Informed Neural Networks (PINNs);
- be aware of best practices and pitfalls in machine learning.
Schedule
Total duration: 4 hours.
| Subject | Duration |
|---|---|
| introduction and motivation | 20 min. |
| scikit-learn: regression | 40 min. |
| scikit-learn: classification | 30 min. |
| science-learn: clustering | 20 min. |
| coffee break | 10 min. |
| introduction to neural networks | 10 min. |
| Image classification with CNNs | 40 min. |
| Physics-Informed Neural Networks | 30 min. |
| hyperparameter optimization | 30 min. |
| wrap up | 10 min. |
Training materials
Slides are available in the GitHub repository, as well as example code and hands-on material.
Video sessions
Video recordings of this training are available on YouTube.
- Introduction (25 minutes)
- scikit-learn: data pipelines and regression (28 minutes)
- scikit-learn: classification and clustering (12 minutes)
- keras: introduction to neural networks (13 minutes)
- keras: multilayer perceptrons for digit recognition (34 minutes)
- keras: convolutional neural networks for digit recognition (19 minutes)
- keras: recurrent neural networks for sentiment classification (26 minutes)
Target audience
This training is for you if you need to use Python for machine learning applications.
Prerequisites
You will need experience programming in Python. This is not a training that starts from scratch. Familiarity with numpy is not required, but would be beneficial. Familiarity with numpy, pandas and matplotlib is strongly recommended.
If you plan to do Python programming in a Linux or HPC environment you should be familiar with these as well.
More concretely, participants should already be comfortable with the following:
- running Python code in Jupyter or from the command line;
- variables, numbers, strings, booleans, and basic containers such as lists, tuples, and dictionaries;
if/elsestatements,forloops, and simple comprehensions;- writing and calling functions with arguments and return values;
- importing modules and reading short Python scripts without needing every line explained;
- basic NumPy array operations such as creating arrays, slicing them, and applying simple vectorized computations;
- basic pandas usage such as reading tabular data and selecting rows or columns;
- basic plotting with matplotlib, for instance plotting a curve or a scatter plot and interpreting the result.
You do not need prior experience with scikit-learn, Keras, PyTorch, LIME, Hyperopt, Optuna, or PINNs. Those are part of the training itself.
Quick self-assessment
If you can do most of the tasks below without looking up basic Python syntax, you are likely ready for this training.
- load a small CSV file into a pandas DataFrame and inspect a few columns;
- create a NumPy array, compute its mean, and select a slice from it;
- write a function that computes a simple quantity such as mean squared error for two arrays of numbers;
- use
if/elseto convert a numeric score into a class label; - read a short notebook cell that imports data, transforms it, and plots it;
- make a small change to an example script or notebook and run it again;
- create a basic matplotlib plot and explain what the axes and values mean;
- read a short traceback and identify roughly where an error occurred.
If several of these items still feel difficult, the training will probably move too fast. In that case, it is better to first take a short introductory Python course and a short introduction to NumPy/pandas/matplotlib first.
Software and access requirements
For following along hands-on, you need
- laptop or desktop with internet access.
- a system set up so you can connect to an HPC system, an account on an HPC system (e.g., VSC, CECI, …), compute credits if that is required to run jobs on the HPC system if you want to use an HPC system;
- a Python environment that can run Jupyter Lab if you want to use your own system (note that you would require a GPU for some of the examples to work);
- access to Google Colaboratory if you prefer not to install software.
Level of the Material
For participants who already have basic Python programming experience, the material in this training is approximately
- Introductory: 15 %
- Intermediate: 35 %
- Advanced: 50 %
These percentages describe the level of the machine learning topics covered in the training, not the required entry level in Python itself.
Trainer(s)
- Geert Jan Bex (geertjan.bex@uhasselt.be)