We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ce10ea commit 1e7ae9eCopy full SHA for 1e7ae9e
sklbench/datasets/downloaders.py
@@ -97,7 +97,7 @@ def fetch_and_correct_openml(
97
98
# Get the data with target column specified
99
x, y, _, _ = dataset.get_data(
100
- dataset_format="dataframe" if as_frame is True else "array",
+ dataset_format="dataframe",
101
target=dataset.default_target_attribute,
102
)
103
@@ -109,6 +109,8 @@ def fetch_and_correct_openml(
109
if isinstance(x, pd.DataFrame):
110
if any(pd.api.types.is_sparse(x[col]) for col in x.columns):
111
x = x.sparse.to_dense()
112
+ if not as_frame:
113
+ x = x.to_numpy()
114
115
# Convert y to numpy array if needed
116
if isinstance(y, pd.Series):
0 commit comments