FromFileIterativeVotingClustering¶
- class tsml_eval.estimators.clustering.consensus.FromFileIterativeVotingClustering(clusterers, init='plus', n_clusters=8, max_iterations=500, overwrite_y=False, skip_y_check=False, random_state=None)[source]¶
IVC (Iterative Voting Clustering) Consensus Clusterer.
IVC is a consensus clustering algorithm that combines the results of multiple base clusterers to find a consensus clustering. It iteratively refines cluster assignments based on a majority voting scheme.
- Parameters:
- clustererslist of str
A list of paths to the clusterer result files to use in the ensemble.
- init{‘plus’, ‘random’, ‘aligned’}, default=’plus’
The method used to initialize the cluster centers. ‘plus’ uses the k-means++ initialization method, ‘random’ uses random selection, and ‘aligned’ uses a method that aligns the cluster assignmeds from the base clusterers.
- n_clustersint, default=8
The number of clusters to form.
- max_iterationsint, default=500
The maximum number of iterations to perform.
- overwrite_ybool, default=False
If True, the labels in the loaded files will overwrite the labels passed in the fit method.
- skip_y_checkbool, default=False
If True, the labels in the loaded files will not be checked against the labels passed in the fit method.
- random_stateint, default=None
The seed for random number generation.
- Attributes:
- labels_ndarray of shape (n_instances,)
Labels of each point from the last fit.
Methods
fit(X[, y])Fit model to X using IVC.
fit_predict(X[, y])Perform clustering on X and returns cluster labels.
Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
predict(X)Predict cluster labels for X.
set_params(**params)Set the parameters of this estimator.
- fit_predict(X, y=None, **kwargs)[source]¶
Perform clustering on X and returns cluster labels.
- Parameters:
- Xarray-like of shape (n_samples, n_features)
Input data.
- yIgnored
Not used, present for API consistency by convention.
- **kwargsdict
Arguments to be passed to
fit.Added in version 1.4.
- Returns:
- labelsndarray of shape (n_samples,), dtype=np.int64
Cluster labels.
- get_metadata_routing()[source]¶
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routingMetadataRequest
A
MetadataRequestencapsulating routing information.
- get_params(deep=True)[source]¶
Get parameters for this estimator.
- Parameters:
- deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
- paramsdict
Parameter names mapped to their values.
- set_params(**params)[source]¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it’s possible to update each component of a nested object.- Parameters:
- **paramsdict
Estimator parameters.
- Returns:
- selfestimator instance
Estimator instance.