Skip to content

Commit 372e1f8

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 c086d3c commit 372e1f8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

simtree/simtree.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ def get_projection_equation(self, node_id, precision=3):
159159
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + self.feature_names[sortind[i]]
160160
continue
161161
else:
162-
if est.beta_[sortind[i], 0] > 0:
163-
equation += " + "
164-
else:
165-
equation += " - "
166-
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + self.feature_names[sortind[i]]
162+
if np.abs(est.beta_[sortind[i], 0]) > 0:
163+
if est.beta_[sortind[i], 0] > 0:
164+
equation += " + "
165+
else:
166+
equation += " - "
167+
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + self.feature_names[sortind[i]]
167168
return equation
168169

169170
def get_sparsity(self, node_id):

0 commit comments

Comments
 (0)