Algorithms and Programming in Python
ENSAI, second year · Rennes
Course description
The course covers numerical programming in Python and its use to implement optimization and estimation methods for machine learning: least squares, regularized regression with gradient and proximal methods, and Gaussian mixture models. Each session combines a lecture with implementation exercises in Jupyter notebooks.
Prerequisites: basic programming in any language, elementary linear algebra, means and variances, and running commands in a terminal.
Sessions
-
1.
Python, NumPy, and linear regressionPython and NumPy essentials, array shapes and broadcasting, a reproducible least-squares workflow.
-
2.
Ridge regressionGradient descent, momentum and Nesterov acceleration, stochastic gradient descent.Materials to be posted.
-
3.
Elastic netProximal gradient descent.Materials to be posted.
-
4.
Gaussian mixture modelsProjected gradient descent and the expectation–maximization algorithm.Materials to be posted.
-
5.
Reproducibility, metrics, and evaluationMaterials to be posted.
-
6.
Final exam
Assessment
A three-hour written exam in class, consisting of one exercise closely related to the sessions: adapting an optimization algorithm from the course or applying the course methods to a real-world problem. Online documentation is allowed; LLM assistance is not.
Setup
The materials use Python 3.12 and uv. Installation instructions are in the repository README.