(self, key: str, last_n: int = None)
| 34 | return self.best_metrics.get(key) |
| 35 | |
| 36 | def get_average(self, key: str, last_n: int = None) -> float: |
| 37 | history = self.get_history(key) |
| 38 | if not history: |
| 39 | return 0.0 |
| 40 | |
| 41 | if last_n is not None: |
| 42 | history = history[-last_n:] |
| 43 | |
| 44 | return np.mean([v for v in history if v is not None]) |
| 45 | |
| 46 | def save(self, filepath: str): |
| 47 | os.makedirs(os.path.dirname(filepath), exist_ok=True) |
nothing calls this directly
no test coverage detected