python data.history attribute code example
Example 1: python data object
from dataclasses import dataclass
@dataclass
class InventoryItem:
"""Class for keeping track of an item in inventory."""
name: str
unit_price: float
quantity_on_hand: int = 0
def total_cost(self) -> float:
return self.unit_price * self.quantity_on_hand
Example 2: save model history keras
with open('/trainHistoryDict', 'wb') as file_pi:
pickle.dump(history.history, file_pi)