Skip to content

Commit b079f30

Browse files
committed
Fix a few typos
1 parent ebf35b6 commit b079f30

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎README.Rmd‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ if (suppressPackageStartupMessages(require(doParallel) & require(doRNG))) {
275275

276276
## Bootstrapped cutpoints
277277

278-
It has been shown that bagging can substantially improve performance of a wide range of types of models in regression as well as in classification tasks. In the setting of generating a numerical output, a number of bootstrap samples is drawn and the final result is the average of all models that were fit to the bootstrap samples. We make this pricinple available for cutpoint estimation via the `maximize_boot_metric` and `minimize_boot_metric` functions. If one of these functions is used as `method`, `boot_cut` bootstrap samples are drawn, the cutpoint optimization is carried out in each one and a summary (e.g. the mean) of the resulting optimal cutpoints on the bootstrap samples is returned as the optimal cutpoint in `cutpointr`. Note that if bootstrap validation is run, i.e. if `boot_runs` is larger zero, an outer bootstrap will be executed. In the bootstrap validation routine `boot_runs` bootstrap samples are generated and each one is again bootstrapped `boot_cut` times. This may lead to long run times, so activating the built-in parallelization may be advisable. The advantages of bootstrapping the optimal cutpoint are that the procedure doesn't possess parameters that have to be tuned, unlike the LOESS smoothing, that it doesn't rely on assumptions, unlike the Normal method, and that it is applicable to any metric that can be used with `minimize_metric` or `maximize_metric`, unlike the Kernel method. Furthermore, like Random Forests cannot be overfit by increasing the number of trees, the bootstrapped cutpoints cannot be overfit by running an excessive amount of `boot_cut` repetitions.
278+
It has been shown that bagging can substantially improve performance of a wide range of types of models in regression as well as in classification tasks. In the setting of generating a numerical output, a number of bootstrap samples is drawn and the final result is the average of all models that were fit to the bootstrap samples. We make this principle available for cutpoint estimation via the `maximize_boot_metric` and `minimize_boot_metric` functions. If one of these functions is used as `method`, `boot_cut` bootstrap samples are drawn, the cutpoint optimization is carried out in each one and a summary (e.g. the mean) of the resulting optimal cutpoints on the bootstrap samples is returned as the optimal cutpoint in `cutpointr`. Note that if bootstrap validation is run, i.e. if `boot_runs` is larger zero, an outer bootstrap will be executed. In the bootstrap validation routine `boot_runs` bootstrap samples are generated and each one is again bootstrapped `boot_cut` times. This may lead to long run times, so activating the built-in parallelization may be advisable. The advantages of bootstrapping the optimal cutpoint are that the procedure doesn't possess parameters that have to be tuned, unlike the LOESS smoothing, that it doesn't rely on assumptions, unlike the Normal method, and that it is applicable to any metric that can be used with `minimize_metric` or `maximize_metric`, unlike the Kernel method. Furthermore, like Random Forests cannot be overfit by increasing the number of trees, the bootstrapped cutpoints cannot be overfit by running an excessive amount of `boot_cut` repetitions.
279279

280280
```{r}
281281
set.seed(100)
@@ -411,7 +411,7 @@ cutpointr(suicide, dsi, suicide, gender, method = oc_youden_normal)
411411

412412
### Nonparametric kernel method
413413

414-
A nonparametric alternative is the "kernel method" [@fluss_estimation_2005]. Here, the empirical distribution functions are smoothed using the Gaussian kernel functions $\hat{F}_N(t) = \frac{1}{n} \sum^n_{i=1} \Phi(\frac{t - y_i}{h_y})$ and $\hat{G}_P(t) = \frac{1}{m} \sum^m_{i=1} \Phi(\frac{t - x_i}{h_x})$ for the negative and positive classes respectively. Following Silverman's plug-in "rule of thumb" the bandwidths are selected as $h_y = 0.9 * min\{s_y, iqr_y/1.34\} * n^{-0.2}$ and $h_x = 0.9 * min\{s_x, iqr_x/1.34\} * m^{-0.2}$ where $s$ is the sample standard deviation and $iqr$ is the inter quartile range. It has been demontrated that AUC estimation is rather insensitive to the choice of the bandwidth procedure [@faraggi_estimation_2002] and thus the plug-in bandwith estimator has also been recommended for cutpoint estimation. Indeed, as our preliminary simulations have shown, the choices of the bandwidth and the kernel function do not seem to exhibit a considerable influence on the variability (or bias) of the estimated cutpoints. Thus, the `oc_youden_kernel` function in **cutpointr** uses a Guassian kernel and the direct plug-in method for selecting the bandwidths. The kernel smoothing is done via the `bkde` function from the **KernSmooth** package [@wand_kernsmooth:_2013].
414+
A nonparametric alternative is the "kernel method" [@fluss_estimation_2005]. Here, the empirical distribution functions are smoothed using the Gaussian kernel functions $\hat{F}_N(t) = \frac{1}{n} \sum^n_{i=1} \Phi(\frac{t - y_i}{h_y})$ and $\hat{G}_P(t) = \frac{1}{m} \sum^m_{i=1} \Phi(\frac{t - x_i}{h_x})$ for the negative and positive classes respectively. Following Silverman's plug-in "rule of thumb" the bandwidths are selected as $h_y = 0.9 * min\{s_y, iqr_y/1.34\} * n^{-0.2}$ and $h_x = 0.9 * min\{s_x, iqr_x/1.34\} * m^{-0.2}$ where $s$ is the sample standard deviation and $iqr$ is the inter quartile range. It has been demonstrated that AUC estimation is rather insensitive to the choice of the bandwidth procedure [@faraggi_estimation_2002] and thus the plug-in bandwidth estimator has also been recommended for cutpoint estimation. Indeed, as our preliminary simulations have shown, the choices of the bandwidth and the kernel function do not seem to exhibit a considerable influence on the variability (or bias) of the estimated cutpoints. Thus, the `oc_youden_kernel` function in **cutpointr** uses a Gaussian kernel and the direct plug-in method for selecting the bandwidths. The kernel smoothing is done via the `bkde` function from the **KernSmooth** package [@wand_kernsmooth:_2013].
415415

416416
Again, there is a way to calculate the Youden-Index from the results of this method [@fluss_estimation_2005] which is
417417

@@ -458,7 +458,7 @@ dat <- data.frame(outcome = c("neg", "neg", "neg", "pos", "pos", "pos", "pos"),
458458
Since the distance of the optimal cutpoint (8) to the next lowest
459459
observation (3) is rather large we arrive at a range of possible cutpoints that
460460
all maximize the metric. In the case of this kind of sparseness it might for example be
461-
desirable to classify a new obsevation with a predictor value of 4 as belonging
461+
desirable to classify a new observation with a predictor value of 4 as belonging
462462
to the negative class. If `use_midpoints` is set to `TRUE`, the mean of the
463463
optimal cutpoint and the next lowest observation is returned as the optimal
464464
cutpoint, if direction is `>=`. The mean of the optimal cutpoint and the next

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ More robust cutpoint estimation methods
517517
Bootstrapped cutpoints
518518
----------------------
519519

520-
It has been shown that bagging can substantially improve performance of a wide range of types of models in regression as well as in classification tasks. In the setting of generating a numerical output, a number of bootstrap samples is drawn and the final result is the average of all models that were fit to the bootstrap samples. We make this pricinple available for cutpoint estimation via the `maximize_boot_metric` and `minimize_boot_metric` functions. If one of these functions is used as `method`, `boot_cut` bootstrap samples are drawn, the cutpoint optimization is carried out in each one and a summary (e.g. the mean) of the resulting optimal cutpoints on the bootstrap samples is returned as the optimal cutpoint in `cutpointr`. Note that if bootstrap validation is run, i.e. if `boot_runs` is larger zero, an outer bootstrap will be executed. In the bootstrap validation routine `boot_runs` bootstrap samples are generated and each one is again bootstrapped `boot_cut` times. This may lead to long run times, so activating the built-in parallelization may be advisable. The advantages of bootstrapping the optimal cutpoint are that the procedure doesn't possess parameters that have to be tuned, unlike the LOESS smoothing, that it doesn't rely on assumptions, unlike the Normal method, and that it is applicable to any metric that can be used with `minimize_metric` or `maximize_metric`, unlike the Kernel method. Furthermore, like Random Forests cannot be overfit by increasing the number of trees, the bootstrapped cutpoints cannot be overfit by running an excessive amount of `boot_cut` repetitions.
520+
It has been shown that bagging can substantially improve performance of a wide range of types of models in regression as well as in classification tasks. In the setting of generating a numerical output, a number of bootstrap samples is drawn and the final result is the average of all models that were fit to the bootstrap samples. We make this principle available for cutpoint estimation via the `maximize_boot_metric` and `minimize_boot_metric` functions. If one of these functions is used as `method`, `boot_cut` bootstrap samples are drawn, the cutpoint optimization is carried out in each one and a summary (e.g. the mean) of the resulting optimal cutpoints on the bootstrap samples is returned as the optimal cutpoint in `cutpointr`. Note that if bootstrap validation is run, i.e. if `boot_runs` is larger zero, an outer bootstrap will be executed. In the bootstrap validation routine `boot_runs` bootstrap samples are generated and each one is again bootstrapped `boot_cut` times. This may lead to long run times, so activating the built-in parallelization may be advisable. The advantages of bootstrapping the optimal cutpoint are that the procedure doesn't possess parameters that have to be tuned, unlike the LOESS smoothing, that it doesn't rely on assumptions, unlike the Normal method, and that it is applicable to any metric that can be used with `minimize_metric` or `maximize_metric`, unlike the Kernel method. Furthermore, like Random Forests cannot be overfit by increasing the number of trees, the bootstrapped cutpoints cannot be overfit by running an excessive amount of `boot_cut` repetitions.
521521

522522
``` r
523523
set.seed(100)
@@ -667,7 +667,7 @@ cutpointr(suicide, dsi, suicide, gender, method = oc_youden_normal)
667667

668668
### Nonparametric kernel method
669669

670-
A nonparametric alternative is the "kernel method" \[@fluss\_estimation\_2005\]. Here, the empirical distribution functions are smoothed using the Gaussian kernel functions $\\hat{F}\_N(t) = \\frac{1}{n} \\sum^n\_{i=1} \\Phi(\\frac{t - y\_i}{h\_y})$ and $\\hat{G}\_P(t) = \\frac{1}{m} \\sum^m\_{i=1} \\Phi(\\frac{t - x\_i}{h\_x})$ for the negative and positive classes respectively. Following Silverman's plug-in "rule of thumb" the bandwidths are selected as *h*<sub>*y*</sub> = 0.9 \* *m**i**n*{*s*<sub>*y*</sub>, *i**q**r*<sub>*y*</sub>/1.34}\**n*<sup>−0.2</sup> and *h*<sub>*x*</sub> = 0.9 \* *m**i**n*{*s*<sub>*x*</sub>, *i**q**r*<sub>*x*</sub>/1.34}\**m*<sup>−0.2</sup> where *s* is the sample standard deviation and *i**q**r* is the inter quartile range. It has been demontrated that AUC estimation is rather insensitive to the choice of the bandwidth procedure \[@faraggi\_estimation\_2002\] and thus the plug-in bandwith estimator has also been recommended for cutpoint estimation. Indeed, as our preliminary simulations have shown, the choices of the bandwidth and the kernel function do not seem to exhibit a considerable influence on the variability (or bias) of the estimated cutpoints. Thus, the `oc_youden_kernel` function in **cutpointr** uses a Guassian kernel and the direct plug-in method for selecting the bandwidths. The kernel smoothing is done via the `bkde` function from the **KernSmooth** package \[@wand\_kernsmooth:\_2013\].
670+
A nonparametric alternative is the "kernel method" \[@fluss\_estimation\_2005\]. Here, the empirical distribution functions are smoothed using the Gaussian kernel functions $\\hat{F}\_N(t) = \\frac{1}{n} \\sum^n\_{i=1} \\Phi(\\frac{t - y\_i}{h\_y})$ and $\\hat{G}\_P(t) = \\frac{1}{m} \\sum^m\_{i=1} \\Phi(\\frac{t - x\_i}{h\_x})$ for the negative and positive classes respectively. Following Silverman's plug-in "rule of thumb" the bandwidths are selected as *h*<sub>*y*</sub> = 0.9 \* *m**i**n*{*s*<sub>*y*</sub>, *i**q**r*<sub>*y*</sub>/1.34}\**n*<sup>−0.2</sup> and *h*<sub>*x*</sub> = 0.9 \* *m**i**n*{*s*<sub>*x*</sub>, *i**q**r*<sub>*x*</sub>/1.34}\**m*<sup>−0.2</sup> where *s* is the sample standard deviation and *i**q**r* is the inter quartile range. It has been demonstrated that AUC estimation is rather insensitive to the choice of the bandwidth procedure \[@faraggi\_estimation\_2002\] and thus the plug-in bandwidth estimator has also been recommended for cutpoint estimation. Indeed, as our preliminary simulations have shown, the choices of the bandwidth and the kernel function do not seem to exhibit a considerable influence on the variability (or bias) of the estimated cutpoints. Thus, the `oc_youden_kernel` function in **cutpointr** uses a Gaussian kernel and the direct plug-in method for selecting the bandwidths. The kernel smoothing is done via the `bkde` function from the **KernSmooth** package \[@wand\_kernsmooth:\_2013\].
671671

672672
Again, there is a way to calculate the Youden-Index from the results of this method \[@fluss\_estimation\_2005\] which is
673673

@@ -724,7 +724,7 @@ dat <- data.frame(outcome = c("neg", "neg", "neg", "pos", "pos", "pos", "pos"),
724724
pred = c(1, 2, 3, 8, 11, 11, 12))
725725
```
726726

727-
Since the distance of the optimal cutpoint (8) to the next lowest observation (3) is rather large we arrive at a range of possible cutpoints that all maximize the metric. In the case of this kind of sparseness it might for example be desirable to classify a new obsevation with a predictor value of 4 as belonging to the negative class. If `use_midpoints` is set to `TRUE`, the mean of the optimal cutpoint and the next lowest observation is returned as the optimal cutpoint, if direction is `>=`. The mean of the optimal cutpoint and the next highest observation is returned as the optimal cutpoint, if `direction = "<="`.
727+
Since the distance of the optimal cutpoint (8) to the next lowest observation (3) is rather large we arrive at a range of possible cutpoints that all maximize the metric. In the case of this kind of sparseness it might for example be desirable to classify a new observation with a predictor value of 4 as belonging to the negative class. If `use_midpoints` is set to `TRUE`, the mean of the optimal cutpoint and the next lowest observation is returned as the optimal cutpoint, if direction is `>=`. The mean of the optimal cutpoint and the next highest observation is returned as the optimal cutpoint, if `direction = "<="`.
728728

729729
``` r
730730
opt_cut <- cutpointr(dat, x = pred, class = outcome, use_midpoints = TRUE)
@@ -1053,7 +1053,7 @@ misclassification_cost
10531053
#> colnames(misclassification_cost) <- "misclassification_cost"
10541054
#> return(misclassification_cost)
10551055
#> }
1056-
#> <bytecode: 0x6c3f518>
1056+
#> <bytecode: 0xb98fc08>
10571057
#> <environment: namespace:cutpointr>
10581058
```
10591059

0 commit comments

Comments
 (0)