diff --git a/river/covariance/emp.py b/river/covariance/emp.py index 2245a78291..46eaf7249f 100644 --- a/river/covariance/emp.py +++ b/river/covariance/emp.py @@ -14,7 +14,7 @@ class SymmetricMatrix(abc.ABC): @property @abc.abstractmethod - def matrix(self): + def matrix(self) -> dict: ... def __getitem__(self, key): @@ -196,8 +196,6 @@ def _update_from_state(self, n: int, mean: dict, cov: float | dict): A dictionary of variable means. cov A dictionary of covariance or variance values. - ddof - Degrees of freedom for covariance calculation. Defaults to 1. Raises ---------- @@ -226,10 +224,9 @@ def _update_from_state(self, n: int, mean: dict, cov: float | dict): except KeyError: self._cov[i, i] = stats.Var(self.ddof) if isinstance(cov, dict): - if isinstance(cov, dict): - cov_ = cov[i, i] - else: - cov_ = cov + cov_ = cov[i, i] + else: + cov_ = cov self._cov[i, i] += stats.Var._from_state(n=n, m=mean[i], sig=cov_, ddof=self.ddof) @classmethod