electricity-theft-detection-with-self-attention
electricity-theft-detection-with-self-attention copied to clipboard
how to solve this error? thanks
TypeError Traceback (most recent call last)
3 frames /usr/local/lib/python3.10/dist-packages/sklearn/utils/validation.py in _num_samples(x) 333 if hasattr(x, "shape") and x.shape is not None: 334 if len(x.shape) == 0: --> 335 raise TypeError( 336 "Singleton array %r cannot be considered a valid collection." % x 337 )
TypeError: Singleton array array(<Flags(allows_duplicate_labels=True)>, dtype=object) cannot be considered a valid collection.
it's solved,thanks
解决了,谢谢
你好,我碰到了同样的问题,请问您是如何解决的?谢谢
it's solved,thanks I meet the same question, could you let me know what you solve the problem?
I solved this problem by changing the way it accesses the target column.
In the file train.py, within the function 'perform_kfold_cv', change df.flags to df['flags']. The first returns the attribute of the dataframe, while the second accesses the data within the flags column