Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pros #3

Draft
wants to merge 36 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
581a961
Delete notebooks directory
Omaraitbenhaddi Oct 21, 2022
9824501
Delete models directory
Omaraitbenhaddi Oct 21, 2022
04840ff
Delete images directory
Omaraitbenhaddi Oct 21, 2022
9c538ac
Delete hmodule directory
Omaraitbenhaddi Oct 21, 2022
d061893
Delete helpers directory
Omaraitbenhaddi Oct 21, 2022
542f37a
Delete front directory
Omaraitbenhaddi Oct 21, 2022
2fc1e7f
Delete license
Omaraitbenhaddi Oct 21, 2022
d4c0b9b
Delete Fonctionnelles.html
Omaraitbenhaddi Oct 21, 2022
199742f
Delete meta_ODC_FIFA2022.odc
Omaraitbenhaddi Oct 21, 2022
3391d62
setup envirenement de deploiyement
Omaraitbenhaddi Oct 21, 2022
608d89e
mise en place d'architecture de heroku
Omaraitbenhaddi Oct 21, 2022
4ea52e9
enable mode debug
Omaraitbenhaddi Oct 21, 2022
3044e05
add Procfile
Omaraitbenhaddi Oct 21, 2022
815eb46
mode debug en True
Omaraitbenhaddi Oct 21, 2022
82b2c73
update proc file
Omaraitbenhaddi Oct 21, 2022
77180a3
Procfile
Omaraitbenhaddi Oct 21, 2022
c1d15df
procfile update
Omaraitbenhaddi Oct 21, 2022
94e5721
add gunicorn en requirements
Omaraitbenhaddi Oct 21, 2022
ac3b861
host 0.0.0.0
Omaraitbenhaddi Oct 21, 2022
371290b
procfile emplacement
Omaraitbenhaddi Oct 21, 2022
c125e68
emplacement
Omaraitbenhaddi Oct 21, 2022
0c4caab
Update layout.html
Omaraitbenhaddi Oct 23, 2022
2194235
Create style.css
Omaraitbenhaddi Oct 23, 2022
c2a6b08
responsive desing
Omaraitbenhaddi Oct 23, 2022
eac432c
resonsive
Omaraitbenhaddi Oct 23, 2022
edd586a
Update requirements.txt
Omaraitbenhaddi Oct 23, 2022
41306bd
augmenter la taille de select
Omaraitbenhaddi Oct 23, 2022
ffd91e6
Merge branch 'pros' of https://github.com/Omaraitbenhaddi/ODC-World-C…
Omaraitbenhaddi Oct 23, 2022
ec8c4a5
comptibilite en device moins de 1000 px
Omaraitbenhaddi Oct 23, 2022
15403ce
ordonner la liste des equipes et filtrer les equipes
Omaraitbenhaddi Oct 24, 2022
9d0e4f7
rename requirements.txt
Omaraitbenhaddi Oct 24, 2022
a3f6ad7
fix bug south korea
Omaraitbenhaddi Oct 24, 2022
0fc2341
fix bugs Iran Name
Omaraitbenhaddi Oct 24, 2022
6559569
ajouter la fonctionalites d'avoir la probabilite de chaque etat du match
Omaraitbenhaddi Nov 19, 2022
0694fdf
Update acceuil.html
Omaraitbenhaddi Nov 19, 2022
e7ea458
Update acceuil.html
Omaraitbenhaddi Nov 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Fonctionnelles.html

This file was deleted.

Binary file not shown.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn app:app
49 changes: 0 additions & 49 deletions WebFlask/app.py

This file was deleted.

34 changes: 0 additions & 34 deletions WebFlask/templates/home.html

This file was deleted.

Binary file added __pycache__/app.cpython-310.pyc
Binary file not shown.
Binary file not shown.
80 changes: 80 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
from flask import Flask, render_template
import os
import hmodule as hmodule
from wtforms import Form, StringField,SubmitField,SelectField
from flask_wtf import FlaskForm
import pickle
import numpy as np
import joblib
meta = joblib.load('MetaModelFifa_predictors.mdl')
meta['country'].sort()
app = Flask(__name__)
app.secret_key = os.urandom(24)

class Form(FlaskForm):
home_team = SelectField('home_team', choices=meta['country'])
away_team = SelectField('away_team', choices=meta['country'])
submit = SubmitField("submit")



@app.route('/',methods=['GET', 'POST'])
def index():
fname = None
lname = None
winner=None

return render_template('acceuil.html',fname=fname,lname=lname)


@app.route('/winner',methods=['GET', 'POST'])
def winner():
fname = None
lname = None
winner=None
form = Form()
if form.validate_on_submit():
home_team=form.home_team.data
away_team=form.away_team.data
pred=hmodule.get_winner(home_team,away_team,meta['model'],meta['predictors'],meta['xcols'])
if home_team==away_team:
return render_template('MemeEquipe.html',)
if pred==away_team:
winner=away_team
return render_template('winner.html',winner=winner,)

elif pred=='draw':
winner = "NO winner results is draw"
return render_template('winner.html',winner=winner,)

else:
winner=home_team
return render_template('winner.html',winner=winner)
return render_template('home.html',fname=fname,lname=lname,form=form)



@app.route('/proba',methods=['GET', 'POST'])
def proba():
fname = None
lname = None
form = Form()
if form.validate_on_submit():
home_team=form.home_team.data
away_team=form.away_team.data
pred=hmodule.get_match_proba(home_team,away_team,meta['model'],meta['predictors'],meta['xcols'])
print(home_team)
print(away_team)
if home_team==away_team:
return render_template('MemeEquipe.html')


else:
return render_template('match_proba.html',home=str(pred[home_team]*100)[0:5]+"%",draw=str(pred['draw']*100)[0:5]+"%",away=str(pred[away_team]*100)[0:5]+"%",home_team=home_team,away_team=away_team)
return render_template('home.html',fname=fname,lname=lname,form=form)



if __name__ == '__main__':
app.run(debug=False,host='0.0.0.0')

File renamed without changes.
74 changes: 0 additions & 74 deletions front/projet.html

This file was deleted.

84 changes: 0 additions & 84 deletions front/style.css

This file was deleted.

Loading