Simultaneous Component and Clustering Models for Three-way Data: Within and Between Approaches.
Project description
python-simuclustfactor
Perform simultaneous clustering and factor decomposition in Python for three-mode datasets, a library utility.
The main use cases of the library are:
- performing tandem clustering and factor-decomposition procedures sequentially (TWCFTA).
- performing tandem factor-decomposition and clustering procedures sequentially (TWFCTA).
- performing the clustering and factor decomposition procedures simultaneously (T3Clus).
- performing factor-decomposition and clustering procedures simultaneously (3FKMeans).
- performing combined T3Clus and 3FKMeans procedures simultaneously (CT3Clus).
Installation
To install the Python library, run:
pip install simuclustfactor
You may consider installing the library only for the current user:
pip install simuclustfactor --user
Library usage
The package provides just two main modules namely,
tandem
: encapsulating TWCFTA and TWFCTAsimultaneous
: encapsulating T3Clus, TFKMeans and CT3Clus
>>> import numpy as np
>>> from simuclustfactor import tandem
>>> from simuclustfactor import simultaneous
>>> from sklearn.datasets import make_blobs
>>> I,J,K = 40,15,20 # dimensions in the full space.
>>> G,Q,R = 8,4,3 # tensor dimensions in reduced space.
>>> X_i_jk, y = make_blobs(n_samples=I, centers=G, n_features=J*K, random_state=0) # generate dataset
>>> twcfta = tandem.TWCFTA(random_state=0,verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R))
>>> twfcta = tandem.TWFCTA(random_state=0,verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R))
>>> t3clus = simultaneous.T3Clus(random_state=0, init='random', verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R))
>>> tfkmeans = simultaneous.TFKMeans(random_state=0, init='random', verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R))
>>> tfkmeans_1 = simultaneous.CT3Clus(random_state=0, init='random', verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R), alpha=0)
>>> t3clus_1 = simultaneous.CT3Clus(random_state=0, init='random', verbose=True, n_max_iter=10).fit(X_i_jk, full_tensor_shape=(I,J,K), reduced_tensor_shape=(G,Q,R), alpha=1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simuclustfactor-0.0.1.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for simuclustfactor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc617d3c8bdfb94c909bd2561dfbdbbb6ce53d6553ec00e3a0c5c72ceb77dcbd |
|
MD5 | 5de404263b155f8a949ae21515660c2a |
|
BLAKE2b-256 | 29dd68e9522ecc20887a6f12a67a1ff2601b46b9c93803ac81159ed8d074d99f |