Advertisement
Guest User

hasil

a guest
Aug 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @app.route("/hasil")
  2. def hasil():
  3. trainNew = test_pd
  4. trainNew = gab
  5. trainNew = trainNew.drop("index", axis=1)
  6. label = test_pd['Label']
  7. pos = label[label=='pos']
  8. neg = label[label=='neg']
  9. jml_pos = pos.count()
  10. jml_neg = pos.count()
  11. jml_label = label.count()
  12. persen_pos = str(round((jml_pos/jml_label)*100,2))
  13. persen_neg = str(round((jml_neg/jml_label)*100,2))
  14. labels = ["Positif","Negative"]
  15. data = [jml_pos,jml_neg]
  16. colors = [ "#00a65a", "#dd4b39"]
  17.  
  18. return render_template('hasil.html', tables=[trainNew.to_html(classes='table table-striped table-bordered table-hover',header='true',justify='justify',table_id='tabel')],set=zip(data, labels, colors))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement