test_label.py

来自「General Hidden Markov Model Library 一个通用」· Python 代码 · 共 53 行

PY
53
字号
##################################################################################       This file is part of the General Hidden Markov Model Library,#       GHMM version 0.8_beta1, see http://ghmm.org##       file:    test_label.py#       authors: Benjamin Georgi##       Copyright (C) 1998-2004 Alexander Schliep#       Copyright (C) 1998-2001 ZAIK/ZPR, Universitaet zu Koeln#       Copyright (C) 2002-2004 Max-Planck-Institut fuer Molekulare Genetik,#                               Berlin##       Contact: schliep@ghmm.org##       This library is free software; you can redistribute it and/or#       modify it under the terms of the GNU Library General Public#       License as published by the Free Software Foundation; either#       version 2 of the License, or (at your option) any later version.##       This library is distributed in the hope that it will be useful,#       but WITHOUT ANY WARRANTY; without even the implied warranty of#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU#       Library General Public License for more details.##       You should have received a copy of the GNU Library General Public#       License along with this library; if not, write to the Free#       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA###       This file is version $Revision: 1791 $#                       from $Date: 2006-11-15 15:09:43 +0100 (Wed, 15 Nov 2006) $#             last change by $Author: grunau $.#################################################################################from ghmm import *sigma = IntegerRange(0,2)m = HMMFromMatrices(sigma,DiscreteDistribution(sigma),                       [[0.5,0.5],[1.0,0.0]],                       [[1.0,0.0],[0.0,1.0]],                       [1.0,0.0], labelList = ["GC rich","GC low"] )print m.__class__.__name__ s = m.sample(3,40) print s p = m.viterbiLabels(s)print p

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?