Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] OWBoxPlot: Show missing values #4135

Merged
merged 2 commits into from
Nov 8, 2019

Conversation

PrimozGodec
Copy link
Contributor

@PrimozGodec PrimozGodec commented Oct 23, 2019

Issue

Fixes #4128

Description of changes
  • In this PR we extend the box plot widget to show missing values for discrete variables.
  • We update the contingency to have three additional parameters to hold number of unknowns for each column, row and combined unknowns. Also, calls of contingency around Orange were updated.
Includes
  • Code changes
  • Tests
  • Documentation

@PrimozGodec PrimozGodec force-pushed the box-plot-missing-values branch 2 times, most recently from f4ffb71 to 95bb2bb Compare October 24, 2019 15:41
@janezd
Copy link
Contributor

janezd commented Oct 25, 2019

We discussed this. Yes it would make sense to group by having/not having missing values. Good idea.

@PrimozGodec PrimozGodec force-pushed the box-plot-missing-values branch 3 times, most recently from 7b9f0fe to 1a2f65b Compare November 5, 2019 10:38
@codecov
Copy link

codecov bot commented Nov 5, 2019

Codecov Report

Merging #4135 into master will increase coverage by 0.02%.
The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master    #4135      +/-   ##
==========================================
+ Coverage   85.71%   85.73%   +0.02%     
==========================================
  Files         389      389              
  Lines       69831    69832       +1     
==========================================
+ Hits        59856    59872      +16     
+ Misses       9975     9960      -15

@PrimozGodec PrimozGodec force-pushed the box-plot-missing-values branch 2 times, most recently from 30887a9 to 14d660b Compare November 5, 2019 12:22
@PrimozGodec PrimozGodec changed the title [WIP][ENH] OWBoxPlot: Show missing values [ENH] OWBoxPlot: Show missing values Nov 5, 2019
@PrimozGodec
Copy link
Contributor Author

PrimozGodec commented Nov 8, 2019

It is ready now.

@ajdapretnar
Copy link
Contributor

Hm. This doesn't seem to work on heart_disease... 🤔

Traceback (most recent call last):
  File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 718, in __process_next
    self.process_queued()
  File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 476, in process_queued
    self.process_node(node_update_front[0])
  File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 523, in process_node
    self.send_to_node(node, signals_in)
  File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/orangewidget/workflow/widgetsscheme.py", line 775, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
  File "/Users/ajda/miniconda3/envs/o3/lib/python3.7/site-packages/orangewidget/workflow/widgetsscheme.py", line 809, in process_signals_for_widget
    handler(*args)
  File "/Users/ajda/orange/orange3/Orange/widgets/visualize/owboxplot.py", line 318, in set_data
    self.grouping_changed()
  File "/Users/ajda/orange/orange3/Orange/widgets/visualize/owboxplot.py", line 392, in grouping_changed
    self.attr_changed()
  File "/Users/ajda/orange/orange3/Orange/widgets/visualize/owboxplot.py", line 402, in attr_changed
    self.compute_box_data()
  File "/Users/ajda/orange/orange3/Orange/widgets/visualize/owboxplot.py", line 427, in compute_box_data
    dataset, attr, self.group_var)
  File "/Users/ajda/orange/orange3/Orange/statistics/contingency.py", line 286, in get_contingency
    dat, col_variable, row_variable, col_unknowns, row_unknowns)
  File "/Users/ajda/orange/orange3/Orange/statistics/contingency.py", line 194, in __init__
    self.from_data(dat, col_variable, row_variable)
  File "/Users/ajda/orange/orange3/Orange/statistics/contingency.py", line 220, in from_data
    conts = data._compute_contingency([col_variable], row_variable)
  File "/Users/ajda/orange/orange3/Orange/data/table.py", line 1490, in _compute_contingency
    col_data, classes_, n_rows, W_)
  File "Orange/data/_contingency.pyx", line 11, in Orange.data._contingency.contingency_floatarray
    @cython.wraparound(False)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'double'

@PrimozGodec
Copy link
Contributor Author

It works for me. There is a change in the Cython code. It was compiled in .c code already but it needs to be compiled again for each computer (at MacOS the result of the compilation is .so file). The easiest way to do that is by running:

pip install -e . 

in the Orange folder when this PR is checked out.

@ajdapretnar
Copy link
Contributor

Ah, important detail. 👌 Love the change!

@ajdapretnar ajdapretnar merged commit a0507ec into biolab:master Nov 8, 2019
@PrimozGodec PrimozGodec mentioned this pull request Nov 28, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Box Plot: show missing values
3 participants