Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created September 17, 2012 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmyleswhite/3734955 to your computer and use it in GitHub Desktop.
Save johnmyleswhite/3734955 to your computer and use it in GitHub Desktop.
Toy Classification
df <- data.frame(IsSpam = c(1, 1, 0, 1),
MentionsViagra = c(0, 1, 0, 1),
MentionsNigeria = c(1, 1, 0, 0))
logistic.fit <- glm(IsSpam ~ MentionsViagra + MentionsNigeria,
data = df,
family = binomial(link = "logit"))
summary(logistic.fit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment