          logger.debug("Inserting treeview data")
          self.tree.configure(height=len(sessions_summary))
  
          for item in sessions_summary:
              values = [item[column] for column in self.columns]
              kwargs = {"values": values}
              if self.check_valid_data(values):
                  # Don't show graph icon for non-existent sessions
                  kwargs["image"] = get_images().icons["graph"]
              if values[0] == "Total":
 
</s> remove             if self.check_valid_data(values):
 </s> add             if self._check_valid_data(values): </s> remove         self.tree.configure(height=len(sessions_summary))
 </s> add         self._tree.configure(height=len(sessions_summary)) </s> remove             self.tree.insert("", "end", **kwargs)
 </s> add             self._tree.insert("", "end", **kwargs) </s> remove         """ Insert the data into the totals tree-view """
 </s> add         """ Insert the summary data into the statistics tree-view.

        Parameters
        ----------
        sessions_summary: list
            List of session summary dicts for populating into the tree-view
        """ </s> remove             self.selected_id.set(values[0])
            if region == "tree" and self.check_valid_data(values):
                datapoints = int(values[self.columns.index("iterations")])
                self.data_popup(datapoints)

    def check_valid_data(self, values):
        """ Check there is valid data available for popping up a graph """
        col_indices = [self.columns.index("batch"), self.columns.index("iterations")]
 </s> add             self._selected_id.set(values[0])
            if region == "tree" and self._check_valid_data(values):
                data_points = int(values[self._columns.index("iterations")])
                self._data_popup(data_points)

    def _check_valid_data(self, values):
        """ Check there is valid data available for popping up a graph.

        Parameters
        ----------
        values: list
            The values that exist for a single session that are to be validated
        """
        col_indices = [self._columns.index("batch"), self._columns.index("iterations")]
            values = [item[column] for column in self._columns]
          logger.debug("Inserting treeview data")
          self.tree.configure(height=len(sessions_summary))
  
          for item in sessions_summary:
            values = [item[column] for column in self._columns]
              kwargs = {"values": values}
              if self.check_valid_data(values):
                  # Don't show graph icon for non-existent sessions
                  kwargs["image"] = get_images().icons["graph"]
              if values[0] == "Total":
keep keep keep keep replace keep keep keep keep keep
 GUI - Stats optimization (#1067)

* Faster stat loading + caching

* Compress data in cache

* Optimize some calculations

* Vectorize smoothing

* stats.Calculations optimized

* Load latest training data from live iterator

* Add options to training graph 
lib/gui/display_analysis.py