<s> import numpy as np <EOL> from kmodes import kprototypes <EOL> syms = np . genfromtxt ( '<STR_LIT>' , dtype = str , delimiter = '<STR_LIT:U+002C>' ) [ : , <NUM_LIT:0> ] <EOL> X = np . genfromtxt ( '<STR_LIT>' , dtype = object , delimiter = '<STR_LIT:U+002C>' ) [ : , <NUM_LIT:1> : ] <EOL> X [ : , <NUM_LIT:0> ] = X [ : , <NUM_LIT:0> ] . astype ( float ) <EOL> kproto = kprototypes . KPrototypes ( n_clusters = <NUM_LIT:4> , init = '<STR_LIT>' , verbose = <NUM_LIT:2> ) <EOL> clusters = kproto . fit_predict ( X , categorical = [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> print ( kproto . cluster_centroids_ ) <EOL> print ( kproto . enc_map_ ) <EOL> print ( kproto . cost_ ) <EOL> print ( kproto . n_iter_ ) <EOL> for s , c in zip ( syms , clusters ) : <EOL> print ( "<STR_LIT>" . format ( s , c ) ) </s>
