This commit is contained in:
Francesco Mecca 2020-06-28 12:50:46 +02:00
parent 4af9518c85
commit 395f612967
76 changed files with 2425 additions and 6 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

View file

@ -0,0 +1,116 @@
* Esposito
** Tasks: Binary Classification
I modelli predittivi si occupano di inferire delle informazioni sui
nuove istanze di problemi in base ai dati gia` consumati
*** TODO Geometric classification
*** Probabilistic classifier
Stima probabilita` dai dati e fornisce predizioni usando la seguente
regola:
- Yₘₐₚ = $arg max_{Y}P(Y|X)$ = $argmax_Y\frac{(P(X|Y)(PY)}{P(X))}$ =
$argmax_Y\frac{(P(X|Y)(PY)}{P(Y))}$
- Yₘₗ = $argmax_YP(X|Y)$ (se priori non importanti)
*** Features
Se vogliamo approssimare la funzione coseno e` inutile considerare
un'approssimazione lineare (y=0).
Pero` possiamo usare x come sia come splitting feature (due
approssimazioni diverse se x<0 o x≥0) e come variabile di regression
(l'approssimazione contiene x)
Delle volte si puo` mappare il feature space su nuovi spazi (e.g.:
scatter plot: renderlo al quadrato)
** Classification
$\hat{c}$: X → C
C = {C₁, C₂, ..., Cₖ}
example: <x, c(x)>
Learning is constructing $\hat{c}$
*** TODO Decision Tree
Vedi decision tree, feature tree, contingency table
*** Misure
- Accuracy: $acc = \frac{1}{|T_e|}\sum I[\hat{c}(x)=c(x)] = P(\hat{c}(x) = c(x))$
- Error rate: $1-acc = P(\hat{c}(x) \ne c(x))$
- class ratio, clr: $\frac{Pos}{Neg} = \frac{\sum_{x\in{T_e}}
I[c(x)=1]}{\sum_{x\in{T_e}} I[c(x)=0]}$
- recall, true positive rate: $\frac{TP}{Pos} = P(\hat{c}(x)|c(x))$
- specificity, true negative rate = $\frac{TP}{Pos} =
P(\hat{c}(x)|c(x))$
- false positive, false negative = 1-tnr, 1-tpr
- Precision, confidence = $\frac{TP}{TP+FP} = P(c(x)|\hat{c}(x))$
*** TODO Coverage plot e roc plot
*** Scoring Classifier
mapping $\hat{s}: X \to R^k$ dove s e` un vettore s(x) = (s₁(x),
s₂(x), ..., sₖ(x)). i-th componente = score della classe Cᵢ
Nello scoring tree, in caso di classificazione binaria, si possono
usare nelle foglie il logaritmo del ratio fra lo score delle classi.
**** Margine e Loss f
Prendiamo la classe true come +1:
- z(x) = c(x)$\hat{s}(x)$
Il margine e` il valore assoluto della predizione, positivo se giusta,
negativo se errata.
La Loss function L(z(x)): R → [0, ∞); L(0) = 1 e L(z<0)≥1 e
L(z>0)∈[0,1)
La loss function e` importante nella fase di learning per cercare la
soluzione ottimale
- 0-1 Loss
- Hinge Loss
- Logistic Loss
- Exp Loss
- Squared Loss
**** Ranking
Una funzione di scoring puo` essere trasformata in una di ranking
ordinando le istanze in base allo score ottenuto.
Ranking-Error quando $\hat{s}(x)<\hat{s}(x') \wedge s(x') < s(x)$
- $\frac{\sum_{x\in{T^+_e},x'\in{T^-_e}}{I[\hat{s}(x) < \hat(s)(x')] +
I[\hat{s}(x) = \hat(s)(x')]}}{Pos\cdot Neg}$
- Ranking accuracy: 1 - Rank-Err
*** Probability Estimator
Scoring classifier che per ogni classe restituisce la probabilita` che
l'istanza appartenga a quella classe
- $\hat{p}: X \to [0,1]^k$
- $\sum_{i=1}^{k}{\hat{p_i}(x)} = 1$
- Squared Error: $SE(x) = \frac{1}{2} \Vert \hat{p}(x) - I_{c(x)} \Vert
^2_2 = \frac{1}{2}\sum_{i=1}^{k}(\hat{p}(x) - I[c(x) = C_i])^2$
- Mean Squared Error: $MSE(T_e) =
\frac{1}{|T_e|}\sum_{x\in{T_e}}SE(x)$
- Empirical Probability: Vettore dato dal numero di istanze sul totale
per ogni classe (frequenza)
Solitamente si applica un coefficente di smoothing per queste
frequenze
- Laplace correction: $\dot{p_i}(S) = \frac{n_i+1}{|S|+k}$
- m-estimate: non uniform smoothing dato da pseudo-counts m e prior
probs πᵢ $\dot{p_i}(S) = \frac{n_i+m\cdot\pi_i}{|S|+m}$
*** TODO Beyond Binary Classification
Vedi 1-vs-rest, 1-vs-1 e cosi` via
*** Overfitting, bias-variance
L'overfitting si evita avendo un numero di parametri ben piu` basso
dei data points.
Con un numero basso di parametri si introduce un bias che spesso anche
con un training elevato non si riesce a risolvere.
Invece con pochi parametri si introduce una forte dipendenza dal test
set e quindi molta varianza.
- $E[(f(x)-\hat{f}(x))^2] = Bias^2(\hat{f}(x)) + Var(\hat{f}(x))$
(vedi dimostrazione slides)
** Descriptive Learning
Tasks and learning problem coincide. No separate training set, produce
a descriptive model of the data at hand. Learn a model describing the
data.
*** Clustering
Obbiettivo: trovare gruppi omegenei, trovare una labelling function da
dati senza label.
- $\hat{q}: X \to C$ (predictive)
- $\hat{q}: X \to L$ (descriptive)
*** Supervised subgroup discovery
Preso un dataset labelled (xᵢ, l(xᵢ))ⁱ trova:
- $\hat{g}: D \to {true, false}$
- G = {x∈D | $\hat{g}$(x) = true}, la cui class distribution e`
diversa marcatamente dalla popolazione originale
*** Association Rules
Dato un dataset unlabelled D trova:
- un set di regole {b→h} tale che:
+ h solitamente e` soddisfatta quando b lo e`
+ bh e` frequente (high support: %n di elementi soddisfano la
regola)
- Il powerset di un insieme di regole frequenti e` frequente a sua
volta.
- Confidenza: support(ab)/suport(a)
** Models
*** Linear Models
* Meo

BIN
tesi/files/translation.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2020-06-28T10:06:21.168Z" agent="5.0 (X11)" etag="hmtl1UaNTklAC09ORMXS" version="13.3.5" type="device"><diagram id="Rl04uFA25Sl_5NPlgoGT" name="Page-1">7VpLc5swEP41PrbD23Bs7TQ5pJnMuE2TU0cB2agViAg5tvvrK4p4yo6JYx5OfWHY1fvbT6vVwkifBOtLCiL/K/EgHmmKtx7p05Gm2ZbFn4likyoMx0kVC4q8VKUWihn6A4VSEdol8mBcqcgIwQxFVaVLwhC6rKIDlJJVtdqc4OqoEVhASTFzAZa1P5DHfLEsUyn0VxAt/GxkVRElAcgqC0XsA4+sSir9YqRPKCEsfQvWE4gT7DJc0nZfdpTmE6MwZE0aaN8NeLmyQXz9E8yuVjcYPDkfRC/PAC/Fgr8BuoCM6ybclGLmbJPBwbvkyHPh88pHDM4i4CYlK257rvNZgLmk8lfRL6QMrndOWM1h4PSBJICMbngV0cASwAnmZJCvCjOoGbZ+yQS20AFh+UXecQEOfxH4vAYrSwJLxsfj7BEiocwnCxICfFFoP1OyDD2YjKNwqahzTUgksPsFGduIrQCWjGxDNhnoZVz5vMiSuvCFFYn5s9Tku+vp2+1EIQYMPVfncXzYx/8r7GafsGsS6rN0XYmvHZZn0I3eXYP53jiqN+ToDkN1w1F9N0c5NJqSn2UuCSKEIZWMUoW8c+ZqSkPmWm0xV5cjgBNnrnEK3tWQUM+5+gwoAo+YB72aglHMevW0BxO2NVeryZu+D8Jy/OjmXrT/JzwkwkczE6frcuF0I6QjEt1sSHT7jUQXTW8JClnBDKN+CNctns5LtKoZPZ/G4TyQT9zc9wfiEsooCGO+SNK/35dClqa3mdYcfzbYeR9ZDffRuJ19ZFaZoerd7iPt3QUATe1p9BkAyLmEPAA4Afdl9e295JxAHb4egyZjPLDMlb33rBwQWv3f5rV3d5t3GrpEVdluqm58oiPBfle6CwUgilC4GBRXVad3rsp7+8S5mn352U/WXnNPqhw/30GK5sjlg5NwlHxACT0k3i9hCOkgjnJrfOCNvrWzXJUj0Cl0UZwid0uJC70llTPOXSNnDw85TULu4mmJuAhDOW/0KrzmCOMJwZywSVvdA9Ceu1wfM0p+w1KJ5drwcX4chMdOLRTYEjk5WwAetwawnGy6IUmQedIwO/bQYJbTofIhFnqfku/5XHIxiGPk1hIJa8TuS++lNAKXiixCImRJhAEkH7J/GvYddtZ2i5YsZm6xWKZ7Y45Cr3s+p8aEdJlSjkJOdmi1joxaR20nO9oi2gE0U7sjWdNMsXMm2TFI1uQ/kc68WYc0sxvSbNctsxuemc6ReGYZPfOsyY8x3Z2a3fFsfOZZpzyT8zIH86zg1kOpZB/PioCsY6apTcOz9CbWF9Vs9UhUs+uf+zumWvbt60y1fXfSM9V2Uo2LxV/VafXi13T94i8=</diagram></mxfile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,7 +1,7 @@
* Apprendimento Automatico [2/3] * Apprendimento Automatico [2/4]
- [X] Scrivile per date di esame - [X] Scrivile per date di esame
- [X] Richiedi date esame - [X] Richiedi date esame
- [ ] Slides [0/2] - [ ] Slides [0/5]
- [ ] 002: - [ ] 002:
+ [ ] Laplace adjustment + [ ] Laplace adjustment
+ [ ] Output code decoding + [ ] Output code decoding
@ -22,13 +22,13 @@
+ [ ] Sum of squared error + [ ] Sum of squared error
+ [ ] Silhouttes + [ ] Silhouttes
+ [ ] Rivedi kernelization + [ ] Rivedi kernelization
- [ ] Esercizi: - [-] Esercizi [1/3]
- [ ] es1: perche` min_impurity decrease - [X] es1: perche` min_impurity decrease
- [ ] chiedi a Galla`, Marco e Naz quali sono tutti gli es - [ ] chiedi a Galla`, Marco e Naz quali sono tutti gli es
- [ ] linear models.zip? - [ ] linear models.zip?
* Tesi [8/33] * Tesi [9/33]
- [ ] Rivedere inference rules di Gabriel e aggiustarle con le mie - [X] Rivedere inference rules di Gabriel e aggiustarle con le mie
- [ ] Definisci domain sempre allo stesso modo, con bigcup o | - [ ] Definisci domain sempre allo stesso modo, con bigcup o |
- [ ] Scegli se usare [[t_s]\] o D(ts) - [ ] Scegli se usare [[t_s]\] o D(ts)
- [X] Definizione di First(x_i): serve? - [X] Definizione di First(x_i): serve?