.. _example_plot_digits_classification.py: ================================ Recognizing hand-written digits ================================ An example showing how the scikit-learn can be used to recognize images of hand-written digits. This example is commented in the :ref:`tutorial section of the user manual `. .. image:: images/plot_digits_classification_1.png :align: center **Script output**:: Classification report for classifier SVC(C=100, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.001, kernel=rbf, probability=False, scale_C=True, shrinking=True, tol=0.001): precision recall f1-score support 0 1.00 0.98 0.99 88 1 0.93 0.92 0.93 91 2 0.98 0.93 0.95 86 3 0.95 0.81 0.88 91 4 0.99 0.92 0.96 92 5 0.88 0.90 0.89 91 6 0.99 0.99 0.99 91 7 0.95 1.00 0.97 89 8 0.91 0.84 0.88 88 9 0.75 0.96 0.84 92 avg / total 0.93 0.93 0.93 899 Confusion matrix: [[86 0 0 0 1 1 0 0 0 0] [ 0 84 0 0 0 1 0 0 0 6] [ 0 0 80 3 0 0 0 0 0 3] [ 0 0 0 74 0 4 0 4 5 4] [ 0 0 0 0 85 0 0 1 2 4] [ 0 0 0 0 0 82 1 0 0 8] [ 0 1 0 0 0 0 90 0 0 0] [ 0 0 0 0 0 0 0 89 0 0] [ 0 5 2 0 0 2 0 0 74 5] [ 0 0 0 1 0 3 0 0 0 88]] **Python source code:** :download:`plot_digits_classification.py ` .. literalinclude:: plot_digits_classification.py :lines: 13-