# NOT RUN {
library(bagged.outliertrees)
### example dataset with interesting outliers
data(hypothyroid)
### fit a Bagged OutlierTrees model
model <- bagged.outliertrees(hypothyroid,
ntrees = 10,
subsampling_rate = 0.5,
z_outlier = 6,
nthreads = 1
)
### use the fitted model to find outliers in the training dataset
outliers <- predict(model,
newdata = hypothyroid,
min_outlier_score = 0.5,
nthreads = 1
)
### print the top-10 outliers in human-readable format
print(outliers, outliers_print = 10)
# }
Run the code above in your browser using DataLab