Files
MachLePublic/PW-3/ex3/ex3-review-questions-stud.ipynb
gabriel.marinoja b72020d0f7 feat: added PW3
2025-10-01 17:58:36 +02:00

173 lines
4.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"cells": [
{
"cell_type": "markdown",
"id": "ad0d40d6",
"metadata": {},
"source": [
"# Exercice 3 - Review questions"
]
},
{
"cell_type": "markdown",
"id": "3e556a9d",
"metadata": {},
"source": [
"**a) Assuming an univariate input *x*, what is the complexity at inference time of a Bayesian classifier based on histogram computation of the likelihood ?**"
]
},
{
"cell_type": "markdown",
"id": "8d2fb7ef",
"metadata": {},
"source": [
"TODO"
]
},
{
"cell_type": "markdown",
"id": "99632770",
"metadata": {},
"source": [
"**b) Bayesian models are said to be generative as they can be used to generate new samples. Taking the implementation of the exercise 1.a, explain the steps to generate new samples using the system you have put into place.**\n",
" "
]
},
{
"cell_type": "markdown",
"id": "88ab64b2",
"metadata": {},
"source": [
"TODO"
]
},
{
"cell_type": "markdown",
"id": "e2f611fe",
"metadata": {},
"source": [
"***Optional*: Provide an implementation in a function generateSample(priors, histValues, edgeValues, n)**"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "14aba0f7",
"metadata": {},
"outputs": [],
"source": [
"pass"
]
},
{
"cell_type": "markdown",
"id": "ed8c4f6b",
"metadata": {},
"source": [
"**c) What is the minimum overall accuracy of a 2-class system relying only on priors and that is built on a training set that includes 5 times more samples in class A than in class B?**"
]
},
{
"cell_type": "markdown",
"id": "4bb03365",
"metadata": {},
"source": [
"TODO"
]
},
{
"cell_type": "markdown",
"id": "58450ff6",
"metadata": {},
"source": [
"**d) Lets look back at the PW02 exercise 3 of last week. We have built a knn classification systems for images of digits on the MNIST database.**\n",
"\n",
"**How would you build a Bayesian classification for the same task ? Comment on the prior probabilities and on the likelihood estimators. More specifically, what kind of likelihood estimator could we use in this case ?**"
]
},
{
"cell_type": "markdown",
"id": "d2bf1500",
"metadata": {},
"source": [
"TODO"
]
},
{
"cell_type": "markdown",
"id": "a3ca9715",
"metadata": {},
"source": [
"***Optional:* implement it and report performance !**"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "4de72736",
"metadata": {},
"outputs": [],
"source": [
"pass"
]
},
{
"cell_type": "markdown",
"id": "b812b46f",
"metadata": {},
"source": [
"**e) Read [europe-border-control-ai-lie-detector](https://theintercept.com/2019/07/26/europe-border-control-ai-lie-detector/). The described system is \"a virtual policeman designed to strengthen European borders\". It can be seen as a 2-class problem, either you are a suspicious traveler or you are not. If you are declared as suspicious by the system, you are routed to a human border agent who analyses your case in a more careful way.**\n",
"\n",
"1. What kind of errors can the system make ? Explain them in your own words.\n",
"2. Is one error more critical than the other ? Explain why.\n",
"3. According to the previous points, which metric would you recommend to tune your MLsystem ?"
]
},
{
"cell_type": "markdown",
"id": "1adf1760",
"metadata": {},
"source": [
"TODO"
]
},
{
"cell_type": "markdown",
"id": "195a1f73-c0f7-4707-9551-c71bfa379960",
"metadata": {},
"source": [
"**f) When a deep learning architecture is trained using an unbalanced training set, we usually observe a problem of bias, i.e. the system favors one class over another one. Using the Bayes equation, explain what is the origin of the problem.**"
]
},
{
"cell_type": "markdown",
"id": "fa5ffd45-0645-4093-9a1b-0a7aeaeece0e",
"metadata": {},
"source": [
"TODO"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}