ParameterHistory
- class glotaran.parameter.parameter_history.ParameterHistory[source]
Bases:
object
A class representing a history of parameters.
Attributes Summary
Return the number of records in the history.
Return the labels of the parameters in the history.
Return the parameters in the history.
Methods Summary
Append
Parameters
to the history.Create a history from a csv file.
Create a history from a pandas data frame.
Get parameters for a history index.
Create a history from a csv file.
Write a
ParameterHistory
to a CSV file.Create a data frame from the history.
Methods Documentation
- append(parameters: Parameters, current_iteration: int = 0)[source]
Append
Parameters
to the history.- Parameters:
parameters (Parameters) – The group to append.
current_iteration (int) – Current iteration of the optimizer.
- Raises:
ValueError – Raised if the parameter labels differs from previous.
- classmethod from_csv(path: str) ParameterHistory [source]
Create a history from a csv file.
- Parameters:
path (str) – The path to the csv file.
- Returns:
The created history.
- Return type:
- classmethod from_dataframe(history_df: DataFrame) ParameterHistory [source]
Create a history from a pandas data frame.
- Parameters:
history_df (pd.DataFrame) – The source data frame.
- Returns:
The created history.
- Return type:
- get_parameters(index: int) ndarray [source]
Get parameters for a history index.
- Parameters:
index (int) – The history index.
- Returns:
The parameter values at the history index as array.
- Return type:
np.ndarray
- classmethod loader(path: str) ParameterHistory
Create a history from a csv file.
- Parameters:
path (str) – The path to the csv file.
- Returns:
The created history.
- Return type:
- property number_of_records: int
Return the number of records in the history.
- Returns:
The number of records.
- Return type:
- property parameters: list[ndarray]
Return the parameters in the history.
- Returns:
A list of parameters in the history.
- Return type:
list[np.ndarray]