From c7697f0f8958714eaa469dc1dfd3d2d155fa3160 Mon Sep 17 00:00:00 2001 From: Trevor Campbell Date: Fri, 22 Dec 2023 21:46:45 -0500 Subject: [PATCH] spacing out kwd arguments cls2 bughunt --- source/classification2.Rmd | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/classification2.Rmd b/source/classification2.Rmd index 7431d6aaa..ee4672d95 100644 --- a/source/classification2.Rmd +++ b/source/classification2.Rmd @@ -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 ``` @@ -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 ``` @@ -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 ``` @@ -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 ``` @@ -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 @@ -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