# Path: tribeflow/dataio.py
# def save_model(out_fpath, model):
# def initialize_trace(trace_fpath, num_topics, num_iter, \
#         from_=0, to=np.inf, initial_assign=None):


from _learn import em
from tribeflow import dataio
from collections import OrderedDict
import numpy as np
import os
        Count_zh, Count_sz, count_h, count_z, \
        prob_topics_aux, Theta_zh, Psi_sz, hyper2id, source2id, \
        from_, to):
    
    rv = OrderedDict()
    
    rv['num_topics'] = np.asarray([num_topics])
    rv['trace_fpath'] = np.asarray([os.path.abspath(trace_fpath)])
    
    rv['alpha_zh'] = np.asarray([alpha_zh])
    rv['beta_zs'] = np.asarray([beta_zs])
    
    rv['num_iter'] = np.asarray([num_iter])
    rv['burn_in'] = np.asarray([burn_in])

    rv['from_'] = np.asarray([from_])
    rv['to'] = np.asarray([to])
    
    rv['Dts'] = Dts
    rv['Count_zh'] = Count_zh
    rv['Count_sz'] = Count_sz
    rv['count_h'] = count_h
    rv['count_z'] = count_z
    
    rv['Theta_zh'] = Theta_zh
    rv['Psi_sz'] = Psi_sz
    
    #TODO: very ugly sollution to save class name.
    kname = str(kernel.__class__).split("'")[1]
    rv['kernel_class'] = np.array([kname])

# Path: tribeflow/dataio.py
# def save_model(out_fpath, model):
# def initialize_trace(trace_fpath, num_topics, num_iter, \
#         from_=0, to=np.inf, initial_assign=None):


# Path: tribeflow/learn.py
from _learn import em
from tribeflow import dataio
from collections import OrderedDict
import numpy as np
import os

        Count_zh, Count_sz, count_h, count_z, \
        prob_topics_aux, Theta_zh, Psi_sz, hyper2id, source2id, \
        from_, to):
    
    rv = OrderedDict()
    
    rv['num_topics'] = np.asarray([num_topics])
    rv['trace_fpath'] = np.asarray([os.path.abspath(trace_fpath)])
    
    rv['alpha_zh'] = np.asarray([alpha_zh])
    rv['beta_zs'] = np.asarray([beta_zs])
    
    rv['num_iter'] = np.asarray([num_iter])
    rv['burn_in'] = np.asarray([burn_in])

    rv['from_'] = np.asarray([from_])
    rv['to'] = np.asarray([to])
    
    rv['Dts'] = Dts
    rv['Count_zh'] = Count_zh
    rv['Count_sz'] = Count_sz
    rv['count_h'] = count_h
    rv['count_z'] = count_z
    
    rv['Theta_zh'] = Theta_zh
    rv['Psi_sz'] = Psi_sz
    
    #TODO: very ugly sollution to save class name.
    kname = str(kernel.__class__).split("'")[1]
    rv['kernel_class'] = np.array([kname])

    rv['residency_priors'] = residency_priors