sparsness = data.X.shape[0] - np.count_nonzero(data.X, axis=0)
else: // filter by nans
if sp.issparse(data.X):
sparsness = np.sum(np.isnan(data.X.data), axis=0)
else:
sparsness = np.sum(np.isnan(data.X), axis=0)
att = [a for a, s in zip(data.domain.attributes, sparsness) if s <= tailored_threshold]
domain = Orange.data.Domain(att, data.domain.class_vars,
After Change
else: // filter by nans
if sp.issparse(data.X):
data_csc = sp.csc_matrix(data.X)
sparsness = [np.sum(np.isnan(data.X[:, i].data)) for i in range(data_csc.shape[1])]
else:
sparsness = np.sum(np.isnan(data.X), axis=0)
att = [a for a, s in zip(data.domain.attributes, sparsness) if s <= tailored_threshold]
domain = Orange.data.Domain(att, data.domain.class_vars,