Create a classification report using a confusion matrix as input

### Describe the workflow you want to enable

I had some results stored in the form of a confusion matrix for some experiments. However, I wanted to use `classification_report` to easily compute all the metrics.

### Describe your proposed solution

My solution consists of creating new `y_true` and `y_pred` vectors and using those to then call `classification_report`.

```python
def classification_report_from_confusion_matrix(confusion_matrix, **args):
    y_true = np.zeros(np.sum(confusion_matrix), dtype=int)
    y_pred = np.copy(y_true)

    i = 0
    for target in range(len(confusion_matrix)):
        for pred in range(len(confusion_matrix)):
            n = confusion_matrix[target][pred]
            y_true[i:i+n] = target
            y_pred[i:i+n] = pred
            i += n

    return metrics.classification_report(y_true, y_pred, **args)
```

### Describe alternatives you've considered, if relevant

I first tried using lists and appending values, but the `numpy` version performs faster, although slightly less readable:

```python
def classification_report_from_confusion_matrix(confusion_matrix, **args):

    y_true = []
    y_pred = []

    for gt in range(len(total)):
        for pred in range(len(total)):
            y_true += [gt]*total[gt][pred]
            y_pred += [pred]*total[gt][pred]

    return metrics.classification_report(y_true , y_pred, **args)
```

### Additional context

I was comparing two approaches:
* **Two separate models**, each for different tasks
* One **single model** incorporating both tasks

Two compare them, I built a confusion matrix of the two separate models and concatenated them so that the final confusion matrix would be similar to the single model.
I used this function to generate the classification report of the **two separate models** after concatenating their confusion matrices.
In the case of the **single** model, I could use `classification_report` directly.

COMMENT:
Do you have any suggestions for what example could be changed?
* [Recognizing hand-written digits](https://scikit-learn.org/stable/auto_examples/classification/plot_digits_classification.html#sphx-glr-auto-examples-classification-plot-digits-classification-py)
* [Faces recognition example using eigenfaces and SVMs](https://scikit-learn.org/stable/auto_examples/applications/plot_face_recognition.html#sphx-glr-auto-examples-applications-plot-face-recognition-py)
* [Label Propagation digits active learning](https://scikit-learn.org/stable/auto_examples/semi_supervised/plot_label_propagation_digits_active_learning.html#sphx-glr-auto-examples-semi-supervised-plot-label-propagation-digits-active-learning-py)
* [Label Propagation digits: Demonstrating performance](https://scikit-learn.org/stable/auto_examples/semi_supervised/plot_label_propagation_digits.html#sphx-glr-auto-examples-semi-supervised-plot-label-propagation-digits-py)

All have confusion matrices but the `classification_report` is computed earlier. I could add a cell after the confusion matrix exemplifying the usage of the helper function after computing the confusion matrix, but I don't know if that would fit.

Labels: Documentation