Advanced Python Programming 2400-MIKRO-AIBF-APP
Course content description
The workshop ("ćwiczenia") is devoted to deepening students' programming competences beyond the introductory level, with particular emphasis on practical applications in data analysis, statistical modelling, and machine learning. Classes take place in a computer laboratory and are workshop-based, aiming to develop students' ability to design, write, and critically evaluate more advanced Python code, and to apply appropriate statistical and machine-learning methods to real datasets.
The course is organised into three thematic blocks, delivered as an intensive one-day workshop (09:00–14:00).
Block 1 — Advanced Python & Object-Oriented Programming (09:00–10:30) The workshop covers advanced Python functions, including *args/**kwargs, closures, lambda expressions, and list/dict comprehensions. It introduces the fundamentals of object-oriented programming: classes, inheritance, dunder methods, properties, and encapsulation. It also addresses good practices in scripting and project structure, including modules, packaging, argparse, logging, and virtual environments.
Block 2 — Statistical Methods & Unsupervised Machine Learning (10:45–12:15) The workshop begins with a NumPy and pandas recap, covering vectorized operations versus loops, method-chaining pipelines, and missing-data handling (drop/fill/interpolate). It then introduces statistical methods in Python, including hypothesis testing with scipy.stats (t-tests, Shapiro-Wilk, chi-square, Pearson correlation, Mann-Whitney U test) and OLS regression with statsmodels. Students are introduced to K-Means clustering, covering the intuition behind unsupervised learning, the iterative assignment/update algorithm, implementation with sklearn's KMeans, and model selection via the elbow method and silhouette score. The block concludes with Principal Component Analysis (PCA), addressing the problem of correlated features, the concept of principal components and orthogonality, explained variance ratio, and a hands-on demonstration using sklearn's PCA.
Block 3 — Supervised Machine Learning: Ensembles & Neural Networks (12:30–14:00) The workshop covers the full machine-learning evaluation workflow, including train/test splitting, cross-validation, and evaluation metrics (accuracy, precision, recall, F1-score). It introduces decision trees (root/leaf nodes, Gini impurity versus entropy, tree depth and stopping criteria, overfitting versus underfitting) and ensemble methods, including Random Forest (bagging, feature importance, hyperparameter tuning with GridSearchCV) and XGBoost/gradient boosting (boosting intuition, xgb.XGBClassifier, early stopping). The block concludes with an introduction to neural networks, covering the perceptron and multilayer perceptron (MLP), the concept of backpropagation, and practical implementation using MLPClassifier or Keras Sequential.
Throughout all three blocks, emphasis is placed on writing clean, reproducible, and well-documented code applicable to economic and social-science data.
The project ‘Application of Artificial Intelligence in Business and Finance’ (No. BPI/SPI/2024/1/00078) is implemented by the University of Warsaw as part of the Spinaker programme organised by the National Agency for Academic Exchange (within the project ‘Wsparcie tworzenia i realizacji międzynarodowych programów kształcenia’, funded by the European Funds for Social Development 2021–2027).
Course coordinators
Micro-credential certificate
Learning outcomes
Upon completing the course, the participant
in terms of knowledge: knows and understands advanced Python programming constructs, including *args/**kwargs, closures, lambda functions, and comprehensions; knows and understands the principles of object-oriented programming, including classes, inheritance, dunder methods, properties, and encapsulation; knows and understands good practices in scripting and project organisation, including modularisation, packaging, logging, and virtual environments; knows and understands the theoretical foundations of statistical hypothesis testing and OLS regression; knows and understands the principles of unsupervised machine learning methods, including K-Means clustering and Principal Component Analysis; knows and understands the machine-learning model-evaluation workflow and the theoretical foundations of decision trees, ensemble methods (Random Forest, gradient boosting), and neural networks.
in terms of skills: is able to write advanced, well-structured Python code using appropriate functional and object-oriented programming techniques; is able to organise a Python project according to good scripting practices, including the use of modules, argument parsing, logging, and virtual environments; is able to perform vectorized data manipulation and build data-processing pipelines using NumPy and pandas; is able to conduct statistical hypothesis tests and estimate regression models using scipy.stats and statsmodels; is able to apply and evaluate unsupervised machine-learning methods (K-Means, PCA) to real datasets; is able to build, tune, and evaluate supervised machine-learning models, including decision trees, Random Forest, XGBoost, and neural networks, using appropriate performance metrics and validation procedures.
in terms of social competences: is ready to critically evaluate the results and limitations of statistical and machine-learning analyses; is ready to apply principles of clean, reproducible, and well-documented coding practice in collaborative and independent work; is ready to responsibly select and apply appropriate analytical methods when working with economic and social-science data.
Assessment criteria
Written assessment (post-test)
Bibliography
Literature:
1. David J. Malan, CS50: Introduction to Computer Science - https://www.youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V
2. https://www.w3schools.com/python/