From 9cf3b2b4cdc8960ad3407fad63e11c6032903b3c Mon Sep 17 00:00:00 2001 From: Xfly <18374858141@163.com> Date: Fri, 23 Aug 2024 14:37:39 +0800 Subject: [PATCH] Update outqrf.r --- R/outqrf.r | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/R/outqrf.r b/R/outqrf.r index b099f9a..df91ca3 100644 --- a/R/outqrf.r +++ b/R/outqrf.r @@ -102,9 +102,7 @@ outqrf <-function(data, rmse_ <- sqrt(sum(diffs*diffs)/(length(diffs)-1)) rmse <- c(rmse,rmse_) rank_value <-c() - median_values <-c() for (i in 1:length(response)){ - median_values <- c(median_values,median_outMatrix[i]) rank_<- find_max_index(outMatrix[i,],response[i]) if (length(rank_)>1){ diff = response[i] -median_outMatrix[i] @@ -123,7 +121,7 @@ outqrf <-function(data, } } - outlier <- data.frame(row = as.numeric(row.names(data)),col = v,observed = response, predicted = median_values,rank = rank_value) + outlier <- data.frame(row = as.numeric(row.names(data)),col = v,observed = response, predicted = median_outMatrix,rank = rank_value) outlier<- outlier|>dplyr::filter(rank<=threshold_low| rank>=threshold_high) outliers <- rbind(outliers,outlier) }