Skip to content

Commit 1e7ae9e

Browse files
committed
address future warning
1 parent 0ce10ea commit 1e7ae9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sklbench/datasets/downloaders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def fetch_and_correct_openml(
9797

9898
# Get the data with target column specified
9999
x, y, _, _ = dataset.get_data(
100-
dataset_format="dataframe" if as_frame is True else "array",
100+
dataset_format="dataframe",
101101
target=dataset.default_target_attribute,
102102
)
103103

@@ -109,6 +109,8 @@ def fetch_and_correct_openml(
109109
if isinstance(x, pd.DataFrame):
110110
if any(pd.api.types.is_sparse(x[col]) for col in x.columns):
111111
x = x.sparse.to_dense()
112+
if not as_frame:
113+
x = x.to_numpy()
112114

113115
# Convert y to numpy array if needed
114116
if isinstance(y, pd.Series):

0 commit comments

Comments
 (0)