Skip to content

Commit

Permalink
spacing out kwd arguments cls2 bughunt
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Dec 23, 2023
1 parent 685a22d commit c7697f0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/classification2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Here, we pass in the number `1`.

```{r}
set.seed(1)
random_numbers1 <- sample(0:9, 10, replace=TRUE)
random_numbers1 <- sample(0:9, 10, replace = TRUE)
random_numbers1
```

Expand All @@ -255,7 +255,7 @@ we run the `sample` function again, we will
get a fresh batch of 10 numbers that also look random.

```{r}
random_numbers2 <- sample(0:9, 10, replace=TRUE)
random_numbers2 <- sample(0:9, 10, replace = TRUE)
random_numbers2
```

Expand All @@ -265,10 +265,10 @@ value.

```{r}
set.seed(1)
random_numbers1_again <- sample(0:9, 10, replace=TRUE)
random_numbers1_again <- sample(0:9, 10, replace = TRUE)
random_numbers1_again
random_numbers2_again <- sample(0:9, 10, replace=TRUE)
random_numbers2_again <- sample(0:9, 10, replace = TRUE)
random_numbers2_again
```

Expand All @@ -278,10 +278,10 @@ obtain a different sequence of random numbers.

```{r}
set.seed(4235)
random_numbers1_different <- sample(0:9, 10, replace=TRUE)
random_numbers1_different <- sample(0:9, 10, replace = TRUE)
random_numbers1_different
random_numbers2_different <- sample(0:9, 10, replace=TRUE)
random_numbers2_different <- sample(0:9, 10, replace = TRUE)
random_numbers2_different
```

Expand Down Expand Up @@ -512,10 +512,10 @@ cancer_acc_1 <- cancer_test_predictions |>
filter(.metric == 'accuracy')
cancer_prec_1 <- cancer_test_predictions |>
precision(truth = Class, estimate = .pred_class, event_level="first")
precision(truth = Class, estimate = .pred_class, event_level = "first")
cancer_rec_1 <- cancer_test_predictions |>
recall(truth = Class, estimate = .pred_class, event_level="first")
recall(truth = Class, estimate = .pred_class, event_level = "first")
```

In the metrics data frame, we filtered the `.metric` column since we are
Expand All @@ -537,12 +537,12 @@ If the labels were in the other order, we would instead use `event_level="second

```{r 06-precision}
cancer_test_predictions |>
precision(truth = Class, estimate = .pred_class, event_level="first")
precision(truth = Class, estimate = .pred_class, event_level = "first")
```

```{r 06-recall}
cancer_test_predictions |>
recall(truth = Class, estimate = .pred_class, event_level="first")
recall(truth = Class, estimate = .pred_class, event_level = "first")
```

The output shows that the estimated precision and recall of the classifier on the test data was
Expand Down

0 comments on commit c7697f0

Please sign in to comment.