DocumentationClassesSpectralCoclustering

Class: SpectralCoclustering

Spectral Co-Clustering algorithm (Dhillon, 2001).

Clusters rows and columns of an array X to solve the relaxed normalized cut of the bipartite graph created from X as follows: the edge between row vertex i and column vertex j has weight X\[i, j\].

The resulting bicluster structure is block-diagonal, since each row and each column belongs to exactly one bicluster.

Supports sparse matrices, as long as they are nonnegative.

Read more in the User Guide.

Python Reference

Constructors

new SpectralCoclustering()

new SpectralCoclustering(opts?): SpectralCoclustering

Parameters

ParameterTypeDescription
opts?object-
opts.init?ArrayLike[]Method for initialization of k-means algorithm; defaults to ‘k-means++’.
opts.mini_batch?booleanWhether to use mini-batch k-means, which is faster but may get different results.
opts.n_clusters?numberThe number of biclusters to find.
opts.n_init?numberNumber of random initializations that are tried with the k-means algorithm. If mini-batch k-means is used, the best initialization is chosen and the algorithm runs once. Otherwise, the algorithm is run for each initialization and the best solution chosen.
opts.n_svd_vecs?numberNumber of vectors to use in calculating the SVD. Corresponds to ncv when svd_method=arpack and n_oversamples when svd_method is ‘randomized`.
opts.random_state?numberUsed for randomizing the singular value decomposition and the k-means initialization. Use an int to make the randomness deterministic. See Glossary.
opts.svd_method?"randomized" | "arpack"Selects the algorithm for finding singular vectors. May be ‘randomized’ or ‘arpack’. If ‘randomized’, use sklearn.utils.extmath.randomized_svd, which may be faster for large matrices. If ‘arpack’, use scipy.sparse.linalg.svds, which is more accurate, but possibly slower in some cases.

Returns SpectralCoclustering

Defined in generated/cluster/SpectralCoclustering.ts:29

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/cluster/SpectralCoclustering.ts:27
_isInitializedbooleanfalsegenerated/cluster/SpectralCoclustering.ts:26
_pyPythonBridgeundefinedgenerated/cluster/SpectralCoclustering.ts:25
idstringundefinedgenerated/cluster/SpectralCoclustering.ts:22
optsanyundefinedgenerated/cluster/SpectralCoclustering.ts:23

Accessors

column_labels_

Get Signature

get column_labels_(): Promise<ArrayLike>

The bicluster label of each column.

Returns Promise<ArrayLike>

Defined in generated/cluster/SpectralCoclustering.ts:427


columns_

Get Signature

get columns_(): Promise<ArrayLike[]>

Results of the clustering, like rows.

Returns Promise<ArrayLike[]>

Defined in generated/cluster/SpectralCoclustering.ts:373


feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

Names of features seen during fit. Defined only when X has feature names that are all strings.

Returns Promise<ArrayLike>

Defined in generated/cluster/SpectralCoclustering.ts:481


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/cluster/SpectralCoclustering.ts:454


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/cluster/SpectralCoclustering.ts:81


row_labels_

Get Signature

get row_labels_(): Promise<ArrayLike>

The bicluster label of each row.

Returns Promise<ArrayLike>

Defined in generated/cluster/SpectralCoclustering.ts:400


rows_

Get Signature

get rows_(): Promise<ArrayLike[]>

Results of the clustering. rows\[i, r\] is true if cluster i contains row r. Available only after calling fit.

Returns Promise<ArrayLike[]>

Defined in generated/cluster/SpectralCoclustering.ts:346

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/cluster/SpectralCoclustering.ts:137


fit()

fit(opts): Promise<any>

Create a biclustering for X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLike[]Training data.
opts.y?anyNot used, present for API consistency by convention.

Returns Promise<any>

Defined in generated/cluster/SpectralCoclustering.ts:154


get_indices()

get_indices(opts): Promise<ArrayLike>

Row and column indices of the i’th bicluster.

Only works if rows_ and columns_ attributes exist.

Parameters

ParameterTypeDescription
optsobject-
opts.i?numberThe index of the cluster.

Returns Promise<ArrayLike>

Defined in generated/cluster/SpectralCoclustering.ts:195


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/cluster/SpectralCoclustering.ts:233


get_shape()

get_shape(opts): Promise<number>

Shape of the i’th bicluster.

Parameters

ParameterTypeDescription
optsobject-
opts.i?numberThe index of the cluster.

Returns Promise<number>

Defined in generated/cluster/SpectralCoclustering.ts:269


get_submatrix()

get_submatrix(opts): Promise<ArrayLike[]>

Return the submatrix corresponding to bicluster i.

Parameters

ParameterTypeDescription
optsobject-
opts.data?ArrayLike[]The data.
opts.i?numberThe index of the cluster.

Returns Promise<ArrayLike[]>

Defined in generated/cluster/SpectralCoclustering.ts:305


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/cluster/SpectralCoclustering.ts:94