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.
new SpectralCoclustering(opts?: object): SpectralCoclustering;
Name | Type | Description |
---|---|---|
opts? |
object |
- |
opts.init? |
ArrayLike [] |
Method for initialization of k-means algorithm; defaults to ‘k-means++’. Default Value 'k-means++' |
opts.mini_batch? |
boolean |
Whether to use mini-batch k-means, which is faster but may get different results. Default Value false |
opts.n_clusters? |
number |
The number of biclusters to find. Default Value 3 |
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’, 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. Default Value 'randomized' |
Defined in: generated/cluster/SpectralCoclustering.ts:29
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/cluster/SpectralCoclustering.ts:146
Create a biclustering for X.
fit(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Training data. |
opts.y? |
any |
Not used, present for API consistency by convention. |
Promise
<any
>
Defined in: generated/cluster/SpectralCoclustering.ts:163
Row and column indices of the i
’th bicluster.
Only works if rows\_
and columns\_
attributes exist.
get_indices(opts: object): Promise<ArrayLike>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.i? |
number |
The index of the cluster. |
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralCoclustering.ts:205
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRequest encapsulating routing information. |
Promise
<any
>
Defined in: generated/cluster/SpectralCoclustering.ts:244
Shape of the i
’th bicluster.
get_shape(opts: object): Promise<number>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.i? |
number |
The index of the cluster. |
Promise
<number
>
Defined in: generated/cluster/SpectralCoclustering.ts:282
Return the submatrix corresponding to bicluster i
.
get_submatrix(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.data? |
ArrayLike [] |
The data. |
opts.i? |
number |
The index of the cluster. |
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralCoclustering.ts:319
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/cluster/SpectralCoclustering.ts:94
boolean
=false
Defined in: generated/cluster/SpectralCoclustering.ts:27
boolean
=false
Defined in: generated/cluster/SpectralCoclustering.ts:26
PythonBridge
Defined in: generated/cluster/SpectralCoclustering.ts:25
string
Defined in: generated/cluster/SpectralCoclustering.ts:22
any
Defined in: generated/cluster/SpectralCoclustering.ts:23
The bicluster label of each column.
column_labels_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralCoclustering.ts:444
Results of the clustering, like rows
.
columns_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralCoclustering.ts:390
Names of features seen during fit. Defined only when X
has feature names that are all strings.
feature_names_in_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralCoclustering.ts:498
Number of features seen during fit.
n_features_in_(): Promise<number>;
Promise
<number
>
Defined in: generated/cluster/SpectralCoclustering.ts:471
py(): PythonBridge;
PythonBridge
Defined in: generated/cluster/SpectralCoclustering.ts:81
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/cluster/SpectralCoclustering.ts:85
The bicluster label of each row.
row_labels_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/cluster/SpectralCoclustering.ts:417
Results of the clustering. rows\[i, r\]
is true
if cluster i
contains row r
. Available only after calling fit
.
rows_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/cluster/SpectralCoclustering.ts:363