biolab / orange2

DEPRECATED: Orange 2 (Python 2) data mining suite. NEW: https://github.com/biolab/orange3
GNU General Public License v3.0
307 stars 142 forks source link

Mosaic plot produces a 'KeyError' unable to set <Orange.widgets.gui.OrangeComboBox object at 0x04E6E6C0> to value 'Feature 9'. #38

Closed ypanagis closed 8 years ago

ypanagis commented 8 years ago

I am trying to load the titanic dataset from the example datasets given with Orange and build a mosaic plot with it. After I select all the data from the DataTable the Output window pops-up and I get the error below. I am using version 3.2.dev0+ee85297 in Windows7 x64. Orange was installed with Python 3.4 32bits that was pre-existing in my machine

unable to set <Orange.widgets.gui.OrangeComboBox object at 0x04E6E6C0> to value 'Feature 9'. Possible values are status, age, sex, survived.
--------------------------------------------------------------------------------
KeyError                                      Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\widgetsscheme.py", line 690, in process_signals_for_widget
    widget.handleNewSignals()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 396, in handleNewSignals
    self.updateGraphAndPermList()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 447, in updateGraphAndPermList
    self.updateGraph(**args)
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 483, in updateGraph
    data = data[:, attrList + [data.domain.class_var]]
  File "C:\Python34\lib\site-packages\Orange\data\table.py", line 637, in __getitem__
    attributes, col_indices = self.domain._compute_col_indices(col_idx)
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in _compute_col_indices
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in <listcomp>
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 213, in __getitem__
    idx = self._indices[idx]
KeyError: 'Feature 9'
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\widgetsscheme.py", line 690, in process_signals_for_widget
    widget.handleNewSignals()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 396, in handleNewSignals
    self.updateGraphAndPermList()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 447, in updateGraphAndPermList
    self.updateGraph(**args)
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 483, in updateGraph
    data = data[:, attrList + [data.domain.class_var]]
  File "C:\Python34\lib\site-packages\Orange\data\table.py", line 637, in __getitem__
    attributes, col_indices = self.domain._compute_col_indices(col_idx)
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in _compute_col_indices
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in <listcomp>
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 213, in __getitem__
    idx = self._indices[idx]
KeyError: 'Feature 9'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\logging\__init__.py", line 980, in emit
    stream.write(msg)
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\lib\site-packages\Orange\canvas\__main__.py", line 403, in <module>
    sys.exit(main())
  File "C:\Python34\lib\site-packages\Orange\canvas\__main__.py", line 386, in main
    status = app.exec_()
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\widgetsscheme.py", line 714, in event
    return SignalManager.event(self, event)
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\signalmanager.py", line 452, in event
    self.process_queued(max_nodes=1)
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\signalmanager.py", line 316, in process_queued
    self.process_node(node)
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\signalmanager.py", line 335, in process_node
    self.send_to_node(node, signals_in)
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\widgetsscheme.py", line 632, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
  File "C:\Python34\lib\site-packages\Orange\canvas\scheme\widgetsscheme.py", line 694, in process_signals_for_widget
    node.title)
Message: "Error calling 'handleNewSignals()' of '%s'"
Arguments: ('Mosaic Display',)
--------------------------------------------------------------------------------
KeyError                                      Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 321, in resizeEvent
    self.updateGraph()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 483, in updateGraph
    data = data[:, attrList + [data.domain.class_var]]
  File "C:\Python34\lib\site-packages\Orange\data\table.py", line 637, in __getitem__
    attributes, col_indices = self.domain._compute_col_indices(col_idx)
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in _compute_col_indices
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in <listcomp>
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 213, in __getitem__
    idx = self._indices[idx]
KeyError: 'Feature 9'
--------------------------------------------------------------------------------
KeyError                                      Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 325, in showEvent
    self.updateGraph()
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 483, in updateGraph
    data = data[:, attrList + [data.domain.class_var]]
  File "C:\Python34\lib\site-packages\Orange\data\table.py", line 637, in __getitem__
    attributes, col_indices = self.domain._compute_col_indices(col_idx)
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in _compute_col_indices
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in <listcomp>
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 213, in __getitem__
    idx = self._indices[idx]
KeyError: 'Feature 9'
--------------------------------------------------------------------------------
KeyError                                      Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\Orange\widgets\gui.py", line 2550, in __call__
    self.f(**kwds)
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 447, in updateGraphAndPermList
    self.updateGraph(**args)
  File "C:\Python34\lib\site-packages\Orange\widgets\visualize\owmosaic.py", line 483, in updateGraph
    data = data[:, attrList + [data.domain.class_var]]
  File "C:\Python34\lib\site-packages\Orange\data\table.py", line 637, in __getitem__
    attributes, col_indices = self.domain._compute_col_indices(col_idx)
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in _compute_col_indices
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 391, in <listcomp>
    attributes = [self[col] for col in col_idx]
  File "C:\Python34\lib\site-packages\Orange\data\domain.py", line 213, in __getitem__
    idx = self._indices[idx]
KeyError: 'Feature 9'
kernc commented 8 years ago

Can you share the OWS workflow file (File > Save as). I can't seem to reproduce it with my settings. 'Feature 9' indicates something isn't getting loaded correctly; titanic dataset has no Feature 9.

ypanagis commented 8 years ago

Right it seems to me that it was a remainder of one of my earlier attempts to draw a mosaic plot, but I would expect the variables to be wiped out. Thus, I was trying to reproduce yesterday's problem but at the point I was trying to connect a Data Table to the File widget, Orange was freezing. I am gladly sharing with you another .tab file I have and the respective OWS workflow, that exhibit the same issue. I have renamed both to .txt because I couldn't upload otherwise edutemp2.tab.txt untitled.ows.txt

kernc commented 8 years ago

Firstly, this issue is incorrectly set against Orange (2), not against Orange 3 as it should be. It's not your fault though, @acopar needs to update the website GitHub links.

I'm moving this issue there as best as I can.