Skip to content

Commit

Permalink
Update outqrf.r
Browse files Browse the repository at this point in the history
  • Loading branch information
flystar233 authored Aug 23, 2024
1 parent eb0e0b3 commit 9cf3b2b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/outqrf.r
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)
}
Expand Down

0 comments on commit 9cf3b2b

Please sign in to comment.