Python Programming Fundamentals
This section builds the programming foundation you will need to work with data and Machine Learning tools in Python. Here, we progressively introduce the concepts and tools that are most relevant for biological data analysis.
We will review the core building blocks of Python: variables and data types: numbers (integers and floats) and text (strings). Then, you will learn to work with main Python data structures — lists, tuples, dictionaries, and sets — understanding when and why to use each. We then introduce the distinction between built-in functions (such as len(), type(), and print()) and methods (operations that belong to a specific object, such as my_string.upper()), which is essential for reading and writing Python code confidently.
From there, we move to control flow: for loops for iterating over sequences, and if/elif/else conditionals for making decisions in code. These constructs are the backbone of almost every Python programme you will write. We also cover how to import modules and libraries, giving you access to the vast Python ecosystem beyond the built-in language.
On the practical side, you will learn to work in the Anaconda environment using Jupyter Notebooks — an interactive, cell-based interface that is widely used in data science and bioinformatics, and that allows you to write code, visualise results, and document your reasoning all in one place. You will also learn the basics of debugging — reading error messages, identifying where code goes wrong, and applying simple strategies to fix it.
Python Libraries for Data Analysis
We will introduce three essential Python libraries that together form the standard toolkit for scientific data analysis:
NumPy — provides support for numerical computation and efficient manipulation of arrays and matrices, which are the underlying data structures used by most ML libraries.
Pandas — the go-to library for working with tabular data. You will learn to load, inspect, filter, transform, and summarise datasets using Pandas DataFrames, which behave much like spreadsheets but with the full power of Python.
Matplotlib — the foundational Python library for data visualisation. You will create a range of plots to explore and communicate patterns in your data.
These tools come together in Exploratory Data Analysis (EDA) — the critical first step of any data-driven project, in which you examine a dataset to understand its structure, identify missing or inconsistent values, detect patterns and outliers, and formulate hypotheses before applying any ML algorithm. EDA is not just a technical routine: it is where your understanding of the data begins, and where many important decisions about the subsequent analysis are made.
Machine Learning Fundamentals
This section introduces the core concepts and workflow of Machine Learning, providing the conceptual foundation you will build on throughout the rest of the course.
We begin by exploring the main types of Machine Learning — supervised and unsupervised learning — and the problems each is designed to solve: classification (assigning data to discrete categories), regression (predicting continuous numerical values), and clustering (discovering natural groupings in unlabelled data). Along the way, we introduce essential vocabulary that you will encounter constantly in the ML literature: classes, labels, features, and the distinction between training, validation, and test sets.
We then walk through the six fundamental steps of a Machine Learning workflow, which provide a repeatable, structured approach to any ML problem:
Import the data — load your dataset into the working environment
Clean the data — handle missing values, inconsistencies, and formatting issues
Split the data — divide the dataset into a training set and a test set
Create a model — choose and train a Machine Learning algorithm on the training data
Check the output — evaluate model performance on the test set
Improve — refine the model by tuning parameters, adding data, or revisiting earlier steps
These six steps are not merely a checklist: they reflect the iterative, critical thinking process that underlies good ML practice — and that you will apply hands-on in the exercises that follow.
4-data_and_ML_algorithms (Google slides)
This lecture introduces the core concepts at the intersection of data and Machine Learning. Starting from the historical evolution of data storage and management — from spreadsheets to Big Data — it explains why ML emerged as an essential analytical tool. The three main paradigms of traditional ML are presented: supervised learning (classification and regression), unsupervised learning (clustering and dimensionality reduction), and reinforcement learning. For each paradigm, key characteristics, biological examples, and representative datasets are discussed. The lecture builds essential vocabulary — features, labels, training data, decision boundaries — that underpins all subsequent hands-on work in the course.
Lesson on Plotting and Programming in Python:
Episode on: Libraries
Explain what software libraries are and why programmers create and use them.
Write programs that import and use modules from Python’s standard library.
Find and read documentation for the standard library interactively (in the interpreter) and online.
Import the Pandas library.
Use Pandas to load a simple CSV data set.
Get some basic information about a Pandas DataFrame.
Select individual values from a Pandas dataframe.
Select entire rows or entire columns from a dataframe.
Select a subset of both rows and columns from a dataframe in a single operation.
Select a subset of a dataframe by a single Boolean criterion.
Explain what for loops are normally used for.
Trace the execution of a simple (unnested) loop and correctly state the values of variables in each iteration.
Write for loops that use the Accumulator pattern to aggregate values.
Explain why programs need collections of values.
Write programs that create flat lists, index them, slice them, and modify them through assignment and method calls.
Correctly write programs that use if and else statements and simple Boolean expressions (without logical operators).
Trace the execution of unnested conditionals and conditionals inside loops.
This module walks through the complete workflow for building machine learning models, from raw data to evaluation. Starting with data import and inspection using pandas, it covers preprocessing (handling missing values, encoding, scaling, dimensionality reduction with PCA), and the crucial train/test split. It then moves to model selection and training with scikit-learn, followed by performance evaluation using appropriate metrics. A final step on model improvement — through feature engineering, algorithm selection, and hyperparameter tuning — frames the whole process as an iterative scientific cycle. Throughout, key concepts such as reproducibility, data leakage prevention, and domain expertise are emphasised.