# Report the current best accuracy

**URL:** <https://discuss.ray.io/t/report-the-current-best-accuracy/717>\
**Category:** Ray Tune\
**Created:** [February 4, 2021, 1:45am UTC](https://discuss.ray.io/t/report-the-current-best-accuracy/717 "2021-02-04T01:45:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kovjxkjvklz](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@kovjxkjvklz](https://discuss.ray.io/u/kovjxkjvklz)\
**Post date:** [February 4, 2021, 1:45am UTC](https://discuss.ray.io/t/report-the-current-best-accuracy/717/1 "2021-02-04T01:45:48Z")

</div>

So I was running hyperparam exploration experiments on ray tune, and I want to keep track of the current best accuracy for each report, how could I store/access this list of values?  
`I.e. current best trial: ... with test_accuracy == `

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/1X/e8589021dc46020c647858abdeedc1762ad6b28d.png)

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [February 4, 2021, 1:49am UTC](https://discuss.ray.io/t/report-the-current-best-accuracy/717/2 "2021-02-04T01:49:23Z")

</div>

You could use a Tune Callback, which gives you a list of trials and their current scores:

[https://docs.ray.io/en/master/tune/user-guide.html#callbacks](https://docs.ray.io/en/master/tune/user-guide.html#callbacks)

---

<div class="post-metadata">

**Author:** ![kovjxkjvklz](https://avatars.discourse-cdn.com/v4/letter/k/ac8455/32.png) [@kovjxkjvklz](https://discuss.ray.io/u/kovjxkjvklz)\
**Post date:** [February 4, 2021, 2:06am UTC](https://discuss.ray.io/t/report-the-current-best-accuracy/717/3 "2021-02-04T02:06:21Z")

</div>

thanks! so in this case, does, for example, result[‘test\_accuracy’] referring to the best config’s test accuracy of this report? If not do I need to manually search through the configs’ test accuracy and find the best accuracy to keep track of?

```auto
class MyCallback(Callback):
    def on_trial_result(self, iteration, trials, trial, result, **info):
        print(f"Got result: {result['test_accuracy']}")

```

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [February 4, 2021, 2:14am UTC](https://discuss.ray.io/t/report-the-current-best-accuracy/717/4 "2021-02-04T02:14:42Z")

</div>

Ah, it doesn’t refer to the best config’s accuracy.

I think you’ll want to just use the current trial’s accuracy (`on_trial_result(..., trial, ...)`) and manually keep track of the best accuracy.
