ValueError: setting an array element with a sequence. The Error: Traceback (most recent call last):įile "/home/user/.local/lib/python3.5/site-packages/sklearn/preprocessing/data.py", line 133, in scaleįile "/home/user/.local/lib/python3.5/site-packages/sklearn/utils/validation.py", line 433, in check_arrayĪrray = np.array(array, dtype=dtype, order=order, copy=copy) From reading other questions regarding this issue: ValueError: setting an array element with a sequence, it's either due to wrong structure of my data or because my data is of type string. In other cases, output indices are (implicitly) set to the alphabetically sorted sequence of indices appearing exactly once in the equation. I am using the preprocessing module to prep my data. Please let me know if you have any idea how to solve this issue or what it even means. I'm trying to use scikit-learn to do some ML. The data are of type float.įrom reading other questions regarding this issue: ValueError: setting an array element with a sequence, it's either due to wrong structure of my data or because my data is of type string. I am using the preprocessing module to prep my data. The ValueError: setting an array element with a sequence occurs when: An array does not have a proper shape, i.e. ![]() ![]() ![]() 2- For a specific feature vector, the number of elements are not equal. I'm trying to use scikit-learn to do some ML. 1 Answer Sorted by: 1 So, you pass sequences into KMeans (like 8, 1) and that's why it does not work. 3 Answers Sorted by: 8 I had the same exact error, it's one of two possibilities: 1- Data and labels are not in the same length. sklearn model.fit 'setting an array element with a sequence.' score:1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |