예제 #1
0
def launch_analysis():
    engine = Engine(animals.values.astype(float),
                    num_states=64,
                    cctypes=['categorical'] * len(animals.values[0]),
                    distargs=[{
                        'k': 2
                    }] * len(animals.values[0]),
                    rng=gu.gen_rng(7))

    engine.transition(N=900)
    with open('resources/animals/animals.engine', 'w') as f:
        engine.to_pickle(f)

    engine = Engine.from_pickle(open('resources/animals/animals.engine', 'r'))
    D = engine.dependence_probability_pairwise()
    pu.plot_clustermap(D)
예제 #2
0
def create_engine(dist, noise, num_samples, num_states, timestamp):
    T = simulate_dataset(dist, noise, num_samples)
    print 'Creating engine (%s %1.2f) ...' % (dist, noise)
    engine = Engine(T, cctypes=['normal','normal'], num_states=num_states)
    engine.to_pickle(file(filename_engine(dist, noise, timestamp), 'w'))