import pickle
from collections import Counter
training_file = 'train.p'
test_file = 'test.p'
with open(training_file, 'rb') as f:
train = pickle.load(f)
with open(test_file, 'rb') as f:
test = pickle.load(f)
x_train, y_train = train['features'], train['labels']
x_test, y_test = test['features'], test['labels']
c = Counter(y_train)
print(c.items())
.p文件输出每一类标签有多少个数据
最新推荐文章于 2021-03-19 19:22:50 发布