################################################################# # THIS FILE CONTAINS THE CODE OF THE AUXILIARY FUNCTIONS TO # # CALL LOF AND ORh AVAILABLE IN PACKAGE DMwR NECESSARY TO # # GENERATE THE RESULTS USED IN THE PAPER: # # Torgo,L and Lopes,E.: Utility-based Fraud Detection. In # # Proceedings of the 22nd IJCAI'2011 # ################################################################# # Author : Luis Torgo (ltorgo@dcc.fc.up.pt) Date: Mar 2011 # # License: GPL (>= 2) # ################################################################# # ===================================================== # Auxiliary functions to call LOF and ORh # ===================================================== lofCall <- function(HD,ID,k=10,...) { require(DMwR) n <- nrow(HD) out <- lofactor(rbind(HD,ID),k=k,...) out <- SoftMax(out[(n+1):length(out)]) list(score=out,rank=order(out,decreasing=T)) } orhCall <- function(HD,ID,...) { require(DMwR) out <- outliers.ranking(HD,ID,...) list(score=out$prob.outliers,rank=out$rank.outliers) }