예제 #1
0
파일: q_3_2.py 프로젝트: 8v/76558
def q_2_b_i(hmm_model, observation):
    """
    calculating the log probability of observing chrom17.fasta given the model.
    :return:
    """
    f = forward_algorithm(hmm_model, observation)
    print(f[1, -1])
예제 #2
0
파일: q_3_2.py 프로젝트: 8v/76558
def q_2_b_ii(hmm_model, observation):
    """
    calculating the log probability of observing chrom17.fasta given the model.
    :return:
    """
    random_observation = ''.join(np.random.choice(a=list(set(observation)),
                                                  size=len(observation),
                                                  replace=True))
    f = forward_algorithm(hmm_model, random_observation)
    print(f[1, -1])