HelenGuohx / logbert

log anomaly detection via BERT
MIT License
240 stars 102 forks source link

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

Open MaNingning825 opened 1 year ago

MaNingning825 commented 1 year ago

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
Bladetuab commented 1 year ago

I got that error too. Any helps?

2718455213wcx commented 1 year ago

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.

A-y-u-s-h-S-h-a-h commented 8 months ago

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

andrus801 commented 6 months ago

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