File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,19 +5,19 @@ class NormalizePositive(object):
55 def fit (self , X , y = None ):
66 # count features that are greater than zero in axis 0:
77 binary = (X > 0 )
8- count0 = binary .sum (0 )
8+ count0 = binary .sum (axis = 0 )
99
1010 # to avoid division by zero, set zero counts to one:
1111 count0 += (count0 == 0 )
1212
13- self .mean = X .sum (0 )/ count0
13+ self .mean = X .sum (axis = 0 )/ count0
1414
1515 # Compute variance by average squared difference to the mean, but only
1616 # consider differences where binary is True (i.e., where there was a
1717 # true rating):
1818 diff = (X - self .mean ) * binary
1919 diff **= 2
20- self .std = np .sqrt (0.1 + diff .sum (0 )/ count0 )
20+ self .std = np .sqrt (0.1 + diff .sum (axis = 0 )/ count0 )
2121 return self
2222
2323 def fit_transform (self , X ):
You can’t perform that action at this time.
0 commit comments