Comments (2)
Thanks for finding that! I fixed it according to your suggestion.
from cast.
Looking at the source of grDevices::boxplot.stats
, I see:
> grDevices::boxplot.stats
function (x, coef = 1.5, do.conf = TRUE, do.out = TRUE)
{
if (coef < 0)
stop("'coef' must not be negative")
nna <- !is.na(x)
n <- sum(nna)
stats <- stats::fivenum(x, na.rm = TRUE)
iqr <- diff(stats[c(2, 4)])
if (coef == 0)
do.out <- FALSE
else {
out <- if (!is.na(iqr)) {
x < (stats[2L] - coef * iqr) | x > (stats[4L] + coef *
iqr)
}
else !is.finite(x)
if (any(out[nna], na.rm = TRUE))
stats[c(1, 5)] <- range(x[!out], na.rm = TRUE)
}
conf <- if (do.conf)
stats[3L] + c(-1.58, 1.58) * iqr/sqrt(n)
list(stats = stats, n = n, conf = conf, out = if (do.out) x[out &
nna] else numeric())
}
The relevant lines here are:
out <- if (!is.na(iqr)) {
x < (stats[2L] - coef * iqr) | x > (stats[4L] + coef * iqr)
}
#> [...]
stats[c(1, 5)] <- range(x[!out], na.rm = TRUE)
In context, that means that the AOA threshold winds up equaling:
max(di[!(di > (quantile(di, 0.75) + 1.5 * IQR(di)))])
Which means that the threshold is going to be the value in di closest to, but not more than quantile(di, 0.75) + (1.5 * IQR(di))
, which, particularly for smaller data, may be a significantly different value. The returned value will always be lower than (or the same as) the 75th percentile plus 1.5 times the IQR. Is this expected behavior?
from cast.
Related Issues (20)
- Predict for other class object HOT 4
- no package called ‘twosamples’
- {mlr3spatiotempcv} plotting functions for `CAST::CreatespacetimeFolds()`
- Incompability with terra SpatRaster objects HOT 2
- TuneGrid causes error with ranger method in ffs HOT 2
- an alternative distance metric, categorical variable handling, and optimization ideas
- Supplying manual variable weights to aoa doesn't work? HOT 2
- aoa() and calibrate_aoa() with parallelization
- Parallel implementation of `ffs()` HOT 3
- What if remaining variables (VR) interact? HOT 1
- Incorrect hyperparameter for ranger. HOT 2
- Tutorial 2 - AOA - csample function not defined HOT 1
- Tutorial 2 - RMSE does not exclude na HOT 2
- Tutorial 2 - scam package not called
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 2
- Classification theshold HOT 1
- Error when running trainDI / aoa example HOT 2
- Threshold calculated by `trainDI()` can become larger than the maximum training distance HOT 1
- knndm function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cast.