max_mean = np.max(self.tree.instances.Y)
instances = self.tree.get_instances_in_nodes(self.label)
mean = np.mean(instances.Y)
return self.color_palette[(mean - min_mean) / (max_mean - min_mean)]
def _color_var(self):
Color the nodes with respect to the variance of instances inside.
min_std, max_std = 0, np.std(self.tree.instances.Y)
After Change
def _color_mean(self):
Color the nodes with respect to the mean of instances inside.
min_mean = np.min(self.tree.instances.Y)
max_mean = np.max(self.tree.instances.Y)
instances = self.tree.get_instances_in_nodes(self.label)
mean = np.mean(instances.Y)
return self.color_palette.value_to_qcolor(
mean, low=min_mean, high=max_mean)
def _color_var(self):
Color the nodes with respect to the variance of instances inside.
min_std, max_std = 0, np.std(self.tree.instances.Y)