Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

MonadicGeometricNearestNeighbors

Guides

  • Geometric nearest neighbors monad

Symbols

  • GNNMonAddToContext
  • GNNMonAssignContextTo
  • GNNMonAssignTo
  • GNNMonAssignValueTo
  • GNNMonBind
  • GNNMonClassify
  • GNNMonComputeAdjacencyMatrix
  • GNNMonComputeProximityMatrix
  • GNNMonComputeThresholds
  • GNNMonContexts
  • GNNMonDropAggregationFunction
  • GNNMonDropData
  • GNNMonDropDistanceFunction
  • GNNMonDropFromContext
  • GNNMonDropLowerThreshold
  • GNNMonDropNearestFunction
  • GNNMonDropNearestIndexDistanceFunction
  • GNNMonDropNearestNeighborDistances
  • GNNMonDropNumberOfNNs
  • GNNMonDropRadius
  • GNNMonDropUpperThreshold
  • GNNMonEchoContext
  • GNNMonEchoFunctionContext
  • GNNMonEchoFunctionValue
  • GNNMonEcho
  • GNNMonEchoValue
  • GNNMonFail
  • GNNMonFindAnomalies
  • GNNMonFindNearest
  • GNNMonFold
  • GNNMonGetData
  • GNNMonIfElse
  • GNNMonIf
  • GNNMonIterate
  • GNNMonMakeNearestFunction
  • GNNMonModifyContext
  • GNNMonModule
  • GNNMon
  • GNNMonNest
  • GNNMonNestWhile
  • GNNMonOption
  • GNNMonPutContext
  • GNNMonPutValue
  • GNNMonRescale
  • GNNMonRetrieveFromContext
  • GNNMonSetAggregationFunction
  • GNNMonSetContext
  • GNNMonSetData
  • GNNMonSetDistanceFunction
  • GNNMonSetLowerThreshold
  • GNNMonSetNearestFunction
  • GNNMonSetNearestIndexDistanceFunction
  • GNNMonSetNearestNeighborDistances
  • GNNMonSetNumberOfNNs
  • GNNMonSetRadius
  • GNNMonSetUpperThreshold
  • GNNMonSetValue
  • GNNMonSucceed
  • GNNMonTakeAggregationFunction
  • GNNMonTakeContext
  • GNNMonTakeData
  • GNNMonTakeDistanceFunction
  • GNNMonTakeLowerThreshold
  • GNNMonTakeNearestFunction
  • GNNMonTakeNearestIndexDistanceFunction
  • GNNMonTakeNearestNeighborDistances
  • GNNMonTakeNumberOfNNs
  • GNNMonTakeRadius
  • GNNMonTakeUpperThreshold
  • GNNMonTakeValue
  • GNNMonUnit
  • GNNMonUnitQ
  • GNNMonWhen
  • $GNNMonFailure
AntonAntonov`MonadicGeometricNearestNeighbors`
GNNMonFindAnomalies
​
GNNMonFindAnomalies[
pnts
] finds anomalous points in
pnts
.
​
​
GNNMonFindAnomalies[pnts,prop]
gives the specified property
prop
for the anomalous points.
​
Details and Options

Examples  
(2)
Basic Examples  
(1)
In[1]:=
SeedRandom[454];​​dsPoints=ResourceFunction["RandomTabularDataset"][{30,{"X","Y"}},"Generators"1NormalDistribution[0,5],2NormalDistribution[12,3],"RowKeys"True];​​dsPoints〚1;;4〛
Out[1]=
Here is a monadic Geometric Nearest Neighbors Monad (GNNMon) object is created:
In[2]:=
gnnObj=​​
GNNMonUnit
[dsPoints]⟹​​
GNNMonMakeNearestFunction
[DistanceFunctionEuclideanDistance]⟹​​
GNNMonComputeThresholds
[10,"AggregationFunction"Mean,"OutlierIdentifier""QuartileIdentifier"]
Out[2]=
GNNMon
Dimensions: {30}
DistanceFunction: EuclideanDistance
Number of nearest neighbors: 10
Aggregation function: Mean

Here we find anomalous points in the given set:
In[3]:=
anomalies=​​gnnObj⟹​​
GNNMonFindAnomalies
⟹​​
GNNMonTakeValue
Out[3]=
{{7.58287,12.4769},{-9.05321,8.66659},{7.3995,13.3589},{-0.603773,18.7801},{-0.596697,2.42631},{-6.93107,6.75308}}
Here we plot the original data together with the found anomalies:
In[4]:=
ListPlot["data"MapIndexed[Callout[#1,#2〚1〛]&,Normal@dsPoints[Values]],"anomalies"anomalies,PlotStyle{{},{Red,PointSize[0.012]}},PlotTheme"Detailed",ImageSizeLarge]
Out[4]=
Contents cannot be rendered at this time; please try again later or download this notebook for full functionality »
Here with find the anomalous points positions:
In[5]:=
gnnObj⟹​​
GNNMonFindAnomalies
[Automatic,"AnomalyPositions"]⟹​​
GNNMonTakeValue
Out[5]=
{13,17,18,19,20,26}
Scope  
(1)

SeeAlso
GNNMonClassify
RelatedGuides
▪
Geometric nearest neighbors monad
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com