Description Usage Arguments Value See Also Examples
View source: R/predict.bagged.outliertrees.R
Predict method for Bagged OutlierTrees
1 2 3 4 5 6 7 8 | ## S3 method for class 'bagged.outliertrees'
predict(
object,
newdata,
min_outlier_score = 0.95,
nthreads = parallel::detectCores(),
...
)
|
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. |
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
.
bagged.outliertrees print.bagged.outlieroutputs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.