DeleteAnomaliesCopy to clipboard.
✖
DeleteAnomalies
gives a list in which examplei that are considered anomalous have been dropped.
drops anomalies in data using the given AnomalyDetectorFunction[…] or LearnedDistribution[…].
Details and Options


- DeleteAnomalies can be used on many types of data, including numerical, nominal and images.
- Each examplei can be a single data element, a list of data elements or an association of data elements. Examples can also be given as a Dataset or a Tabular object.
- DeleteAnomalies attempts to model the distribution of non-anomalous data in order to detect anomalies (i.e. "out-of-distribution" examples). Examples are considered anomalous when their RarerProbability is below the value specified for AcceptanceThreshold.
- In DeleteAnomalies[AnomalyDetectorFunction[…],data], if data comes from the same distribution as the training examples for the detector, AcceptanceThreshold corresponds to the anomaly detection false-positive rate.
- The following options can be given:
-
AcceptanceThreshold 0.001 RarerProbability threshold to consider an example anomalous FeatureExtractor Identity how to extract features from which to learn FeatureNames Automatic feature names to assign for input data FeatureTypes Automatic feature types to assume for input data Method Automatic which modeling algorithm to use PerformanceGoal Automatic aspects of performance to optimize RandomSeeding 1234 what seeding of pseudorandom generators should be done internally TimeGoal Automatic how long to spend training the detector TrainingProgressReporting Automatic how to report progress during training ValidationSet Automatic the set of data on which to evaluate the model during training - Possible settings for PerformanceGoal include:
-
"Quality" maximize the modeling quality of the detector "Speed" maximize speed for detecting anomalies Automatic automatic tradeoff among speeds, quality and memory {goal1,goal2,…} automatically combine goal1, goal2, etc. - Possible settings for Method are as given in LearnDistribution[…].
- The following settings for TrainingProgressReporting can be used:
-
"Panel" show a dynamically updating graphical panel "Print" periodically report information using Print "ProgressIndicator" show a simple ProgressIndicator "SimplePanel" dynamically updating panel without learning curves None do not report any information - DeleteAnomalies[…,FeatureExtractor"Minimal"] indicates that the internal preprocessing should be as simple as possible.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Drop anomalous examples in a numeric dataset:

https://wolfram.com/xid/0hyvacb2y58c5q74-5hhlm7

Delete anomalous examples in a nominal dataset:

https://wolfram.com/xid/0hyvacb2y58c5q74-1giaj9

Delete anomalies from a list of colors:

https://wolfram.com/xid/0hyvacb2y58c5q74-w1cs1m

Scope (3)Survey of the scope of standard use cases
Train an AnomalyDetectorFunction on a two-dimensional array of pseudorandom real numbers:

https://wolfram.com/xid/0hyvacb2y58c5q74-9eb8g

Use the trained AnomalyDetectorFunction with DeleteAnomalies to drop anomalous examples:

https://wolfram.com/xid/0hyvacb2y58c5q74-mdwhj2

Delete anomalies from a Tabular object:

https://wolfram.com/xid/0hyvacb2y58c5q74-87lln3

Obtain a random sample of training and test datasets of images:

https://wolfram.com/xid/0hyvacb2y58c5q74-2v5gze

Add anomalous examples to corrupt the datasets:

https://wolfram.com/xid/0hyvacb2y58c5q74-59fu7o

Train a distribution on images:

https://wolfram.com/xid/0hyvacb2y58c5q74-40o90t

Use the trained distribution to drop anomalous examples in the test set:

https://wolfram.com/xid/0hyvacb2y58c5q74-u2zvha

Options (2)Common values & functionality for each option
AcceptanceThreshold (1)
Specify the AcceptanceThreshold for dropping anomalies from a list of colors:

https://wolfram.com/xid/0hyvacb2y58c5q74-y8b47x

Method (1)
Create a dataset sampled from two different distributions:

https://wolfram.com/xid/0hyvacb2y58c5q74-lrvca8

Delete anomalies in the dataset using the "Multinormal" method:

https://wolfram.com/xid/0hyvacb2y58c5q74-hwhlow

Delete anomalies in the dataset using the "KernelDensityEstimation" method:

https://wolfram.com/xid/0hyvacb2y58c5q74-7clzek

Applications (4)Sample problems that can be solved with this function
Find the statistical mean of numeric values with an anomaly:

https://wolfram.com/xid/0hyvacb2y58c5q74-wkmvw0

Delete anomalies before computing the mean:

https://wolfram.com/xid/0hyvacb2y58c5q74-moihc5

Plot a list of numeric values that contains anomalies:

https://wolfram.com/xid/0hyvacb2y58c5q74-2xs34q

Plot a list of numeric values after removing anomalies:

https://wolfram.com/xid/0hyvacb2y58c5q74-q99u9i

Find the linear fit for numerical data:

https://wolfram.com/xid/0hyvacb2y58c5q74-fr8gq2

https://wolfram.com/xid/0hyvacb2y58c5q74-ito2gu

Delete outliers before modeling the fit:

https://wolfram.com/xid/0hyvacb2y58c5q74-hamet6


https://wolfram.com/xid/0hyvacb2y58c5q74-hamat6

https://wolfram.com/xid/0hyvacb2y58c5q74-qzzjzs

Train an anomaly detector on the training set:

https://wolfram.com/xid/0hyvacb2y58c5q74-xk37in

Drop anomalous examples in the test set:

https://wolfram.com/xid/0hyvacb2y58c5q74-usfnwe

Wolfram Research (2019), DeleteAnomalies, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteAnomalies.html (updated 2025).
Text
Wolfram Research (2019), DeleteAnomalies, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteAnomalies.html (updated 2025).
Wolfram Research (2019), DeleteAnomalies, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteAnomalies.html (updated 2025).
CMS
Wolfram Language. 2019. "DeleteAnomalies." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/DeleteAnomalies.html.
Wolfram Language. 2019. "DeleteAnomalies." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/DeleteAnomalies.html.
APA
Wolfram Language. (2019). DeleteAnomalies. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteAnomalies.html
Wolfram Language. (2019). DeleteAnomalies. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteAnomalies.html
BibTeX
@misc{reference.wolfram_2025_deleteanomalies, author="Wolfram Research", title="{DeleteAnomalies}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteAnomalies.html}", note=[Accessed: 26-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_deleteanomalies, organization={Wolfram Research}, title={DeleteAnomalies}, year={2025}, url={https://reference.wolfram.com/language/ref/DeleteAnomalies.html}, note=[Accessed: 26-March-2025
]}