Beispiel #1
0
 def _fetch_data(self, change):
     if not self.config:
         return
     with self.out:
         self.visualizer._update_config(self.config)
         self.output = namedtuple_to_dict(self.visualizer.visualize())
         self.config = dict()
Beispiel #2
0
 def _fetch_attribution(self, change):
     if not self.label_details:
         return
     with self.out:
         self.attribution = namedtuple_to_dict(
             self.visualizer._calculate_attribution_from_cache(
                 self.label_details["instance"],
                 self.label_details["labelIndex"]))
         self.label_details = dict()
Beispiel #3
0
 def get_insights_config(self):
     return {
         "classes":
         self.classes,
         "methods":
         list(ATTRIBUTION_NAMES_TO_METHODS.keys()),
         "method_arguments":
         namedtuple_to_dict(
             {k: v.params
              for (k, v) in ATTRIBUTION_METHOD_CONFIG.items()}),
         "selected_method":
         self._config.attribution_method,
     }