Untitled
unknown
plain_text
7 months ago
1.2 kB
8
Indexable
File /usr/local/lib/python3.11/site-packages/sklearn/utils/validation.py:1093, in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_writeable, force_all_finite, ensure_all_finite, ensure_non_negative, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator, input_name)
1086 else:
1087 msg = (
1088 f"Expected 2D array, got 1D array instead:\narray={array}.\n"
1089 "Reshape your data either using array.reshape(-1, 1) if "
1090 "your data has a single feature or array.reshape(1, -1) "
1091 "if it contains a single sample."
1092 )
-> 1093 raise ValueError(msg)
1095 if dtype_numeric and hasattr(array.dtype, "kind") and array.dtype.kind in "USV":
1096 raise ValueError(
1097 "dtype='numeric' is not compatible with arrays of bytes/strings."
1098 "Convert your data to numeric values explicitly instead."
1099 )
ValueError: Expected 2D array, got 1D array instead:
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.Editor is loading...
Leave a Comment