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.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for simuclustfactor-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ffa37c068d6024734582d28d35b89a3c32cdad5b4d22a4ce62aff5a404b09fe |
|
MD5 | 3253d26b8db1e632d0fc5393dfbe8d5a |
|
BLAKE2b-256 | 06bd9aa6dac341a0315b724b8a00678fd78e0240bec0570bfa04c233112674db |