Ejemplo n.º 1
0
import baxcat.cc_state
import numpy

from baxcat.utils import cc_legacy_utils as lu

n_rows = 100
view_weights = numpy.ones(2)/2
cluster_weights = [numpy.ones(3)/3.0, numpy.ones(2)/2.0]
cctypes = ['normal']*5
distargs = [None]*5
separation = [.7, .9]

T, Zv, Zc, dims = tu.gen_data_table(
                    n_rows, 
                    view_weights, 
                    cluster_weights, 
                    cctypes, 
                    distargs, 
                    separation, 
                    return_dims=True)


state = cc_state.cc_state(T, cctypes, distargs)
state.transition(N=10)

M_c, X_L, X_D = lu.get_legacy_metadata(state)

Tcc = T[0]
for i in range(1,len(T)):
    Tcc = numpy.vstack( (Tcc, T[i]) )
Tcc = numpy.transpose(Tcc) 
Ejemplo n.º 2
0
n_transitions = 300
n_data_sets = 10 # the number of samples (chains)

n_kernels = 2

total_itr = n_kernels*n_data_sets
itr = 0

cctypes = ['normal']*n_cols
distargs = [None]*n_cols

Ts, Zv, Zc = tu.gen_data_table(n_rows,
            numpy.array([.5,.5]), 
            [numpy.array([1./2]*2),
            numpy.array([1./5]*5)], 
            cctypes, 
            distargs, 
            [1.0]*n_cols)

 
for kernel in range(n_kernels):
    # for a set number of chains
    ARI_view = numpy.zeros((n_data_sets, n_transitions))
    ARI_cols = numpy.zeros((n_data_sets, n_transitions))

    for r in range(n_data_sets):
        S = cc_state.cc_state(Ts, cctypes, ct_kernel=kernel, distargs=distargs)
        for c in range(n_transitions):
            S.transition(N=1)