biolab / orange3-educational

🍊 πŸŽ“ Educational widgets for machine learning and data mining in Orange 3.
Other
27 stars 20 forks source link

Polynomial Classification: Show original class #139

Closed janezd closed 2 years ago

janezd commented 2 years ago
Issue

Resolves #134.

Description of changes

At one point (presumably #112) somebody (presumanbly I) decided to expose that polynomial classifier classifies the target class vs. others by showing other classes as gray. At some point in one lecture, this started bothering me - I wanted to see both, actual and predicted classes.

This PR thus backtracks somewhat. At the same time it allows for observing/comparing the actual classes and predictions by showing the actual class with pen and the prediction with brush (with transparency corresponding to probability).

The background still shows the target color vs. gray to emphasize that the model predicts the target (e.g. the two classes are not symmetric - yes, mathematically, but not when we discuss it in class).

When predicting a binary class, the brush of the other class matches its color. When predicting multiple classes, the brush for others is gray. See the two images below.

Screenshot 2022-02-05 at 17 01 49 Screenshot 2022-02-05 at 17 03 21
Includes
codecov-commenter commented 2 years ago

Codecov Report

Merging #139 (bfe3c4d) into master (eb35826) will decrease coverage by 0.50%. The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   82.85%   82.35%   -0.51%     
==========================================
  Files          17       17              
  Lines        3015     3054      +39     
  Branches      420      425       +5     
==========================================
+ Hits         2498     2515      +17     
- Misses        463      481      +18     
- Partials       54       58       +4     
Impacted Files Coverage Ξ”
.../educational/widgets/owpolynomialclassification.py 88.45% <96.42%> (+0.77%) :arrow_up:
orangecontrib/educational/widgets/owkmeans.py 76.54% <0.00%> (-3.81%) :arrow_down:
...gecontrib/educational/widgets/owgradientdescent.py 88.16% <0.00%> (+0.23%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update eb35826...bfe3c4d. Read the comment docs.

janezd commented 2 years ago

I'm changing this back into draft: in training, the widget treats the data instances without class as instances of non-target class. Try https://ucilnica.fri.uni-lj.si/mod/resource/view.php?id=48556 and see how the line moves when changing the target class.

Ready now.

The problem with missing values is fixed primarily in https://github.com/biolab/orange3/pull/5891.

PrimozGodec commented 2 years ago

It looks good. I think it also needs to be included in the documentation. Still, since the documentation is outdated already (not only because of this PR), I will merge this PR and open an issue to remind us to update the documentation.