MCPcopy Create free account
hub / github.com/Giyn/DataMiningVisualizationSystem / gaussian

Function gaussian

MachineLearningAlgorithm/KNN/KNN.py:14–17  ·  view source on GitHub ↗

Input a distance and return it`s weight

(dist, sigma=10.0)

Source from the content-addressed store, hash-verified

12
13
14def gaussian(dist, sigma=10.0):
15 """ Input a distance and return it`s weight"""
16 weight = np.exp(-dist ** 2 / (2 * sigma ** 2))
17 return weight
18
19
20"""

Callers 2

fitMethod · 0.85
predictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected