# How do I generate a confusion matrix for each client at the end of each round?

**URL:** <https://discuss.flower.ai/t/how-do-i-generate-a-confusion-matrix-for-each-client-at-the-end-of-each-round/113>\
**Category:** Flower Help - Beginners\
**Tags:** faq, metrics\
**Created:** [February 29, 2024, 3:59pm UTC](https://discuss.flower.ai/t/how-do-i-generate-a-confusion-matrix-for-each-client-at-the-end-of-each-round/113 "2024-02-29T15:59:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flower](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/flower/32/17_2.png) [@flower](https://discuss.flower.ai/u/flower)\
**Post date:** [February 29, 2024, 3:59pm UTC](https://discuss.flower.ai/t/how-do-i-generate-a-confusion-matrix-for-each-client-at-the-end-of-each-round/113/1 "2024-02-29T15:59:16Z")

</div>

_This question was migrated from the Slack channel [#questions](https://friendly-flower.slack.com/archives/C01RM6LMKQA/p1707377619356679)._

**Original Question:**

Hello everyone. I am using FLOWER to develop a federated model on tabular datasets. It is a multiclassification problem, and I am using ANN as the base model. I want to generate a confusion matrix for each client at the end of each round. How should I do that? Has anyone tried that before?

**Answer:**

Hi! In order to compute a confusion matrix for each client at the end of each round, the easiest way to do it is to compute your confusion matrix inside the `evaluate` function of your clients. To compute the confusion matrix you can, for instance, use the following `scikit-learn` function: [scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion\_matrix.html](http://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html).

---

<div class="post-metadata">

**Author:** ![flower](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/flower/32/17_2.png) [@flower](https://discuss.flower.ai/u/flower)\
**Post date:** [March 1, 2024, 12:39pm UTC](https://discuss.flower.ai/t/how-do-i-generate-a-confusion-matrix-for-each-client-at-the-end-of-each-round/113/2 "2024-03-01T12:39:51Z")

</div>


