Skip to content

Commit eb9a6cd

Browse files
Spaces
1 parent 5668f51 commit eb9a6cd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Orange/preprocess/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,9 @@ def __call__(self, data):
589589
if sp.issparse(data.X):
590590
data_csc = sp.csc_matrix(data.X)
591591
h, w = data_csc.shape
592-
sparsness = [data_csc[:, i].count_nonzero()/h for i in range(w)]
592+
sparsness = [data_csc[:, i].count_nonzero() / h for i in range(w)]
593593
else:
594-
sparsness = np.count_nonzero(data.X, axis=0)/ data.X.shape[0]
594+
sparsness = np.count_nonzero(data.X, axis=0) / data.X.shape[0]
595595
att = [a for a, s in zip(data.domain.attributes, sparsness) if s >= self.threshold]
596596
domain = Orange.data.Domain(att, data.domain.class_vars,
597597
data.domain.metas)

Orange/widgets/data/owpreprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def setThresh(self, thresh):
271271
self.changed.emit()
272272

273273
def parameters(self):
274-
return {'sparse_thresh':self.sparse_thresh}
274+
return {'sparse_thresh': self.sparse_thresh}
275275

276276
def setParameters(self, params):
277277
self.setThresh(params.get('sparse_thresh', 5))
@@ -280,7 +280,7 @@ def setParameters(self, params):
280280
def createinstance(params):
281281
params = dict(params)
282282
threshold = params.pop('sparse_thresh', 5)
283-
return RemoveSparse(threshold=threshold/100)
283+
return RemoveSparse(threshold=threshold / 100)
284284

285285
class ImputeEditor(BaseEditor):
286286
(NoImputation, Constant, Average,

0 commit comments

Comments
 (0)