predict.bagged.outliertrees {bagged.outliertrees} | R Documentation |
Predict method for Bagged OutlierTrees
Description
Predict method for Bagged OutlierTrees
Usage
## S3 method for class 'bagged.outliertrees'
predict(
object,
newdata,
min_outlier_score = 0.95,
nthreads = parallel::detectCores(),
...
)
Arguments
object |
A Bagged OutlierTrees object as returned by |
newdata |
A Data Frame in which to look for outliers according to the fitted model. |
min_outlier_score |
Minimum outlier score to use when finding outliers. |
nthreads |
Number of threads to use when predicting. |
... |
No use. |
Value
Will return a list of lists with the outliers and their
information (each row is an entry in the first list, with the same names as the rows in the input data
frame), which can be printed into a human-readable format after-the-fact through functions
print
.
See Also
bagged.outliertrees print.bagged.outlieroutputs
Examples
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)
[Package bagged.outliertrees version 1.0.0 Index]