machine_learning.self_organizing_map

https://en.wikipedia.org/wiki/Self-organizing_map

Classes

SelfOrganizingMap

Functions

main(→ None)

Module Contents

class machine_learning.self_organizing_map.SelfOrganizingMap
get_winner(weights: list[list[float]], sample: list[int]) int

Compute the winning vector by Euclidean distance

>>> SelfOrganizingMap().get_winner([[1, 2, 3], [4, 5, 6]], [1, 2, 3])
1
update(weights: list[list[int | float]], sample: list[int], j: int, alpha: float) list[list[int | float]]

Update the winning vector.

>>> SelfOrganizingMap().update([[1, 2, 3], [4, 5, 6]], [1, 2, 3], 1, 0.1)
[[1, 2, 3], [3.7, 4.7, 6]]
machine_learning.self_organizing_map.main() None