svm - How can i retrieve most similar images inside a Support Vector Machine's class? -
svm - How can i retrieve most similar images inside a Support Vector Machine's class? -
when predict class belongs image in svm in scikit learn
... print "predicting on 1 sample" print "input features:" fv = [0.16666666666628771, 5.169878828456423e-26, 2.584939414228212e-22, 1.0, 1.0000000000027285] print fv print "predicted class index:" print clf.predict([fv])
output:
predicted class index: [5]
how can 5 similar images within class?
i don't thing can similarity measure between samples svm, distance sample hyperplane used classification.
you calculate euclidean distances between feature vectors of images using scipy.spatial.distance.pdist method. 5 images shortest distance target image can considered similar. hope helps.
svm scikit-learn
Comments
Post a Comment