[FIX] Nomogram: Purge class_var values#5847
Conversation
| orig_clv = original.class_var | ||
| orig_data = classifier.original_data | ||
| values = (orig_clv.values[int(i)] for i in | ||
| np.unique(orig_data.get_column_view(orig_clv)[0])) |
There was a problem hiding this comment.
np.unique is
mask = np.zeros(len(orig_clv.values), dtype=bool)
column = orig_data.get_column_view(orig_clv)[0]
mask[column[np.isfinite(column)].astype(int)] = True
values = tuple(np.array(orig_clv.values)[mask])(I haven't tested this code, it's just an idea.)
There was a problem hiding this comment.
I prefer the unique. For me, it is easier to read the code.
I'd leave it as is, unless you think it's too time consuming.
There was a problem hiding this comment.
I like what Janez did, but perhaps we could pack it into a function. Looking for values of discrete variables that are used in some column seems like something common.
There was a problem hiding this comment.
If @VesnaT finds the original better, we can keep it.
However, @markotoplak's idea to have a function make sense. Where to put it, how to name it? Hm, let's put it to Orange.prepocess.remove and name it remove_unused_values. Oh, no, wait, it's already there.
It is understandable that @VesnaT and I did not know about this function. Oh, no, wait, @VesnaT wrote it and I did some work on it two years ago.
Issue
Fixes #5846
Description of changes
Includes