cluster module¶
- class mvcluster.cluster.LMGEC(n_clusters: int = 3, embedding_dim: int = 10, temperature: float = 0.5, max_iter: int = 30, tolerance: float = 1e-06)[source]¶
Bases:
BaseEstimator
,ClusterMixin
Localized Multi-Graph Embedding Clustering (LMGEC) model.
- Parameters:
n_clusters (int) – Number of clusters to form.
embedding_dim (int) – Dimension of embedding space.
temperature (float) – Temperature for view weighting.
max_iter (int) – Max training iterations.
tolerance (float) – Convergence threshold.
- fit(X_views, y=None)[source]¶
Fit the LMGEC model to multiple data views.
- Parameters:
X_views (list) – List of 2D arrays (one per view), shape (n_samples, n_features) for each.
y – Ignored, for API compatibility.
- Returns:
The fitted estimator.
- Return type:
self
- predict(X_views)[source]¶
Predict cluster labels for input views after fitting.
- Parameters:
X_views (list) – List of feature matrices (ignored).
- Returns:
Cluster labels from fit.
- Return type:
array-like
- set_fit_request(*, X_views: bool | None | str = '$UNCHANGED$') LMGEC ¶
Configure whether metadata should be requested to be passed to the
fit
method.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True
(seesklearn.set_config()
). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
- X_viewsstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
X_views
parameter infit
.
- selfobject
The updated object.
- set_predict_request(*, X_views: bool | None | str = '$UNCHANGED$') LMGEC ¶
Configure whether metadata should be requested to be passed to the
predict
method.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True
(seesklearn.set_config()
). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
- X_viewsstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
X_views
parameter inpredict
.
- selfobject
The updated object.
- set_transform_request(*, X_views: bool | None | str = '$UNCHANGED$') LMGEC ¶
Configure whether metadata should be requested to be passed to the
transform
method.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True
(seesklearn.set_config()
). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed totransform
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it totransform
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
- X_viewsstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
X_views
parameter intransform
.
- selfobject
The updated object.