leaspy.algo.fit.fit_output_manager¶
Classes¶
Class used by |
Module Contents¶
- class FitOutputManager(outputs)[source]¶
Class used by
AbstractAlgo(and its child classes) to display & save plots and statistics during algorithm execution.- Parameters:
- outputs
OutputsSettings Initialize the FitOutputManager class attributes, like the logs paths, the console print periodicity and so forth.
- outputs
- Attributes:
- path_output
str Path of the folder containing all the outputs
- path_plot
str Path of the subfolder of path_output containing the logs plots
- path_plot_convergence_model_parameters
str Path of the first plot of the convergence of the model’s parameters (in the subfolder path_plot)
- path_plot_patients
str Path of the subfolder of path_plot containing the plot of the reconstruction of the patients’ longitudinal trajectory by the model
- nb_of_patients_to_plot
int Number of patients for whom the reconstructions will be plotted.
- path_save_model_parameters_convergence
str Path of the subfolder of path_output containing the progression of the model’s parameters convergence
- periodicity_plot
int(default 100) Set the frequency of the display of the plots
- periodicity_print
int Set the frequency of the display of the statistics
- periodicity_save
int Set the frequency of the saves of the model’s parameters
- periodicity_plot_patients
int Set the frequency of the saves of the patients’ reconstructions
- plot_sourcewise
bool If True, plots will be generated for each source separately.
- path_output
- periodicity_print¶
- periodicity_save¶
- periodicity_plot¶
- nb_of_patients_to_plot¶
- periodicity_plot_patients¶
- plot_sourcewise¶
- time¶
- iteration(algo, model, data)[source]¶
Call methods to save state of the running computation, display statistics & plots if the current iteration is a multiple of periodicity_print, periodicity_plot or periodicity_save
- Parameters:
- algo
FitAlgo A fitting algorithm.
- model
McmcSaemCompatibleModel The model used by the computation.
- data
Dataset The data used by the computation
- algo
- Parameters:
algo (FitAlgorithm)
model (McmcSaemCompatibleModel)
data (Dataset)
- Return type:
None
- print_model_statistics(model)[source]¶
Prints model’s statistics.
- Parameters:
- model
McmcSaemCompatibleModel The model used by the computation
- model
- Parameters:
model (McmcSaemCompatibleModel)
- print_algo_statistics(algo)[source]¶
Prints algorithm’s statistics
- Parameters:
- algo
FitAlgo A fitting algorithm.
- algo
- Parameters:
algo (FitAlgorithm)
- save_model_parameters_convergence(iteration, model)[source]¶
Saves the current state of the model’s parameters
- Parameters:
- iteration
int The current iteration.
- model
McmcSaemCompatibleModel The model used by the computation
- iteration
- Parameters:
iteration (int)
model (McmcSaemCompatibleModel)
- Return type:
None
- save_plot_convergence_model_parameters(model)[source]¶
Saves figures of the model parameters’ convergence in multiple pages of a PDF.
- Parameters:
- model
McmcSaemCompatibleModel The model used by the computation
- model
- Parameters:
model (McmcSaemCompatibleModel)
- save_plot_patient_reconstructions(iteration, model, data)[source]¶
Saves figures of real longitudinal values and their reconstructions computed by the model for maximum 5 patients during each iteration.
- Parameters:
- iteration
int The current iteration
- model
McmcSaemCompatibleModel The model used by the computation
- data
Dataset The dataset used by the computation
- iteration
- Parameters:
iteration (int)
model (McmcSaemCompatibleModel)
data (Dataset)
- Return type:
None