-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Table.transpose: Use heuristic to guess data type of attributes of attributes #1844
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
|
This fails with Corpus (sparse issues, @nikicc) and with ImportImages (likely because data only has metas). |
Sorry, not part of this PR. Just random bugs I discovered, should be in a different PR. |
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.... |
@@ -1453,6 +1453,8 @@ def transpose(cls, table, feature_names_column="", | |||
feature names are mapped | |||
:return: Table - transposed table | |||
""" | |||
from Orange.data.io import guess_data_type, sanitize_variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -2546,7 +2576,7 @@ def _compare_tables(self, table1, table2): | |||
self.assertEqual(table1.n_rows, table2.n_rows) | |||
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not.
d360800
to
2f13f0f
Compare
2f13f0f
to
ff2cdaa
Compare
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