[FIX]OWFreeViz: Fix optimization for data with missing values#3358
[FIX]OWFreeViz: Fix optimization for data with missing values#3358janezd merged 1 commit intobiolab:masterfrom
Conversation
| np.max(np.linalg.norm(embedding[self.valid_data], axis=1)) or 1 | ||
| EX = np.dot(self._X, self.projection) | ||
| EX /= np.max(np.linalg.norm(EX, axis=1)) or 1 | ||
| embedding = np.zeros((len(self.data), 2), dtype=np.float) |
There was a problem hiding this comment.
If the original data had missing values, and the embedding is not available for all points, I think it is better to assign missing values to those points as the embedding too (instead of zeros).
There was a problem hiding this comment.
Also, while I doubt these projections will ever be generalized to more than 2D, I would still prefer to not make implicit assumptions like that in the code and use EX.shape[1] instead of 2
|
I see that @janezd was quicker than my comments... :) |
|
I apologize for being over-eager. :)
You're right about 2D. On the other hand, if it would say |
|
I know it is not going to be generalized. I just really dislike hardcoded constants in code (numbers, strings) when they can be avoided :) However, I would change the zeros to nans, as I think that is conceptually more correct. |
|
I agree about nans. I guess @VesnaT should make a change in a new PR. I promise I won't merge it. :) |
Issue
The widget crashed when received dataset with missing values on the input.
Description of changes
Includes