Skip to content

Commit 9f1742e

Browse files
committed
only call todense if sparse
1 parent bcf452a commit 9f1742e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklbench/datasets/loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def load_codrnanorm(
450450
data_name: str, data_cache: str, raw_data_cache: str, dataset_params: Dict
451451
) -> Tuple[Dict, Dict]:
452452
def transform_x_y(x, y):
453-
x = pd.DataFrame(x.todense())
453+
x = pd.DataFrame(x.todense() if hasattr(x, "todense") else x)
454454
y = y.astype("int")
455455
y[y == -1] = 0
456456
return x, y

0 commit comments

Comments
 (0)