flowsom.models.SOMEstimator#

class flowsom.models.SOMEstimator(xdim=10, ydim=10, rlen=10, mst=1, alpha=(0.05, 0.01), init=False, initf=None, map=True, codes=None, importance=None, seed=None)#

Estimate a Self-Organizing Map (SOM) clustering model.

Methods table#

fit(X[, y])

Perform SOM clustering.

fit_predict(X[, y])

Fit the model and predict labels.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict(X[, y])

Predict labels using the model.

set_params(**params)

Set the parameters of this estimator.

Methods#

SOMEstimator.fit(X, y=None)#

Perform SOM clustering.

Parameters:
  • inp (np.array) – An array of the columns to use for clustering

  • xdim (int) – x dimension of SOM

  • ydim (int) – y dimension of SOM

  • rlen (int) – Number of times to loop over the training data for each MST

  • importance – Array with numeric values. Parameters will be scaled

according to importance :type importance: np.array

SOMEstimator.fit_predict(X, y=None)#

Fit the model and predict labels.

SOMEstimator.get_metadata_routing()#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:

-routing (MetadataRequest) A MetadataRequest encapsulating routing information.

SOMEstimator.get_params(deep=True)#

Get parameters for this estimator.

Parameters:

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

-params (dict) Parameter names mapped to their values.

SOMEstimator.predict(X, y=None)#

Predict labels using the model.

SOMEstimator.set_params(**params)#

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:

**params (dict) – Estimator parameters.

Returns:

self : estimator instance Estimator instance.