.. _example_classification_plot_classification_probability.py:


===============================
Plot classification probability
===============================

Plot the classification probability for different classifiers. We use a 3
class dataset, and we classify it with a Support Vector classifier, L1
and L2 penalized logistic regression with either a One-Vs-Rest or multinomial
setting.

The logistic regression is not a multiclass classifier out of the box. As
a result it can identify only the first class.



.. image:: images/plot_classification_probability_001.png
    :align: center


**Script output**::

  classif_rate for L2 logistic (OvR) : 76.666667 
  classif_rate for L1 logistic : 79.333333 
  classif_rate for Linear SVC : 82.000000 
  classif_rate for L2 logistic (Multinomial) : 82.000000



**Python source code:** :download:`plot_classification_probability.py <plot_classification_probability.py>`

.. literalinclude:: plot_classification_probability.py
    :lines: 14-

**Total running time of the example:**  0.63 seconds
( 0 minutes  0.63 seconds)