SpectralBiclustering
Spectral biclustering (Kluger, 2003).
Partitions rows and columns under the assumption that the data has an underlying checkerboard structure. For instance, if there are two row partitions and three column partitions, each row will belong to three biclusters, and each column will belong to two biclusters. The outer product of the corresponding row and column label vectors gives this checkerboard structure.
Read more in the User Guide.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new SpectralBiclustering(opts?: object): SpectralBiclustering;
Parameters
Name | Type | Description |
---|---|---|
opts? | object | - |
opts.init? | ArrayLike [] | "k-means++" | "random" | Method for initialization of k-means algorithm; defaults to ‘k-means++’. Default Value 'k-means++' |
opts.method? | "bistochastic" | "scale" | "log" | Method of normalizing and converting singular vectors into biclusters. May be one of ‘scale’, ‘bistochastic’, or ‘log’. The authors recommend using ‘log’. If the data is sparse, however, log normalization will not work, which is why the default is ‘bistochastic’. Default Value 'bistochastic' |
opts.mini_batch? | boolean | Whether to use mini-batch k-means, which is faster but may get different results. Default Value false |
opts.n_best? | number | Number of best singular vectors to which to project the data for clustering. Default Value 3 |
opts.n_clusters? | number | The number of row and column clusters in the checkerboard structure. Default Value 3 |
opts.n_components? | number | Number of singular vectors to check. Default Value 6 |
opts.n_init? | number | Number 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. Default Value 10 |
opts.n_svd_vecs? | number | Number 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? | number | Used 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’, uses randomized\_svd , which may be faster for large matrices. If ‘arpack’, uses scipy.sparse.linalg.svds , which is more accurate, but possibly slower in some cases. Default Value 'randomized' |
Returns
Defined in: generated/cluster/SpectralBiclustering.ts:25 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/cluster/SpectralBiclustering.ts:23 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/cluster/SpectralBiclustering.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/cluster/SpectralBiclustering.ts:21 (opens in a new tab)
id
string
Defined in: generated/cluster/SpectralBiclustering.ts:18 (opens in a new tab)
opts
any
Defined in: generated/cluster/SpectralBiclustering.ts:19 (opens in a new tab)
Accessors
column_labels_
Column partition labels.
Signature
column_labels_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralBiclustering.ts:423 (opens in a new tab)
columns_
Results of the clustering, like rows
.
Signature
columns_(): Promise<ArrayLike[]>;
Returns
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralBiclustering.ts:369 (opens in a new tab)
feature_names_in_
Names of features seen during fit. Defined only when X
has feature names that are all strings.
Signature
feature_names_in_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralBiclustering.ts:477 (opens in a new tab)
n_features_in_
Number of features seen during fit.
Signature
n_features_in_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/cluster/SpectralBiclustering.ts:450 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/cluster/SpectralBiclustering.ts:98 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/cluster/SpectralBiclustering.ts:102 (opens in a new tab)
row_labels_
Row partition labels.
Signature
row_labels_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralBiclustering.ts:396 (opens in a new tab)
rows_
Results of the clustering. rows\[i, r\]
is true
if cluster i
contains row r
. Available only after calling fit
.
Signature
rows_(): Promise<ArrayLike[]>;
Returns
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralBiclustering.ts:342 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/cluster/SpectralBiclustering.ts:165 (opens in a new tab)
fit()
Create a biclustering for X.
Signature
fit(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.X? | ArrayLike [] | Training data. |
opts.y? | any | Not used, present for API consistency by convention. |
Returns
Promise
<any
>
Defined in: generated/cluster/SpectralBiclustering.ts:182 (opens in a new tab)
get_indices()
Row and column indices of the i
’th bicluster.
Only works if rows\_
and columns\_
attributes exist.
Signature
get_indices(opts: object): Promise<ArrayLike>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.i? | number | The index of the cluster. |
Returns
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralBiclustering.ts:224 (opens in a new tab)
get_shape()
Shape of the i
’th bicluster.
Signature
get_shape(opts: object): Promise<number>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.i? | number | The index of the cluster. |
Returns
Promise
<number
>
Defined in: generated/cluster/SpectralBiclustering.ts:261 (opens in a new tab)
get_submatrix()
Return the submatrix corresponding to bicluster i
.
Signature
get_submatrix(opts: object): Promise<ArrayLike[]>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.data? | ArrayLike [] | The data. |
opts.i? | number | The index of the cluster. |
Returns
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralBiclustering.ts:298 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/cluster/SpectralBiclustering.ts:111 (opens in a new tab)