[ENH] Table.transpose: Use heuristic to guess data type of attributes of attributes#1844
Merged
lanzagar merged 2 commits intobiolab:masterfrom Jan 4, 2017
Merged
Conversation
Current coverage is 89.24% (diff: 98.48%)@@ master #1844 diff @@
==========================================
Files 86 86
Lines 9077 9100 +23
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 8096 8121 +25
+ Misses 981 979 -2
Partials 0 0
|
Contributor
|
This fails with Corpus (sparse issues, @nikicc) and with ImportImages (likely because data only has metas). |
Contributor
|
Sorry, not part of this PR. Just random bugs I discovered, should be in a different PR. |
Contributor
|
On the topic of this PR: shouldn't this make transposed zoo.tab also discrete? Or at least titanic, since it indeed has mostly 0 and 1 (if that's the criterium)? Dunno.... |
lanzagar
reviewed
Jan 3, 2017
Orange/data/table.py
Outdated
| feature names are mapped | ||
| :return: Table - transposed table | ||
| """ | ||
| from Orange.data.io import guess_data_type, sanitize_variable |
Contributor
There was a problem hiding this comment.
This import does not seem particularly slow or special in a way that would warrant local importing inside a function instead of at the top of the file. Or am I missing something?
33ee7fa to
1a4ac2d
Compare
lanzagar
reviewed
Jan 3, 2017
Orange/tests/test_table.py
Outdated
| np.testing.assert_array_equal(table1.X, table2.X) | ||
| np.testing.assert_array_equal(table1.Y, table2.Y) | ||
| np.testing.assert_array_equal(table1.metas, table2.metas) | ||
| self.assertTrue((table1.metas == table1.metas).all()) |
d360800 to
2f13f0f
Compare
2f13f0f to
ff2cdaa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Attributes' data type is StringVariable by default. Use heuristic to guess it.
Description of changes
Refactor io.py to make guessing heuristic reusable.
Use heuristic to guess data type of attributes to be saved to metas.
Includes