biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Predictions widget sorts numerical columns as text #5405

Closed processo closed 3 years ago

processo commented 3 years ago

The table view of the Predictions widget - when clicked on column header - sorts numerical values like text instead of number in the target and prediction columns but NOT in the rest of the data columns. (e.g. "100.0" < "58.0" because it starts with a '1')

image

janezd commented 3 years ago

Thanks for reporting this.

This widget is, well, complicated.

To whomever would work on this: I think the widget should be migrated to orangewidget.utils.itemmodels.AbstractSortTableModel. This would improve its performance (see https://github.com/biolab/orange3/blob/master/Orange/widgets/evaluate/owpredictions.py#L404), as well as simplify obtaining the keys for sorting. The problem is that the current code expects various QSortFilterProxyModel's method at several places.