leaspy.algo.fit.fit_output_manager ================================== .. py:module:: leaspy.algo.fit.fit_output_manager Classes ------- .. autoapisummary:: leaspy.algo.fit.fit_output_manager.FitOutputManager Module Contents --------------- .. py:class:: FitOutputManager(outputs) Class used by :class:`~leaspy.algo.AbstractAlgo` (and its child classes) to display & save plots and statistics during algorithm execution. :Parameters: **outputs** : :class:`~leaspy.algo.OutputsSettings` Initialize the `FitOutputManager` class attributes, like the logs paths, the console print periodicity and so forth. :Attributes: **path_output** : :obj:`str` Path of the folder containing all the outputs **path_plot** : :obj:`str` Path of the subfolder of path_output containing the logs plots **path_plot_convergence_model_parameters** : :obj:`str` Path of the first plot of the convergence of the model's parameters (in the subfolder path_plot) **path_plot_patients** : :obj:`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** : :obj:`int` Number of patients for whom the reconstructions will be plotted. **path_save_model_parameters_convergence** : :obj:`str` Path of the subfolder of path_output containing the progression of the model's parameters convergence **periodicity_plot** : :obj:`int` (default 100) Set the frequency of the display of the plots **periodicity_print** : :obj:`int` Set the frequency of the display of the statistics **periodicity_save** : :obj:`int` Set the frequency of the saves of the model's parameters **periodicity_plot_patients** : :obj:`int` Set the frequency of the saves of the patients' reconstructions **plot_sourcewise** : :obj:`bool` If True, plots will be generated for each source separately. .. !! processed by numpydoc !! .. py:attribute:: periodicity_print .. py:attribute:: periodicity_save .. py:attribute:: periodicity_plot .. py:attribute:: nb_of_patients_to_plot .. py:attribute:: periodicity_plot_patients .. py:attribute:: plot_sourcewise .. py:attribute:: time .. py:method:: iteration(algo, model, data) 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** : :class:`~leaspy.algo.fit.FitAlgo` A fitting algorithm. **model** : :class:`~leaspy.models.McmcSaemCompatibleModel` The model used by the computation. **data** : :class:`.Dataset` The data used by the computation .. !! processed by numpydoc !! .. py:method:: print_time() Prints the duration since the last periodic point. .. !! processed by numpydoc !! .. py:method:: print_model_statistics(model) Prints model's statistics. :Parameters: **model** : :class:`~leaspy.models.McmcSaemCompatibleModel` The model used by the computation .. !! processed by numpydoc !! .. py:method:: print_algo_statistics(algo) Prints algorithm's statistics :Parameters: **algo** : :class:`~leaspy.algo.fit.FitAlgo` A fitting algorithm. .. !! processed by numpydoc !! .. py:method:: save_model_parameters_convergence(iteration, model) Saves the current state of the model's parameters :Parameters: **iteration** : :obj:`int` The current iteration. **model** : :class:`~.models.abstract_model.McmcSaemCompatibleModel` The model used by the computation .. !! processed by numpydoc !! .. py:method:: save_plot_convergence_model_parameters(model) Saves figures of the model parameters' convergence in multiple pages of a PDF. :Parameters: **model** : :class:`~leaspy.models.McmcSaemCompatibleModel` The model used by the computation .. !! processed by numpydoc !! .. py:method:: save_plot_patient_reconstructions(iteration, model, data) Saves figures of real longitudinal values and their reconstructions computed by the model for maximum 5 patients during each iteration. :Parameters: **iteration** : :obj:`int` The current iteration **model** : :class:`~leaspy.models.McmcSaemCompatibleModel` The model used by the computation **data** : :class:`~leaspy.io.data.Dataset` The dataset used by the computation .. !! processed by numpydoc !!