def history_clean(history):
    """Convert history to native python types (for json serialization)"""
    for key in history:
        history[key] = [float(val) for val in history[key]]
    return history