graphclust.vq.TopologyRepresentingNetwork#
- class graphclust.vq.TopologyRepresentingNetwork(n_nodes=50, *, max_iter=None, eps=(0.3, 0.05), lam=None, lifetime=None, prune=True, init='range', random_state=None)[source]#
Bases:
NeuralGasTopology representing network (TRN; Martinetz and Schulten 1994).
Neural gas adaptation combined with competitive Hebbian learning: after each step the nearest and second nearest node of the drawn sample are linked (or their link is refreshed, age 0), the ages of all other links of the winner grow by one, and links older than the lifetime \(T(t)\) are removed. The resulting graph approximates the induced Delaunay triangulation of the nodes, i.e. it connects nodes whose Voronoi cells are adjacent where data exist.
- Parameters:
- prunebool, default=True
After training, delete the links that no sample supports any more (no sample has their two end points as nearest and second nearest node). This removes stale links created while the nodes were moving.
- lifetime(
float,float),optional Initial and final edge lifetime \((T_i, T_f)\); default
(0.1 * n_nodes, 0.5 * n_nodes): the lifetime grows, as recommended by Martinetz and Schulten, so that early links of the still moving nodes are forgotten quickly and the final links persist.- The other parameters are those of :class:`NeuralGas`.
- Attributes:
- edge_strength_
ndarray(n_nodes,n_nodes) Time-weighted count of refreshes of every edge (\(\sum t/t_{\max}\)), useful to tell persistent from transient links.
- edge_strength_