Class: 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.
Constructors
new SpectralBiclustering()
new SpectralBiclustering(
opts
?):SpectralBiclustering
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.init ? | ArrayLike [] | "k-means++" | "random" | Method for initialization of k-means algorithm; defaults to ‘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’. |
opts.mini_batch ? | boolean | Whether to use mini-batch k-means, which is faster but may get different results. |
opts.n_best ? | number | Number of best singular vectors to which to project the data for clustering. |
opts.n_clusters ? | number | The number of row and column clusters in the checkerboard structure. |
opts.n_components ? | number | Number of singular vectors to check. |
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. |
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. |
Returns SpectralBiclustering
Defined in generated/cluster/SpectralBiclustering.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/cluster/SpectralBiclustering.ts:23 |
_isInitialized | boolean | false | generated/cluster/SpectralBiclustering.ts:22 |
_py | PythonBridge | undefined | generated/cluster/SpectralBiclustering.ts:21 |
id | string | undefined | generated/cluster/SpectralBiclustering.ts:18 |
opts | any | undefined | generated/cluster/SpectralBiclustering.ts:19 |
Accessors
column_labels_
Get Signature
get column_labels_():
Promise
<ArrayLike
>
Column partition labels.
Returns Promise
<ArrayLike
>
Defined in generated/cluster/SpectralBiclustering.ts:444
columns_
Get Signature
get columns_():
Promise
<ArrayLike
[]>
Results of the clustering, like rows
.
Returns Promise
<ArrayLike
[]>
Defined in generated/cluster/SpectralBiclustering.ts:390
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/SpectralBiclustering.ts:498
n_features_in_
Get Signature
get n_features_in_():
Promise
<number
>
Number of features seen during fit.
Returns Promise
<number
>
Defined in generated/cluster/SpectralBiclustering.ts:471
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/cluster/SpectralBiclustering.ts:98
row_labels_
Get Signature
get row_labels_():
Promise
<ArrayLike
>
Row partition labels.
Returns Promise
<ArrayLike
>
Defined in generated/cluster/SpectralBiclustering.ts:417
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/SpectralBiclustering.ts:363
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/SpectralBiclustering.ts:154
fit()
fit(
opts
):Promise
<any
>
Create a biclustering for X.
Parameters
Parameter | 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:171
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.i ? | number | The index of the cluster. |
Returns Promise
<ArrayLike
>
Defined in generated/cluster/SpectralBiclustering.ts:212
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A MetadataRequest encapsulating routing information. |
Returns Promise
<any
>
Defined in generated/cluster/SpectralBiclustering.ts:250
get_shape()
get_shape(
opts
):Promise
<number
>
Shape of the i
’th bicluster.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.i ? | number | The index of the cluster. |
Returns Promise
<number
>
Defined in generated/cluster/SpectralBiclustering.ts:286
get_submatrix()
get_submatrix(
opts
):Promise
<ArrayLike
[]>
Return the submatrix corresponding to bicluster i
.
Parameters
Parameter | 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:322
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>