Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Document preview thumbnail
Voorbeeld 4 van de 35 pagina's
Samenvatting

Data Science Methods Course Summary | UvA | 2026/27

Document preview thumbnail
Voorbeeld 4 van de 35 pagina's

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.

Voorbeeld van de inhoud

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)

Documentinformatie

Geüpload op
27 augustus 2026
Aantal pagina's
35
Geschreven in
2025/2026
Type
Samenvatting
€12,96

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Verkocht
0
Volgers
0
Items
2
Laatst verkocht
-

Echte notities, van echte studenten
Elk document op Stuvia is geschreven door een medestudent die hetzelfde vak deed. Zo leer je van iemand die het al heeft gehaald.



Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen