Skip to content

Commit b2b9e0a

Browse files
author
[zebinyang]
committed
for a fair comparison, adjust roughness by map x to be within [0, 1]; version 0.1.8
1 parent 372e1f8 commit b2b9e0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simtree/simtree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def get_roughness(self, node_id, grid_size=100):
215215
est = self.leaf_estimators_[node_id]
216216
adj = (est.shape_fit_.xmax - est.shape_fit_.xmin) ** 2
217217
xgrid = np.linspace(est.shape_fit_.xmin, est.shape_fit_.xmax, grid_size + 2)[1:-1]
218-
roughness = np.sqrt(np.mean([(est.shape_fit_.diff(x, order=2) * adj) ** 2 for x in xgrid]))
218+
roughness = adj * np.sqrt(np.mean([(est.shape_fit_.diff(x, order=2)) ** 2 for x in xgrid]))
219219
return roughness
220220

221221
def visualize_one_leaf(self, node_id, folder="./results/", name="leaf_sim", save_png=False, save_eps=False):

0 commit comments

Comments
 (0)