twinlab.Emulator.update#
- Emulator.update(df, df_std=None, wait=True, verbose=False)[source]#
Update an emulator with new training data.
This method allows a user to update an existing emulator with new training data. This is useful when new data is collected, and the emulator needs to incorporate this new information, but you do not want to train the emulator from scratch. The parameters of the emulator are not updated; in this process the emulator is simply conditioned on the new data points. This means that the process is fast, but note that the quality of the emulator may degrade with multiple frequent updates, compared to re-training in an active learning loop.
- Parameters:
df (pandas.DataFrame) – The new training data to update the emulator with.
df_std (pandas.DataFrame, optional) – The standard deviation of the new training data. This is used to update the emulator with uncertainty information.
wait (bool, optional) – If
True
wait for the job to complete, otherwise return the process ID and exit.verbose (bool, optional) – Display information about the operation while running.
- Return type:
- Returns:
None
Example
df = pd.DataFrame({"X": [1, 2, 3, 4], "y": [1, 4, 9, 16]}) emulator = tl.Emulator("my_emulator") emulator.train(df) # Update the emulator with new data new_df = pd.DataFrame({"X": [5], "y": [25]}) emulator.update(new_df)