Skip to content

Commit 9824cf2

Browse files
author
[zebinyang]
committed
add feature importance for each SIM; get_projection_equation; add get_feature_importance; add get_projection_index; update visualize_one_leaf; add update version 0.1.5
1 parent b8e36b8 commit 9824cf2

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

examples/demo.ipynb

Lines changed: 31 additions & 3 deletions
Large diffs are not rendered by default.

simtree/simtree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ def get_projection_equation(self, node_id, precision=3):
126126
est = self.leaf_estimators_[node_id]
127127
for i in range(est.beta_.shape[0]):
128128
if i == 0:
129-
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + clf.feature_names[sortind[i]]
129+
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + self.feature_names[sortind[i]]
130130
continue
131131
else:
132132
if est.beta_[sortind[i], 0] > 0:
133133
equation += " + "
134134
else:
135135
equation += " - "
136-
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + clf.feature_names[sortind[i]]
136+
equation += str(round(np.abs(est.beta_[sortind[i], 0]), 3)) + self.feature_names[sortind[i]]
137137
return equation
138138

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

0 commit comments

Comments
 (0)