Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 35 pages
Summary

Data Science Methods Course Summary | UvA | 2026/27

Document preview thumbnail
Preview 4 out of 35 pages

Complete course summary for Data Science Methods at Universiteit van Amsterdam, covering Python fundamentals, model evaluation, regularization, dimensionality reduction, classification, clustering, and Bayesian updating. The document includes lecture notes, tutorials, worked exam exercises, and a quick-reference guide spanning core topics from Python basics (lists, dictionaries, NumPy, Pandas) through advanced techniques like PCA, logistic regression, LDA, and model averaging. Ideal for exam preparation and consolidating material across the full course—saves time by having all key concepts and worked examples in one structured resource.

Content preview

Data Science Methods
Complete Course Summary

Python Fundamentals, Model Evaluation & Regularization,
Dimensionality Reduction, Classi
cation, Clustering &
Bayesian Updating, and Model Averaging




Lecture Notes, Tutorials, Worked Exam Exercises & Quick-Reference Guide

,Data Science Methods  Complete Course Summary 1

Contents
I Lecture Notes & Tutorials 3
1 Introduction to Python 3
1.1 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Input, Functions & Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 String Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.8 Mathematical Sequences (Fibonacci) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.9 NumPy Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.10 Pandas Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.11 Function Calls & Code Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


2 Object-Oriented Programming 5
2.1 Classes and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Attributes and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Practical Example: Linear Regression Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6


3 Model Evaluation 6
3.1 Linear Model for Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Determine Model Parameters using Maximum Likelihood . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Types of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4 Bias-Variance Decomposition and Trade-O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.5 Model Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.6 Data-Rich Situations: Many Data Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.7 Cross-Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8


4 Dimensionality & Nonparametric Methods 9
4.1 Shrinkage Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Dimension Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Principal Component Analysis (PCA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4 Selecting the Optimal L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 Nonparametric Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10


5 LDA and Logistic Regression 12
5.1 Classi
cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 Bayes Classi
er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 Decision Boundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4 Linear Classi
ers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.5 Linear Probability Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.6 Linear Discriminant Analysis (LDA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.7 Quadratic Discriminant Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.8 Receiver Operating Characteristic (ROC) Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.9 Logistic Regression Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.10 Stochastic Gradient Descent (SGD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.11 Comparison Logistic Regression and LDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15


6 Clustering and Bayesian Updating 17
6.1 Clustering Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.2 K-means Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.3 Hierarchical Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.4 Bayesian Updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.5 Bayes Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.6 Priors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.7 Bayesian Linear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.8 Bayes Estimator (Squared Loss) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

,Data Science Methods  Complete Course Summary 2

6.9 Bayes Estimator (Absolute Loss) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19


7 Model Averaging 21
7.1 Model Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2 The Simplest Way for Model Averaging Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.3 Granger-Ramanathan Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.4 Expectation-Maximization (EM) Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22




II Additional Worked Exam Exercises 25
8 Generalization Error & Bias-Variance (Exam Exercises) 26
9 PCA & Dimensionality Reduction (Exam Exercises) 26
10 Classi
cation: LDA & k-NN (Exam Exercises) 28
11 Clustering & Bayesian Updating (Exam Exercises) 30
12 Code Questions (Debugging & Reading Python) 31
13 Machine Learning Methods  Quick Reference 32
13.1 1. Classi
cation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
13.2 2. Non-Parametric Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
13.3 3. Regression & Regularization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
13.4 4. Optimization Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
13.5 5. Dimensionality Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
13.6 6. Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
13.7 7. Fisher's Discriminant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
13.8 Key Formulas Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

, Data Science Methods  Complete Course Summary 3

Part I
Lecture Notes & Tutorials
1 Introduction to Python
1.1 Lists
# Create
a = [1 ,2 ,3]
# Add element
a . append (4)
# Insert element at position
a . insert (2 , " June " )
# Negative indexing
a [ -1] # last element
# Loop through list
for i in a :
print ( i *2)
# Array indexing with indices
indices = [0 ,2 ,1]
result = a [ indices ]


1.2 Tuples
# Create
t = (2 ,2 ,3)
# Immutable ! Cannot be changed


1.3 Dictionaries
# Create
d = { 'a ' :1}
# Add element
d [ 'b '] = 2
# Remove element
d . pop ( 'a ')


1.4 Sets
# Unique values , unordered
s = {1 ,2 ,3}
# Add element
s . add (4)


1.5 Control Flow
# If - else
if x <0:
print ( " negative " )
elif x ==0:
pass
else :
print ( " positive " )

# For - loop
a = [1 ,2 ,3 ,4]
for i in a :
print ( i *2)

# While - loop with stopping criterion
n = 5
while n < 10:
print ( n *( n -1) /2)

Document information

Study
Uploaded on
August 27, 2026
Number of pages
35
Written in
2025/2026
Type
Summary
$15.47

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
2
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions