Replaying to myself...
The cause for reported "problem" is that classifier samples have empty
strips on both sides, so if I shrink my_array to 6 columns and add empty
columns on both sides, I get expected value - zero.
But still, results from this approach can't beat tesseract unfortunately
for my samples.
On Thu, May 22, 2014 at 2:08 PM, klo uo <[email protected]> wrote:
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general