Browse files

COSMIT pep8

  • Loading branch information...
1 parent 468dcaa commit 3e45173cb83ae9324fe914f9b74f55e8e8117ed6 @amueller amueller committed Jun 2, 2012
Showing with 9 additions and 9 deletions.
  1. +8 −8 sklearn/hmm.py
  2. +1 −1 sklearn/manifold/mds.py
View
16 sklearn/hmm.py
@@ -384,7 +384,7 @@ def rvs(self, n=1, random_state=None):
def fit(self, obs, **kwargs):
"""Estimate model parameters.
-
+
An initialization step is performed before entering the EM
algorithm. If you want to avoid this step, set the keyword
argument init_params to the empty string ''. Likewise, if you
@@ -404,7 +404,7 @@ def fit(self, obs, **kwargs):
small). You can fix this by getting more training data, or
decreasing `covars_prior`.
"""
-
+
if kwargs:
warnings.warn("Setting parameters in the 'fit' method is"
"deprecated. Set it on initialization instead.",
@@ -419,10 +419,10 @@ def fit(self, obs, **kwargs):
self.params = kwargs['params']
if 'init_params' in kwargs:
self.init_params = kwargs['init_params']
-
+
if self.algorithm not in decoder_algorithms:
self._algorithm = "viterbi"
-
+
self._init(obs, self.init_params)
logprob = []
@@ -674,7 +674,7 @@ def __init__(self, n_components=1, covariance_type='diag', startprob=None,
transmat=None, startprob_prior=None, transmat_prior=None,
algorithm="viterbi", means_prior=None, means_weight=0,
covars_prior=1e-2, covars_weight=1,
- random_state=None, n_iter=10, thresh=1e-2,
+ random_state=None, n_iter=10, thresh=1e-2,
params=string.ascii_letters,
init_params=string.ascii_letters):
_BaseHMM.__init__(self, n_components, startprob, transmat,
@@ -1045,9 +1045,9 @@ class GMMHMM(_BaseHMM):
"""
def __init__(self, n_components=1, n_mix=1, startprob=None, transmat=None,
- startprob_prior=None, transmat_prior=None, algorithm="viterbi",
- gmms=None, covariance_type='diag', covars_prior=1e-2,
- random_state=None, n_iter=10, thresh=1e-2,
+ startprob_prior=None, transmat_prior=None,
+ algorithm="viterbi", gmms=None, covariance_type='diag',
+ covars_prior=1e-2, random_state=None, n_iter=10, thresh=1e-2,
params=string.ascii_letters,
init_params=string.ascii_letters):
"""Create a hidden Markov model with GMM emissions.
View
2 sklearn/manifold/mds.py
@@ -139,7 +139,7 @@ def _smacof_single(similarities, metric=True, n_components=2, init=None,
raise ValueError("similarities must be a square array (shape=%d)" % \
n_samples)
- if np.any((similarities - similarities.T) > 100 * np.finfo(np.float).resolution):
+ if np.any((similarities - similarities.T) > 100 * np.finfo(np.float).resolution):
raise ValueError("similarities must be symmetric")
sim_flat = ((1 - np.tri(n_samples)) * similarities).flatten()

0 comments on commit 3e45173

Please sign in to comment.