Skip to content

Commit

Permalink
Merge pull request #9 from H-unter/patch-1
Browse files Browse the repository at this point in the history
Update 04-classification.Rmd
  • Loading branch information
danhalligan authored Sep 2, 2024
2 parents f58cca9 + 1c9a54a commit 1c79b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 04-classification.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ sum(diag(t)) / sum(t)
> h. Repeat (d) using naive Bayes.
```{r}
fit <- naiveBayes(Direction ~ Lag2, data = Smarket, subset = train)
fit <- naiveBayes(Direction ~ Lag2, data = Weekly, subset = train)
pred <- predict(fit, Weekly[!train, ], type = "class")
(t <- table(pred, Weekly[!train, ]$Direction))
sum(diag(t)) / sum(t)
Expand Down

0 comments on commit 1c79b15

Please sign in to comment.