pyplt.gui.experiment package

Submodules

pyplt.gui.experiment.progresswindow module

class pyplt.gui.experiment.progresswindow.ProgressWindow(parent_window, q, exec_stopper)

Bases: tkinter.Toplevel

Window widget displaying the execution progress of an experiment via a progress bar and progress log.

Extends the class tkinter.Toplevel.

Initializes the ProgressWindow widget object.

Parameters:
  • parent_window (tkinter.Toplevel) – the window which this window widget will be stacked on top of.
  • q (queue.Queue) – the queue to be used for communication between the thread (threading.Thread) carrying out the execution of the experiment and the progress log (tkinter.Listbox) of this class.
  • exec_stopper (pyplt.util.AbortFlag) – an abort flag object used to abort the execution before completion if so instructed by the user.
done(experiment, time_info, data_info, preproc_info, fs_info, fs_algo_info, fs_eval_info, pl_algo_info, pl_eval_info, eval_metrics, fold_metrics, shuffle_info)

Update the ProgressWindow widget on completion of experiment execution.

Add a ‘Success’ label, adds a ‘Generate Report’ button (to open or re-open the results window), and converts the ‘Abort’ button into a ‘Close’ button. The window (pyplt.gui.experiment.results.resultsscreen.ResultsWindow) containing the experiment details and results is opened automatically.

Parameters:
  • experiment (pyplt.experiment.Experiment) – the experiment to be passed on to the results window.
  • time_info (list of float (size 3)) – the time meta-data to be passed on to the results window in the form of a list containing the start timestamp (UTC), end timestamp (UTC), and duration of the experiment.
  • data_info (list (size 3)) – the data to be passed on to the results window in the form of a list containing the number of objects, the number of ranks, and the list of data file paths.
  • preproc_info (list of dict (size 2)) – the pre-processing information to be passed on to the results window in the form of a list containing the include settings dict and the normalization settings dict.
  • fs_info (list (size 3)) – feature selection method information to be passed on to the results window (if applicable) in the form of a list containing the chosen feature selection method type (pyplt.util.enums.FSMethod), the string representation of its parameters, and the list of features selected by the feature selection method.
  • fs_algo_info (list (size 2)) – the feature selection algorithm information to be passed on to the results window (if applicable) in the form of a list containing the chosen algorithm type (pyplt.util.enums.PLAlgo) and the string representation of its parameters.
  • fs_eval_info (list (size 2)) – the feature selection evaluation method information to be passed on to the results window (if applicable) in the form of a list containing the evaluation method type (pyplt.util.enums.EvaluatorType) and the string representation of its parameters.
  • pl_algo_info (list (size 2)) – the preference learning algorithm information to be passed on to the results window in the form of a list containing the algorithm type (pyplt.util.enums.PLAlgo) and the string representation of its parameters.
  • pl_eval_info (list (size 2)) – the evaluation method information to be passed on to the results window (if applicable) in the form of a list containing the evaluation method type (pyplt.util.enums.EvaluatorType) and the string representation of its parameters.
  • eval_metrics (dict) –

    the evaluation/training results to be passed on to the results window in the form of a dict with keys:

    • Training Accuracy
    • Test Accuracy’ (if applicable)
  • fold_metrics (list of tuple, optional) –

    optional fold-specific information (default None) in the form of list of tuples, each containing the start timestamp, end timestamp, evaluation metrics, and a pandas.DataFrame representation of the trained model as follows:

    • start_time – datetime timestamp (UTC timezone)
    • end_time – datetime timestamp (UTC timezone)
    • eval_metrics – dict with keys:
      • Training Accuracy
      • Test Accuracy’ (if applicable)
    • model – pandas.DataFrame
  • shuffle_info (list (size 2)) –

    list containing the chosen settings related to shuffling the dataset:

    • shuffle – bool specifying whether or not the dataset was shuffled at the start of the experiment execution.
    • random_seed – optional seed (int or None) used to shuffle the dataset.
log(event)

Display the given string at the end of the progress log (tkinter.Listbox object).

Parameters:event (str) – the string to be displayed in the progress log.
progress()

Increment the progress bar (ttk.Progressbar object).

put(item)

Add a given string item to the queue to be in turn displayed in the progress log.

Parameters:item (str) – a string to be added to the queue and therefore displayed in the progress log.
set_exec_thread(thread)

Set the execution thread variable.

update_gui()

Update the GUI.

Hack-y method called while pyplt.plalgorithms.ranksvm.RankSVM precomputes kernels from the experiment execution thread to keep the GUI (main) thread going.

The method also sets the flag variable self._wait to True immediately before calling self.update_idletasks() and sets it back to False immediately after. This is done in order to avoid a deadlock between threads when aborting experiment execution.

pyplt.gui.experiment.singleexperimentwindow module

class pyplt.gui.experiment.singleexperimentwindow.SingleExperimentWindow(parent)

Bases: tkinter.Toplevel

GUI window for setting up and running a single experiment.

Extends the class tkinter.Toplevel. Each experiment stage is encapsulated in a separate tab, together comprising a ttk.Notebook widget which is controlled by this class. This class also manages the state of the tabs (locked/unlocked) as well as the flow of data between the tabs.

Initializes the ttk.Notebook widget in the given window.

The ttk.Notebook widget is populated with tabs defined by the classes pyplt.gui.experiment.dataset.loading.DataLoadingTab, pyplt.gui.experiment.preprocessing.preproctab.PreProcessingTab, pyplt.gui.experiment.featureselection.featselectiontab.FeatureSelectionTab, and pyplt.gui.experiment.preflearning.pltab.PLTab.

Parameters:parent (tkinter.Toplevel) – the parent window on which this experiment setup window will be stacked.

Module contents

The subpackages and submodules of this package manage the various GUI stages of experiment setup and execution.