Hi,

I followed documentation for digit recognition, as I was hoping for
something better then OCR with minimal involvement from my side.

Here is example:
http://nbviewer.ipython.org/gist/klonuo/873868aaaa5d0e5a8aa0

So I'm feeding the classifier with my own data compliant to format it
expects and get bogus result. I tried this for many digit samples, and
results are far than I naively expected.

But, this trained dataset consists of 1800 digits, and by giving me results
that none match with digit I feed the predictor, my lucky guess is that I'm
giving wrong parameters or maybe using wrong estimator or else?


Here is the code from link, just in case:

========================================
>>> from pylab import *
>>> from sklearn import svm
>>> from sklearn import datasets
>>> digits = datasets.load_digits()
>>> clf = svm.SVC(gamma=0.001, C=100.)
>>> clf.fit(digits.data[:-1], digits.target[:-1])
>>> imshow(digits.data[-1].reshape(8, 8), interpolation='nearest',
cmap='binary')
>>> clf.predict(digits.data[-1])
array([8])
>>> my_sample = array([0, 0, 1, 15, 15, 15, 15, 0, 0, 15, 15,
                       13, 0, 12, 15, 15, 12, 15, 10, 0, 0, 0,
                       15, 15, 15, 15, 0, 0, 0, 0, 15, 15, 15,
                       15, 0, 0, 0, 0, 15, 15, 15, 15, 0, 0,
                       0, 10, 15, 0, 15, 15, 0, 0, 4, 15, 8,
                       0, 0, 7, 15, 15, 15, 1, 0, 0])
>>> imshow(my_sample.reshape(8, 8), interpolation='nearest', cmap='binary')
>>> clf.predict(my_sample)  # expecting zero
array([1])
========================================


Thanks,
klo
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to