#NEWLINE# def fit( trace_fpath , num_topics , alpha_zh , beta_zs , kernel , residency_priors , num_iter , burn_in , from_ = 0 , to = np . inf ) : #NEWLINE# #INDENT# '\n    Learns the latent topics from a temporal hypergraph trace. \n\n    Node-Sherlock is a EM algorithm in which the E-Step is a gibbs sample update,\n    thus the reason we use a `num_iter` and `burn_in` approach, instead of the \n    usual convergence approach.\n\n    Parameters\n    ----------\n    trace_fpath : str\n        The path of the trace. Each line should be a                 (timestamp, hypernode, source, destination) where the                 timestamp is a long (seconds or milliseconds from epoch).\n\n    num_topics : int\n        The number of latent spaces to learn\n\n    alpha_zh : float\n        The value of the alpha_zh hyperparameter\n\n    beta_zs : float\n        The value of the beta_zs (beta) hyperaparameter\n\n    kernel : Kernel object\n        The kernel to use\n\n    residency_priors : array of float\n        The kernel hyper parameters\n\n    num_iter : int\n        The number of iterations to learn the model from\n\n    burn_in : int\n        The burn_in of the chain\n    \n    Returns\n    -------\n    \n    A dictionary with the results.\n    ' #NEWLINE# ( Dts , Trace , previous_stamps , Count_zh , Count_sz , count_h , count_z , prob_topics_aux , Theta_zh , Psi_sz , hyper2id , source2id ) = dataio . initialize_trace ( trace_fpath , num_topics , num_iter , from_ , to ) #NEWLINE# em ( Dts , Trace , previous_stamps , Count_zh , Count_sz , count_h , count_z , alpha_zh , beta_zs , prob_topics_aux , Theta_zh , Psi_sz , num_iter , burn_in , kernel ) #NEWLINE# rv = prepare_results ( trace_fpath , num_topics , alpha_zh , beta_zs , kernel , residency_priors , num_iter , burn_in , Dts , Trace , Count_zh , Count_sz , count_h , hyper2id , prob_topics_aux , Theta_zh , Psi_sz , hyper2id , source2id , from_ , to ) #NEWLINE# rv [ 'algorithm' ] = np . asarray ( [ 'serial gibbs + em' ] ) #NEWLINE# return rv