Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.
3.3.6. fmralign.alignment_methods.OptimalTransportAlignment¶
-
class
fmralign.alignment_methods.
OptimalTransportAlignment
(solver='sinkhorn_epsilon_scaling', metric='euclidean', reg=1)[source]¶ Compute the optimal coupling between X and Y with entropic regularization.
- Parameters
solver : str (optional)
solver from POT called to find optimal coupling ‘sinkhorn’, ‘greenkhorn’, ‘sinkhorn_stabilized’,’sinkhorn_epsilon_scaling’, ‘exact’ see POT/ot/bregman on Github for source code of solvers
metric : str(optional)
metric used to create transport cost matrix, see full list in scipy.spatial.distance.cdist doc
reg : int (optional)
level of entropic regularization
Attributes
R
(scipy.sparse.csr_matrix) Mixing matrix containing the optimal permutation
-
__init__
(solver='sinkhorn_epsilon_scaling', metric='euclidean', reg=1)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
fit
(X, Y)[source]¶ - Parameters
X: (n_samples, n_features) nd array
source data
Y: (n_samples, n_features) nd array
target data
-
fit_transform
(X, y=None, **fit_params)¶ Fit to data, then transform it.
Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.
- Parameters
X : numpy array of shape [n_samples, n_features]
Training set.
y : numpy array of shape [n_samples]
Target values.
- Returns
X_new : numpy array of shape [n_samples, n_features_new]
Transformed array.
-
get_params
(deep=True)¶ Get parameters for this estimator.
- Parameters
deep : boolean, optional
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns
params : mapping of string to any
Parameter names mapped to their values.
-
set_params
(**params)¶ Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.- Returns
self