Skip to content

A Python package for unsupervised mixed datatypes clustering

Notifications You must be signed in to change notification settings

monk1337/Mixclu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mixclu

A Python package for unsupervised mix data types clustering

Mixclu is an open-source python package for doing unsupervised mix data types clustering. This includes a variety of combination models including kmeans-onehot, gower distance, umap etc. The goal is to provide an easy to use implementation for each algorithm along with a scikit-learn API.

GitHub license GitHub commit PRs Welcome

More features and suggestions are welcome.

Quick Start

from mixclu import *

id_col, cat_columns, con_col = get_types(df)
""" define continuous and categorical columns"""

umap_kbins_emd, kbins_umap_model = categorical_embedding_model(df, 
                                                            bin_con_columns = con_col, 
                                                            no_of_clusters  = 4,
                                                            bin_bins        = 5)
from mixclu import *

"""Kmeans one hot mix model"""

model_result = kmeans_onehot_mix(df, 
                               cat_columns, 
                               total_clusters = 4)
                               
from mixclu import *

"""using gower distance as embeddings"""

clusters, gower_embeddings = kmoid_grower(df, 
                                           cat_columns, 
                                           no_of_clusters = 4)
                               
from mixclu import *

"""(Mirkin, 2005, pp. 85–91)"""

z_score, model_result = Mirkin_model(df, 
                                     cat_columns, 
                                     no_of_clusters = 4)
                               

Todo