Repository: biolab/orange3

Issue:
Preprocess widget Remove sparse features does nor remove rows with sparse features
<!-- 
Thanks for taking the time to report a bug!
If you're raising an issue about an add-on (i.e., installed via Options > Add-ons), raise an issue in the relevant add-on's issue tracker instead. See: https://github.com/biolab?q=orange3
To fix the bug, we need to be able to reproduce it. Please answer the following questions to the best of your ability.
-->


**What's wrong?**
<!-- Be specific, clear, and concise. Include screenshots if relevant. -->
<!-- If you're getting an error message, copy it, and enclose it with three backticks (```). -->
On Orange3 3.32 and 3.34 the Preprocess widget, Select Relevant Features dows NOT removes rows with null values.
Moreover, if you have two instances of Select Relevant Features  in the same Preprocess widget, one with zeros and the other with null,
and save the ows and reload it, you find the two instances with null values.
**How can we reproduce the problem?** 
<!-- Upload a zip with the .ows file and data. -->
<!-- Describe the steps (open this widget, click there, then add this...) -->
Run Orange3, open error_walmart.ows , in the FeatureFile widget open file features.csv .
Look at FeatureStatistics and find that there are five features with null values more than 50% (Markdown1 - Markdown5)
I build a feature X1 with all values zero
Go to the Preprocess widget and you find two instances with null values. The first was zero and the second was null. Put the first at zero, save the ows, close and reload ad you find again the two at null: the widget does NOT save setting correctly or does NOT reload 
the setting correctly.
Now set again the first at zero and the second at null, and in Feature_datatable(2) you will find that the X1 variable with zero values HAS BEEN deleted while the Markdown1 - Markdown5 columns with more than 50% of null values HAVE NOT been deleted.
**What's your environment?**
<!-- To find your Orange version, see "Help → About → Version" or `Orange.version.full_version` in code -->
- Operating system: UBUNTU LINUX 10.04 LTS 20.04 LTS
- Orange version: 3.32 3.34
- How you installed Orange: with ANACONDA
[error_walmart.zip](https://github.com/biolab/orange3/files/10417305/error_walmart.zip)



Discussion:

Resolving patch:
diff --git a/Orange/widgets/data/owpreprocess.py b/Orange/widgets/data/owpreprocess.py
--- a/Orange/widgets/data/owpreprocess.py
+++ b/Orange/widgets/data/owpreprocess.py
@@ -270,7 +270,7 @@ def __init__(self, parent=None, **kwargs):
         self.filter_buttons = QButtonGroup(exclusive=True)
         self.filter_buttons.buttonClicked.connect(self.filterByClicked)
         for idx, option, in enumerate(self.options):
-            btn = QRadioButton(self, text=option, checked=idx == 0)
+            btn = QRadioButton(self, text=option, checked=idx == 1)
             self.filter_buttons.addButton(btn, id=idx)
             self.layout().addWidget(btn)
 
@@ -311,6 +311,7 @@ def filterByClicked(self):
     def setFilter0(self, id_):
         if self.filter0 != id_:
             self.filter0 = id_
+            self.filter_buttons.button(id_).setChecked(True)
             self.edited.emit()
 
     def setFixedThresh(self, thresh):
@@ -346,7 +347,7 @@ def setParameters(self, params):
     def createinstance(params):
         params = dict(params)
         filter0 = params.pop('filter0', True)
-        useFixedThreshold = params.pop('useFixedThreshold', True)
+        useFixedThreshold = params.pop('useFixedThreshold', False)
         if useFixedThreshold:
             threshold = params.pop('fixedThresh', 50)
         else:


Test patch: