lib/eps/lightgbm.rb in eps-0.3.6 vs lib/eps/lightgbm.rb in eps-0.3.7
- old
+ new
@@ -8,10 +8,10 @@
total = importance.sum.to_f
if total == 0
str << "Model needs more data for better predictions\n"
else
str << "Most important features\n"
- @importance_keys.zip(importance).sort_by { |k, v| [-v, k] }.first(10).each do |k, v|
+ @importance_keys.zip(importance).sort_by { |k, v| [-v, display_field(k)] }.first(10).each do |k, v|
str << "#{display_field(k)}: #{(100 * v / total).round}\n"
end
end
str
end