R:'spatialSign' 函数对识别异常值有用吗?
R: Is 'spatialSign' function useful for identifying outliers?
这是我的问题:
'AppliedPredictiveModeling' 包中的 "spatialSign" 函数的用途是什么?
我在一本书中读到关于识别异常值的 "spatial sign" 方法。该函数将变量的值投影到圆圈中,如果有异常值,它们应该出现在圆圈内。 "spatial sign" R 在这个包中使用的是同一个吗?
如果是这样,我提交这段代码时怎么会出现:
plotSubset <- data.frame(scale(zquant1[, c("AGE", "FL")]))
xyplot(AGE ~ FL,
data = plotSubset,
auto.key = list(columns = 10))
transformed <- spatialSign(plotSubset)
transformed <- as.data.frame(transformed)
xyplot(AGE ~ FL,
data = transformed,
auto.key = list(columns = 2))
看起来我在第一张图片中有异常值,但空间符号方法(第二张图片)无法识别它?
(1st image) http://www.imagesup.net/?di=5142245473711
(2nd image) http://www.imagesup.net/?di=5142245489110
不,它无法识别异常值。它只是一种预处理方法,它将离群值带到大部分数据中。
摘自Applied Predictive Modeling book:
If a model is considered to be sensitive to outliers, one data
transformation that can minimize the problem is the spatial sign
(Serneels et al. 2006). This procedure projects the predictor values
onto a multidimensional sphere. This has the effect of making all the
samples the same distance from the center of the sphere.
Serneels、Sven、Evert De Nolf 和 Pierre J. Van Espen。 2006.“空间符号预处理:一种将适度稳健性赋予多变量估计器的简单方法。”化学信息与建模杂志 46 (3): 1402–9。 doi:10.1021/ci050498u.
set.seed(1)
n <- 10000
tmp <- data.frame(x=c(rnorm(n, 0, 0.02), -1, 1, 0.5),
y=c(rnorm(n, 0, 0.2), -1, 1, -2))
plot(tmp, asp=1, col=c(rep(1,n), 2, 3, 4), pch=19)
grid()
plot(spatialSign(tmp), asp=1, col=c(rep(1,n), 2, 3, 4), pch=19)
grid()
这是我的问题:
'AppliedPredictiveModeling' 包中的 "spatialSign" 函数的用途是什么? 我在一本书中读到关于识别异常值的 "spatial sign" 方法。该函数将变量的值投影到圆圈中,如果有异常值,它们应该出现在圆圈内。 "spatial sign" R 在这个包中使用的是同一个吗?
如果是这样,我提交这段代码时怎么会出现:
plotSubset <- data.frame(scale(zquant1[, c("AGE", "FL")]))
xyplot(AGE ~ FL,
data = plotSubset,
auto.key = list(columns = 10))
transformed <- spatialSign(plotSubset)
transformed <- as.data.frame(transformed)
xyplot(AGE ~ FL,
data = transformed,
auto.key = list(columns = 2))
看起来我在第一张图片中有异常值,但空间符号方法(第二张图片)无法识别它?
(1st image) http://www.imagesup.net/?di=5142245473711 (2nd image) http://www.imagesup.net/?di=5142245489110
不,它无法识别异常值。它只是一种预处理方法,它将离群值带到大部分数据中。
摘自Applied Predictive Modeling book:
If a model is considered to be sensitive to outliers, one data transformation that can minimize the problem is the spatial sign (Serneels et al. 2006). This procedure projects the predictor values onto a multidimensional sphere. This has the effect of making all the samples the same distance from the center of the sphere.
Serneels、Sven、Evert De Nolf 和 Pierre J. Van Espen。 2006.“空间符号预处理:一种将适度稳健性赋予多变量估计器的简单方法。”化学信息与建模杂志 46 (3): 1402–9。 doi:10.1021/ci050498u.
set.seed(1)
n <- 10000
tmp <- data.frame(x=c(rnorm(n, 0, 0.02), -1, 1, 0.5),
y=c(rnorm(n, 0, 0.2), -1, 1, -2))
plot(tmp, asp=1, col=c(rep(1,n), 2, 3, 4), pch=19)
grid()
plot(spatialSign(tmp), asp=1, col=c(rep(1,n), 2, 3, 4), pch=19)
grid()