logbert icon indicating copy to clipboard operation
logbert copied to clipboard

test_size=68 should be either positive and smaller than the number of samples 34 or a float in the (0, 1) range

Open MaNingning825 opened this issue 1 year ago • 5 comments

I run python logbert.py train have error

logkey_trainset, logkey_validset, time_trainset, time_validset = train_test_split(logkey_seq_pairs,
......
ValueError: test_size=68 should be either positive and smaller than the number of samples 34 or a float in the (0, 1) range

MaNingning825 avatar Mar 23 '23 07:03 MaNingning825

I got that error too. Any helps?

Bladetuab avatar Jun 02 '23 08:06 Bladetuab

I'm having another problem: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (4855, 1) + inhomogeneous part.

2718455213wcx avatar Sep 25 '23 07:09 2718455213wcx

I am having a problem with this "test_size=68 should be either positive and smaller than the number of samples 34 or a float in the (0, 1) range" was anybody able to solve this? any help would be appreciated

AYUSH1382 avatar Feb 13 '24 03:02 AYUSH1382

This worked for me:explicitly set dtype="object" for the np.array() call.

Found from:

https://stackoverflow.com/questions/67183501/setting-an-array-element-with-a-sequence-requested-array-has-an-inhomogeneous-sh

andrus801 avatar Apr 22 '24 22:04 andrus801