[WIP] Hierarchical clustering: Fix visualisations for small values #4310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Fixes (partially) #2650
The problem here is that distances in a case when we are using cosine distance are very small since values are not normalized and dates are huge numbers (seconds from January 1, 1970) comparing to other values. Why we do not normalize values for the cosine distance? @lanzagar In this case, it would solve the problem.
Description of changes
This PR currently removes lines at the right of the visualization.
Lining lines still persist. They are caused since qt somehow randomly drops elements in QPainterPath when numbers are really small. Here is the example:
Four elements should be in QPainterPath but only 2 persists.
This can be solved with scaling values for example in the range from 0 to 1. @ales-erjavec is there any better and easier solution for that? Sine if we do scaling the widget would need to be partially redesigned.
And there is another potential issue. After finding out that I cannot compute the cosine distance with normalization I was trying to normalize with the Preprocess widget. It also does not normalize the time variable since by default
normalize_datetime=False
. In my opinion, when one has a time variable among attributes and does the preprocessing he also wants to preprocess/normalize it together with other variables. Is there a specific reason that it is disabled? @lanzagar @janezdIncludes