Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31c6745

Browse files
amuellerGaelVaroquaux
authored andcommitted
FIX don't do anything in the __init__
1 parent eeb6dcc commit 31c6745

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sklearn/hmm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __init__(self, n_components=1, startprob=None, transmat=None,
135135
self._algorithm = algorithm
136136
else:
137137
self._algorithm = "viterbi"
138-
self.random_state = check_random_state(random_state)
138+
self.random_state = random_state
139139

140140
def eval(self, obs):
141141
"""Compute the log probability under the model and compute posteriors
@@ -898,6 +898,7 @@ def _generate_sample_from_state(self, state, random_state=None):
898898

899899
def _init(self, obs, params='ste'):
900900
super(MultinomialHMM, self)._init(obs, params=params)
901+
self.random_state = check_random_state(self.random_state)
901902

902903
if 'e' in params:
903904
emissionprob = normalize(self.random_state.rand(self.n_components,

0 commit comments

Comments
 (0)