SGtSNEpi — Sklearn Estimator
Sklearn-compatible estimator for SG-t-SNE-Pi.
SGtSNEpi
Bases: BaseEstimator, TransformerMixin
SG-t-SNE-Pi graph embedding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
int
|
Embedding dimensions (default 2). |
2
|
lambda_
|
float
|
Rescaling parameter (default 10). |
10.0
|
n_neighbors
|
int
|
Number of nearest neighbors for kNN (default 15). |
15
|
metric
|
str
|
Distance metric (default "euclidean"). |
'euclidean'
|
max_iter
|
int
|
Maximum iterations (default 1000). |
1000
|
early_exag
|
int
|
Early exaggeration iterations (default 250). |
250
|
alpha
|
float
|
Exaggeration multiplier (default 12). |
12.0
|
eta
|
float
|
Learning rate (default 200). |
200.0
|
h
|
float
|
Grid side length for FFT. 0 = auto. |
0.0
|
random_state
|
int or None
|
Random seed. |
None
|
unweighted_to_weighted
|
bool
|
If True (default) and the input graph is unweighted, compute Jaccard-index local weights before embedding. |
True
|
Source code in src/pysgtsnepi/estimator.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
fit(X, y=None)
Compute the embedding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
array-like or sparse matrix of shape (n_samples, n_features)
|
If dense, builds kNN graph first. If sparse, treats as adjacency matrix. |
required |
Returns:
| Type | Description |
|---|---|
self
|
|
Source code in src/pysgtsnepi/estimator.py
fit_transform(X, y=None)
Compute and return the embedding.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
array-like or sparse matrix of shape (n_samples, n_features)
|
If dense, builds kNN graph first. If sparse, treats as adjacency matrix. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Y |
ndarray of shape (n_samples, d)
|
|