提交 a86da1c5 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!78 atune: the importance of the parameters is displayed in percentage.

Merge pull request !78 from hanxinke/test_master
......@@ -106,8 +106,12 @@ class Optimizer(Process):
lasso = Lasso()
lasso.fit(options, performance)
result = zip(lasso.coef_, labels)
total_sum = sum(map(abs, lasso.coef_))
if total_sum == 0:
return ", ".join("%s: 0" % label for label in labels)
result = sorted(result, key=lambda x: -np.abs(x[0]))
rank = ", ".join("%s: %s" % (label, round(coef, 3)) for coef, label in result)
rank = ", ".join("%s: %s%%" % (label, round(coef * 100 / total_sum, 2))
for coef, label in result)
return rank
def run(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册