P(Y|X)=πkfk(x)∑Kl=1πlfl(x)
P(Y|X)=πkfk(x)∑Kl=1πlfl(x)
P(Y|X)=πkfk(x)∑Kl=1πlfl(x)
P(Y|X)=πkfk(x)∑Kl=1πlfl(x)
δk(x)=−12(x−μk)TΣ−1k(x−μk)+logπk
Why do you think this is called quadratic discriminant analysis?
δk(x)=−12(x−μk)TΣ−1k(x−μk)+logπk
Why do you think this is called quadratic discriminant analysis?
library(MASS)model <- qda(default ~ balance + student, data = Default)predictions <- predict(model)
qda()
function in R from the MASS packagemodel <- lda(Species ~ ., data = iris)predictions <- predict(model)
model <- lda(Species ~ ., data = iris) predictions <- predict(model)plot_data <- data.frame(outcome = iris$Species, lda = predictions$x)head(plot_data)
## outcome lda.LD1 lda.LD2## 1 setosa 8.061800 0.3004206## 2 setosa 7.128688 -0.7866604## 3 setosa 7.489828 -0.2653845## 4 setosa 6.813201 -0.6706311## 5 setosa 8.132309 0.5144625## 6 setosa 7.701947 1.4617210
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point()
gg
in "ggplot2" stands for Grammar of Graphics† Source: BloggoType
What function creates the plot?
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point() + labs(x = "LD1", y = "LD2")
What data set is being plotted?
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point() + labs(x = "LD1", y = "LD2")
Which variables are on the x- and y-axis?
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point() + labs(x = "LD1", y = "LD2")
What variable in the dataset determines the color?
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point() + labs(x = "LD1", y = "LD2")
What does geom_point()
mean?
ggplot(data = plot_data, mapping = aes(x = lda.LD1, y = lda.LD2, color = outcome)) + geom_point() + labs(x = "LD1", y = "LD2")
ggplot()
is the main function in ggplot2 and plots are constructed in layersggplot + geom_xxx
ggplot()
is the main function in ggplot2 and plots are constructed in layersggplot + geom_xxx
or, more precisely
ggplot(data = [dataset], mapping = aes(x = [x-variable], y = [y-variable])) + geom_xxx() + other options
What is K here?
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
log(p1(x)1−p1(x))=log(p1p2)=c0+c1x1+⋯+cpxp
P(Y|X)=πkfk(x)∑Kl=1πlfl(x)
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |