so_magic.som package

Submodules

so_magic.som.factory module

class so_magic.som.factory.SelfOrganizingMapFactory(trainer=NOTHING, subject=NOTHING)[source]

Bases: object

create(dataset, nb_cols, nb_rows, **kwargs)[source]

so_magic.som.manager module

class so_magic.som.manager.MagicMapManager(so_master)[source]

Bases: object

train(nb_cols, nb_rows, **kwargs)[source]
class so_magic.som.manager.MapId(dataset_name, n_columns, n_rows, initialization, map_type, grid_type)[source]

Bases: object

static from_self_organizing_map(somap, **kwargs)[source]
class so_magic.som.manager.MapManager(map_factory=SelfOrganizingMapFactory(trainer=SomTrainer(infer_map=<function infer_map>), subject=<so_magic.utils.notification.Subject object>))[source]

Bases: object

get_map(*args, **kwargs)[source]

args: ‘dataset’, ‘nb_cols’, ‘nb_rows’ kwargs: ‘initialization’, ‘maptype’, ‘gridtype’

train(dataset, nb_cols, nb_rows, **kwargs)[source]

so_magic.som.self_organising_map module

exception so_magic.som.self_organising_map.NoFeatureVectorsError[source]

Bases: Exception

class so_magic.som.self_organising_map.SelfOrganizingMap(som, dataset_name)[source]

Bases: object

cluster(nb_clusters, random_state=None)[source]
datapoint_coordinates(index)[source]

Get the best-matching unit (bmu) coordinates of the datapoint indexed by the input pointer.

Bmu is simply the neuron on the som grid that is closest to the projected-into-2D-space datapoint.

get_map_id()[source]
property grid_type
property height
property nb_clusters
neurons_coordinates()[source]
project(datapoint)[source]

Compute the coordinates of a (potentially unseen) datapoint.

It is assumed that the codebook has been computed already.

property type
property visual_umatrix
property width
class so_magic.som.self_organising_map.SomTrainer(infer_map: callable)[source]

Bases: object

static from_callable()[source]
infer_map
so_magic.som.self_organising_map.infer_map(nb_cols, nb_rows, dataset, **kwargs)[source]

Infer a self-organizing map from dataset.

initialcodebook = None, kerneltype = 0, maptype = ‘planar’, gridtype = ‘rectangular’, compactsupport = False, neighborhood = ‘gaussian’, std_coeff = 0.5, initialization = None

Module contents

class so_magic.som.MagicMapManager(so_master)[source]

Bases: object

train(nb_cols, nb_rows, **kwargs)[source]