10000 Fixed the ghost code · SkuaD01/scikit-learn@08b60a9 · GitHub
[go: up one dir, main page]

Skip to content

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

sklearn/preprocessing/_data.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
from ..utils import check_array
2323
from ..utils.deprecation import deprecated
2424
from ..utils.extmath import row_norms
25-
from ..utils.extmath import (_incremental_mean_and_var,
26-
_incremental_weighted_mean_and_var)
25+
from ..utils.extmath import _incremental_mean_and_var
2726
from ..utils.sparsefuncs_fast import (inplace_csr_row_normalize_l1,
2827
inplace_csr_row_normalize_l2)
2928
from ..utils.sparsefuncs import (inplace_column_scale,
@@ -837,17 +836,11 @@ def partial_fit(self, X, y=None, sample_weight=None):
837836
self.mean_ = None
838837
self.var_ = None
839838
self.n_samples_seen_ += X.shape[0] - np.isnan(X).sum(axis=0)
840-
841-
elif sample_weight is not None:
842-
self.mean_, self.var_, self.n_samples_seen_ = \
843-
_incremental_weighted_mean_and_var(X, sample_weight,
844-
self.mean_,
845-
self.var_,
846-
self.n_samples_seen_)
847839
else:
848840
self.mean_, self.var_, self.n_samples_seen_ = \
849841
_incremental_mean_and_var(X, self.mean_, self.var 58AC _,
850-
self.n_samples_seen_)
842+
self.n_samples_seen_,
843+
sample_weight=sample_weight)
851844

852845
# for backward-compatibility, reduce n_samples_seen_ to an integer
853846
# if the number of samples is the same for each feature (i.e. no

0 commit comments

Comments
 (0)
0