Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
store uint8 data in uint8 not float
  • Loading branch information
amueller committed Dec 3, 2019
commit 164173a9ee3c53442c5fe466e3e467c234b00124
9 changes: 9 additions & 0 deletions openml/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,15 @@ def _parse_data_from_arff(
'boolean'):
col.append(self._unpack_categories(
X[column_name], categories_names[column_name]))
elif attribute_dtype[column_name] in ('floating',
'integer'):
X_col = X[column_name]
if X_col.min() == 0 and X_col.max() == 255:
X_col_uint = X_col.astype('uint8')
if (X_col == X_col_uint).all():
col.append(X_col_uint)
continue
col.append(X[column_name])
else:
col.append(X[column_name])
X = pd.concat(col, axis=1)
Expand Down