# Log training accuracy using Trainer class

**URL:** <https://discuss.huggingface.co/t/log-training-accuracy-using-trainer-class/5529>\
**Category:** Beginners\
**Created:** [April 15, 2021, 4:40pm UTC](https://discuss.huggingface.co/t/log-training-accuracy-using-trainer-class/5529 "2021-04-15T16:40:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbejarano31](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dbejarano31](https://discuss.huggingface.co/u/dbejarano31)\
**Post date:** [April 15, 2021, 4:40pm UTC](https://discuss.huggingface.co/t/log-training-accuracy-using-trainer-class/5529/1 "2021-04-15T16:40:29Z")

</div>

Hello,

I am running BertForSequenceClassification and I would like to log the accuracy as well as other metrics that I have already defined for my **training set**. I saw in another issue that I have to add a `self.evaluate(self.train_dataset)` somewhere in the code, but I am a beginner when it comes to Python and deep learning in general so I am not sure where exactly I have to include it.

I was trying to replicate the evaluate() method of the Trainer class, taking the train\_dataset as argument, but it did not work. It would really mean a lot if you could guide me as for where I should tweak the code!

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![johnsmith986554](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@johnsmith986554](https://discuss.huggingface.co/u/johnsmith986554)\
**Post date:** [December 19, 2021, 2:32am UTC](https://discuss.huggingface.co/t/log-training-accuracy-using-trainer-class/5529/2 "2021-12-19T02:32:46Z")

</div>

Hi, I am having a similar issue. I used the Trainer similar to the example and all I see in the output is the training loss but I don’t see any training accuracy. I wonder if find out how to log accuracy. Thanks.
