isanomaly
Syntax
Description
finds anomalies in the table tf
= isanomaly(LOFObj
,Tbl
)Tbl
using the LocalOutlierFactor
object LOFObj
and returns the logical array tf
,
whose elements are true
when an anomaly is detected in the corresponding
row of Tbl
. You must use this syntax if you create
LOFObj
by passing a table to the lof
function.
specifies the threshold for the anomaly score, in addition to any of the input argument
combinations in the previous syntaxes. tf
= isanomaly(___,ScoreThreshold=scoreThreshold
)isanomaly
identifies
observations with scores above scoreThreshold
as anomalies.
[
also returns an anomaly score, which is a local
outlier factor value, for each observation in tf
,scores
] = isanomaly(___)Tbl
or
X
. A score value less than or close to 1 indicates a normal
observation, and a value greater than 1 can indicate an anomaly.
Examples
Input Arguments
Output Arguments
More About
Algorithms
To compute the local outlier factor values (
scores
) for each observation inTbl
orX
,isanomaly
finds the k-nearest neighbors among the training observations stored in theX
property of aLocalOutlierFactor
object.isanomaly
considersNaN
,''
(empty character vector),""
(empty string),<missing>
, and<undefined>
values inTbl
andNaN
values inX
to be missing values.isanomaly
does not use observations with missing values.isanomaly
assigns the anomaly score ofNaN
and anomaly indicator offalse
(logical 0) to observations with missing values.
References
[1] Breunig, Markus M., et al. “LOF: Identifying Density-Based Local Outliers.” Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, 2000, pp. 93–104.
Version History
Introduced in R2022b