diff --git a/bayesian_decision_tree/base_hyperplane.py b/bayesian_decision_tree/base_hyperplane.py index 27e0f1d..e9d8c1b 100644 --- a/bayesian_decision_tree/base_hyperplane.py +++ b/bayesian_decision_tree/base_hyperplane.py @@ -174,7 +174,7 @@ def _str(self, anchor, VERT_RIGHT, DOWN_RIGHT, BAR, GEQ, is_back_child): if self.is_leaf(): s += 'y={}, n={}'.format(self._predict_leaf(), self.n_data_) if not self.is_regression: - s += ', p(y)={}'.format(self._compute_posterior_mean()) + s += ', p(y)={}'.format(np.round(self._compute_posterior_mean(), decimals=3)) else: s += 'HP(origin={}, normal={})'.format(self.best_hyperplane_origin_, self.best_hyperplane_normal_) diff --git a/bayesian_decision_tree/base_perpendicular.py b/bayesian_decision_tree/base_perpendicular.py index 84a8b7f..8edcfda 100644 --- a/bayesian_decision_tree/base_perpendicular.py +++ b/bayesian_decision_tree/base_perpendicular.py @@ -237,7 +237,7 @@ def _str(self, anchor, parent_split_value, VERT_RIGHT, DOWN_RIGHT, BAR, GEQ, is_ if self.is_leaf(): s += 'y={}, n={}'.format(self._predict_leaf(), self.n_data_) if not self.is_regression: - s += ', p(y)={}'.format(self._compute_posterior_mean()) + s += ', p(y)={}'.format(np.round(self._compute_posterior_mean(), decimals=3)) else: s += '{}={}'.format(self.split_feature_name_, self.split_value_)