예제 #1
0
파일: structurer.py 프로젝트: heevery/webid
	def __init__(self, n_iter=100):
		MultinomialHMM.__init__(self, n_components=len(self.states), n_iter=n_iter)

		self.voca = dict()
		self.word_freq = defaultdict(int)
		self.max_num_segs = 0
		self.n_training = 0
예제 #2
0
 def __init__(self,
              t,
              theta,
              rho,
              algorithm='viterbi',
              random_state=None,
              n_iter=20, tol=0,
              verbose=False):
     MultinomialHMM.__init__(self, n_components=len(t)+1,
                             algorithm=algorithm,
                             random_state=random_state,
                             n_iter=n_iter, tol=tol,
                             verbose=verbose)
     self.t = np.append(np.append([0], t), [np.inf])
     self.tau = np.diff(self.t)
     self.theta = theta
     self.rho = rho
예제 #3
0
 def __init__(self,
              n_components=1,
              startprob_prior=1.0,
              transmat_prior=1.0,
              algorithm="viterbi",
              random_state=None,
              n_iter=10,
              tol=1e-2,
              verbose=False,
              params="ste",
              init_params="ste"):
     MultinomialHMM.__init__(self,
                             n_components=n_components,
                             startprob_prior=startprob_prior,
                             transmat_prior=transmat_prior,
                             algorithm=algorithm,
                             random_state=random_state,
                             n_iter=n_iter,
                             tol=tol,
                             verbose=verbose,
                             params=params,
                             init_params=init_params)
     return