이것은 number에 대한 ocr의 구현입니다.Sklearn svm이 동일한 값을 예측합니다.
#mix the dataset
dataset=np.delete(dataset,0,0)
lable=np.delete(lable,0)
X=dataset.shape[0]
l=range(X)
np.random.shuffle(l)
sampleing=np.zeros(32*32)
lableing=np.zeros(1)
for x in l:
sampleing=np.vstack((sampleing,dataset[x]))
lableing=np.hstack((lableing,lable[x]))
sampleing=np.delete(sampleing,0,0)
lableing=np.delete(lableing,0)
x=sampleing.shape[0]
train=sampleing[0:int(x*0.8)]
train_lableing=lableing[0:int(x*0.8)]
test=sampleing[int(x*0.8):]
test_lableing=lableing[int(x*0.8):]
clf=svm.SVC(gamma=0.001, C=100.)
print clf.fit(train,train_lableing)
predict=clf.predict(test)
print classification_report(test_lableing,predict)
print predict
이 0.03 0.17 0.05 88
[ '8'에 '8'에 '8'에 '8'에 '8'에 '8'의 '총 8 내 출력
precision recall f1-score support
0 0.00 0.00 0.00 9
1 0.00 0.00 0.00 14
2 0.00 0.00 0.00 6
3 0.00 0.00 0.00 5
4 0.00 0.00 0.00 4
5 0.00 0.00 0.00 3
6 0.00 0.00 0.00 10
7 0.00 0.00 0.00 12
8 0.17 1.00 0.29 15
9 0.00 0.00 0.00 10
평균/IS '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' ' 8 "8"8 "8"8 "8"8 "8"8 "8"8 "8"8 "8 ' '8 ''8 '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8' '8']
왜 나는 동일한 예측 가치를 얻고 있습니다. 나는 무작위 훈련 및 테스트 데이터를 전달하고 있습니다. 디버깅을 시도했으나 code.please 도움말에 문제가 없습니다.