(self, filepath: str)
| 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) |
| 48 | |
| 49 | data = { |
| 50 | 'metrics': self.metrics, |
| 51 | 'best_metrics': self.best_metrics |
| 52 | } |
| 53 | |
| 54 | with open(filepath, 'w') as f: |
| 55 | json.dump(data, f, indent=2) |
| 56 | |
| 57 | def load(self, filepath: str): |
| 58 | with open(filepath, 'r') as f: |
nothing calls this directly
no outgoing calls
no test coverage detected