tedgwara commited on
Commit
69d6639
·
1 Parent(s): 534b663

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -13
app.py CHANGED
@@ -80,21 +80,13 @@ y_pred = model.predict(x_test)
80
 
81
  def get_feats():
82
  feats = [abs(x) for x in model.coef_[0]]
83
- feats, cols = zip(*sorted(zip(feats, data.columns)))
84
-
85
- output = []
86
-
87
- for idx, col in enumerate(reversed(cols)):
88
- output.append(col)
89
-
90
- # max_val = max(feats)
91
- # idx = feats.index(max_val)
92
- # return data.columns[idx]
93
- return output
94
 
95
  acc = str(round(metrics.accuracy_score(y_test, y_pred) * 100, 2)) + '%'
96
- feats = get_feats()
97
- info = get_article(acc, feats)
98
 
99
 
100
 
 
80
 
81
  def get_feats():
82
  feats = [abs(x) for x in model.coef_[0]]
83
+ max_val = max(feats)
84
+ idx = feats.index(max_val)
85
+ return data.columns[idx]
 
 
 
 
 
 
 
 
86
 
87
  acc = str(round(metrics.accuracy_score(y_test, y_pred) * 100, 2)) + '%'
88
+ feat = get_feat()
89
+ info = get_article(acc, feat)
90
 
91
 
92