Skip to content

Commit

Permalink
typo fixed and detail added to model.matrix comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
schafert committed Aug 27, 2024
1 parent 233b9e0 commit a3d08ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 05_from-scratch-model.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ hist(df$LogFare)
unique(df$Pclass) |> sort()
unique(df$Embarked) |> sort()
df |>
select(Sex, Pclass, Embarked) |>
mutate(Pclass = as.character(Pclass)) |>
model.matrix(object = ~.-1) |>
head()
df <- df |>
fastDummies::dummy_cols(select_columns = c("Sex", "Pclass", "Embarked"))
Expand Down Expand Up @@ -118,7 +124,7 @@ loss <- abs(preds - t_dep) |>
loss
```

- save useful functions for repition
- save useful functions for repetition

```{r}
Expand Down

0 comments on commit a3d08ac

Please sign in to comment.