Created
October 28, 2011 03:28
-
-
Save smc77/1321556 to your computer and use it in GitHub Desktop.
Multiclass Logistic Regression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plot the data | |
pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", pch = 21, bg = c("red", "green3", "blue")[unclass(iris$Species)]) | |
# Use linear discriminant analysis | |
iris.lda <- lda(Species ~ ., data = iris) | |
summary(iris.lda) | |
# Use a multinomial logistic regression model | |
library(VGAM) | |
iris.vglm <- glm(Species ~ , family=multinomial, data=iris) | |
summary(iris.vglm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment