Repository: biolab/orange3

Issue:
Imputation with default model (SimpleTree) hangs
<!--
This is an issue template. Please fill in the relevant details in the
sections below.

Wrap code and verbatim terminal window output into triple backticks, see:
https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

If you're raising an issue about an add-on (e.g. installed via
Options > Add-ons), raise an issue on the relevant add-on's issue
tracker instead. See: https://github.com/biolab?q=orange3
-->

##### Orange version
<!-- From menu _Help→About→Version_ or code `Orange.version.full_version` -->
3.26

##### Expected behavior
Impute Data 


##### Actual behavior
It's getting stuck at various percentages while trying to impute the data, mostly in the 80-90% range, freezing, and I must do a forced shutdown for my computer to work. It actually makes my screen go black and I can't do anything. I also tried downloading Orange on another computer of mine but its doing the same thing and it crashed that computer as well.   

##### Steps to reproduce the behavior
Select a file with a large data set with missing variables...this data set has 1302 instances and 19 features. 


##### Additional info (worksheets, data, screenshots, ...)

![image](https://user-images.githubusercontent.com/71160420/92984764-b51d3880-f47a-11ea-9ad7-e059cd4cc8bb.png)




Discussion:
Size shouldn't be a problem, this is not a large data set.

- What kind of imputation did you use? Do other types work? If so, which do and which don't?
- What's your operating system? How did you install Orange?
- Is there any chance of uploading a zip with the data?

Without this,  we're blind. We can't diagnoze the problem without knowing more.

Thank you for your response!

I am using Windows on a Dell Inspiron 17,7000 series, i5. 

When you say how I installed Orange, do you mean where I went to download Orange? 
I used the website home page and clicked download Orange and followed the prompts. I'm not too computer savory so I'll apologize in advance...

I am graduate student and have an assignment for a class that I am working on. I successfully used Orange last week for an assignment and it was fine but I didn't have to impute data. (I think this software is awesome and will love to use it in again after this class!) 

The data file is coming from excel...I tried to compress the file but when I try to open it in Orange, it isn't finding my compressed file so that I can upload it. So, I'm feeling stuck.

Also, the impute function that our professor prefers is the model-based imputer, so this is what I am trying to use.  

I would be happy to do a screen share, if that is something you do and if anyone is available. 

Again, I appreciate the response!!  :) 

Maria Hawn


> 
>     Size shouldn't be a problem, this is not a large data set.
> 
>         * What kind of imputation did you use? Do other types work? If so, which do and which don't?
>         * What's your operating system? How did you install Orange?
>         * Is there any chance of uploading a zip with the data?
> 
>     Without this, we're blind. We can't diagnoze the problem without knowing more.
> 
>     —
>     You are receiving this because you authored the thread.
>     Reply to this email directly, view it on GitHub https://github.com/biolab/orange3/issues/4982#issuecomment-691461831 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ65EZFT4MGPBWPFD4S6ZVLSFNCHBANCNFSM4RIZFG5A .
> 

> I tried to compress the file but when I try to open it in Orange

No, not upload to Orange ... can you upload to this site, github, so we can see what happens if we run Orange on it?

As a workaround, you can try changing your workflow like this:

<img width="252" alt="Screenshot 2020-09-12 at 16 04 25" src="https://user-images.githubusercontent.com/2387315/92997221-edbc2100-f511-11ea-93ea-15f4ea1dfcfd.png">

This way, you specify the model (a tree) explicitly, and you can also modify its parameters, like prunning.
Sure! Here are my excel files...the first is a zipped folder (if i converted the file correctly to zip) and the second is the excel file. 

Thank you for the workaround information. When I return home today, I will try using that! Thanks so much! 
Also, I changed Columns 6, 7, and 19 to numeric, as a"type" in the file widget.

[Universities.zip](https://github.com/biolab/orange3/files/5212837/Universities.zip)

[Universities.xlsx](https://github.com/biolab/orange3/files/5212838/Universities.xlsx)

It fails on my computer, too, so we can investigate what's wrong. Thanks a lot!

Wow, I am so glad it's not just me! Thanks so much!! Sent from my Verizon, Samsung Galaxy smartphone
-------- Original message --------From: Janez Demšar <notifications@github.com> Date: 9/12/20  11:19 AM  (GMT-05:00) To: biolab/orange3 <orange3@noreply.github.com> Cc: mahawn87 <mac008@comcast.net>, Author <author@noreply.github.com> Subject: Re: [biolab/orange3] Will not impute data. Keeps crashing my computers.  (#4982) 
It fails on my computer, too, so we can investigate what's wrong. Thanks a lot!

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.


Resolving patch:
diff --git a/Orange/classification/simple_tree.py b/Orange/classification/simple_tree.py
--- a/Orange/classification/simple_tree.py
+++ b/Orange/classification/simple_tree.py
@@ -78,7 +78,7 @@ class SimpleTreeLearner(Learner):
 
     name = 'simple tree'
 
-    def __init__(self, min_instances=2, max_depth=1024, max_majority=1.0,
+    def __init__(self, min_instances=2, max_depth=32, max_majority=0.95,
                  skip_prob=0.0, bootstrap=False, seed=42):
         super().__init__()
         self.min_instances = min_instances
diff --git a/Orange/widgets/data/owimpute.py b/Orange/widgets/data/owimpute.py
--- a/Orange/widgets/data/owimpute.py
+++ b/Orange/widgets/data/owimpute.py
@@ -162,7 +162,7 @@ def __init__(self):
         super().__init__()
         self.data = None  # type: Optional[Orange.data.Table]
         self.learner = None  # type: Optional[Learner]
-        self.default_learner = SimpleTreeLearner()
+        self.default_learner = SimpleTreeLearner(min_instances=10, max_depth=10)
         self.modified = False
         self.executor = qconcurrent.ThreadExecutor(self)
         self.__task = None


Test patch: