Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Recommendation Engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
URBANITE
Open
Recommendation Engine
Commits
c75e173e
Commit
c75e173e
authored
2 years ago
by
Campos Airas, Daniel
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] added code changes
parent
5c08b1a9
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+2
-1
2 additions, 1 deletion
README.md
app.py
+11
-0
11 additions, 0 deletions
app.py
model.pkcls
+0
-0
0 additions, 0 deletions
model.pkcls
requirements.txt
+110
-5
110 additions, 5 deletions
requirements.txt
src/app.py
+120
-2
120 additions, 2 deletions
src/app.py
with
243 additions
and
8 deletions
README.md
+
2
−
1
View file @
c75e173e
# Recommendation Engine - Alternative
# Recommendation Engine - Alternative
INSTALL
python -m pip install --index-url https://support.bayesfusion.com/pysmile-B/ pysmile
## Getting started
## Getting started
...
...
This diff is collapsed.
Click to expand it.
app.py
+
11
−
0
View file @
c75e173e
...
@@ -219,6 +219,17 @@ def planner_plan_detail():
...
@@ -219,6 +219,17 @@ def planner_plan_detail():
"""
"""
return
planner
.
planner_plan_detail
(
cnx
,
request
)
return
planner
.
planner_plan_detail
(
cnx
,
request
)
@app.get
(
"
/database/store/kpi
"
)
def
database_store_kpi
():
"""
It stores the Kpis that have been selected.
The json provided should have the same format that json with the kpi
"""
#if request.json:
if
request
:
return
database
.
database_store_kpi
(
cnx
,
request
)
else
:
return
constants
.
ERROR_JSON_NEEDED
# MAIN: ----------------------------------------------------------------------------------------------------------------
# MAIN: ----------------------------------------------------------------------------------------------------------------
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
model.pkcls
0 → 100644
+
0
−
0
View file @
c75e173e
File added
This diff is collapsed.
Click to expand it.
requirements.txt
+
110
−
5
View file @
c75e173e
mysql-connector-python
~=8.0.31
anyio
==3.6.2
Flask
~=2.2.2
AnyQt
==0.2.0
asttokens
==2.2.1
backcall
==0.2.0
baycomp
==1.0.2
Bottleneck
==1.3.7
CacheControl
==0.12.12
certifi
==2022.12.7
cffi
==1.15.1
chardet
==5.1.0
charset-normalizer
==3.0.1
click
==8.1.3
comm
==0.1.2
commonmark
==0.9.1
contourpy
==1.0.7
cryptography
==39.0.2
cycler
==0.11.0
debugpy
==1.6.6
decorator
==5.1.1
dictdiffer
==0.9.0
docopt
==0.6.2
docutils
==0.19
et-xmlfile
==1.1.0
executing
==1.2.0
filelock
==3.9.0
Flask
==2.2.3
fonttools
==4.39.0
h11
==0.14.0
httpcore
==0.16.3
httpx
==0.23.3
idna
==3.4
importlib-metadata
==6.0.0
importlib-resources
==5.12.0
ipykernel
==6.21.3
ipython
==8.11.0
ipython-genutils
==0.2.0
itsdangerous
==2.1.2
jaraco.classes
==3.2.3
jedi
==0.18.2
jeepney
==0.8.0
Jinja2
==3.1.2
joblib
==1.2.0
jupyter_client
==8.0.3
jupyter_core
==5.2.0
keyring
==23.13.1
keyrings.alt
==4.2.0
kiwisolver
==1.4.4
MarkupSafe
==2.1.2
matplotlib
==3.7.1
matplotlib-inline
==0.1.6
more-itertools
==9.1.0
msgpack
==1.0.5
mysql-connector-python
~=8.0.32
nest-asyncio
==1.5.6
networkx
==3.0
numpy
~=1.23.5
numpy
~=1.23.5
requests
~=2.28.1
openpyxl
==3.1.2
pandas
~=1.5.1
openTSNE
==0.7.1
utm
~=0.7.0
orange-canvas-core
==0.1.29
\ No newline at end of file
orange-widget-base
==4.19.0
Orange3
==3.34.1
packaging
==23.0
pandas
==1.5.3
parso
==0.8.3
pexpect
==4.8.0
pickleshare
==0.7.5
Pillow
==9.4.0
pipreqs
==0.4.11
platformdirs
==3.1.1
prompt-toolkit
==3.0.38
protobuf
==3.20.3
psutil
==5.9.4
ptyprocess
==0.7.0
pure-eval
==0.2.2
pycparser
==2.21
Pygments
==2.14.0
pyparsing
==3.0.9
pyqtgraph
==0.13.2
pysmile
==2.0.10
python-dateutil
==2.8.2
python-louvain
==0.16
pytz
==2022.7.1
pywin32
==305
pywin32-ctypes
==0.2.0
PyYAML
==6.0
pyzmq
==25.0.0
qasync
==0.23.0
qtconsole
==5.4.1
QtPy
==2.3.0
requests
=2.28.2
rfc3986
==1.5.0
scikit-learn
==1.1.3
scipy
==1.10.1
SecretStorage
==3.3.3
serverfiles
==0.3.1
six
==1.16.0
sniffio
==1.3.0
stack-data
==0.6.2
threadpoolctl
==3.1.0
tornado
==6.2
traitlets
==5.9.0
typing_extensions
==4.5.0
urllib3
==1.26.14
utm
==0.7.0
wcwidth
==0.2.6
Werkzeug
==2.2.3
xlrd
==2.0.1
XlsxWriter
==3.0.9
xmltodict
==0.13.0
yarg
==0.1.9
zipp
==3.14.0
This diff is collapsed.
Click to expand it.
src/app.py
+
120
−
2
View file @
c75e173e
...
@@ -4,16 +4,19 @@
...
@@ -4,16 +4,19 @@
Created on: 16/01/2023
Created on: 16/01/2023
@author: Andoni Aranguren Ubierna
@author: Andoni Aranguren Ubierna
@updates: Sergio Campos 02-03/2023
@updates: Sergio Campos 02-03/2023
"""
"""
import
pickle
import
pysmile
import
sys
import
sys
import
json
print
(
sys
.
path
)
print
(
sys
.
path
)
from
src
import
constants
from
src
import
constants
import
mysql.connector
import
mysql.connector
from
flask
import
Flask
,
request
,
render_template
from
flask
import
Flask
,
request
,
render_template
from
src
import
recommender
,
database
,
planner
,
modal_choice
from
src
import
configuration
,
recommender
,
database
,
planner
,
modal_choice
app
=
Flask
(
__name__
)
app
=
Flask
(
__name__
)
cnx
=
None
cnx
=
None
...
@@ -24,6 +27,111 @@ def index():
...
@@ -24,6 +27,111 @@ def index():
return
render_template
(
"
index.html
"
)
return
render_template
(
"
index.html
"
)
# MODAL CHOICE: -------------------------------------------------------------------------------------------------------
@app.get
(
"
/modal_choice/estimation
"
)
def
modal_choice_estimation
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_estimation
(
cnx
,
request
)
@app.get
(
"
/modal_choice/getProbabilites
"
)
def
modal_choice_getprobabilities
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_getprobabilities
(
cnx
,
request
)
@app.get
(
"
/modal_choice/setProbabilites
"
)
def
modal_choice_setprobabilities
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_setprobabilities
(
cnx
,
request
)
@app.get
(
"
/modal_choice/getDependencies
"
)
def
modal_choice_getdependencies
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_getdependencies
(
cnx
,
request
)
@app.get
(
"
/modal_choice/getValues
"
)
def
modal_choice_getvalues
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
modal_choice
.
modal_choice_getvalues
(
cnx
,
request
)
#Dexi configuration: -------------------------------------------------------------------------------------------------
@app.get
(
"
/recommender/configuration/getMatrix
"
)
def
configuration_getmatrix
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
getmatrix
(
cnx
,
request
)
@app.get
(
"
/recommender/configuration/setMatrix
"
)
def
configuration_setmatrix
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
setmatrix
(
cnx
,
request
)
@app.get
(
"
/recommender/configuration/getSliders
"
)
def
configuration_getsliders
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
getsliders
(
cnx
,
request
)
@app.get
(
"
/recommender/configuration/setSliders
"
)
def
configuration_setsliders
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
setsliders
(
cnx
,
request
)
@app.get
(
"
/recommender/configuration/getEvaluationFile
"
)
def
configuration_getevaluationfile
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
getevaluationfile
(
cnx
,
request
)
@app.get
(
"
/recommender/configuration/getConfigurationFile
"
)
def
configuration_getconfigurationfile
():
"""
We ask for actions based on popularity of the actions
:return: json
"""
return
configuration
.
getconfigurationfile
(
cnx
,
request
)
# RECOMMENDERS: -------------------------------------------------------------------------------------------------------
# RECOMMENDERS: -------------------------------------------------------------------------------------------------------
@app.get
(
"
/recommender/popularity
"
)
@app.get
(
"
/recommender/popularity
"
)
def
recommender_popularity
():
def
recommender_popularity
():
...
@@ -101,6 +209,15 @@ def database_save_plan():
...
@@ -101,6 +209,15 @@ def database_save_plan():
else
:
else
:
return
constants
.
ERROR_JSON_NEEDED
return
constants
.
ERROR_JSON_NEEDED
# plan_detail PLANNER: -------------------------------------------------------------------------------------------------------
@app.get
(
"
/planner/plan_detail
"
)
def
planner_plan_detail
():
"""
It calculates the best plan_detail traversing streets and reordering the intermediate nodes provided.
:return: json with the plan_detail
"""
return
planner
.
planner_plan_detail
(
cnx
,
request
)
@app.get
(
"
/database/store/kpi
"
)
@app.get
(
"
/database/store/kpi
"
)
def
database_store_kpi
():
def
database_store_kpi
():
"""
"""
...
@@ -125,5 +242,6 @@ def planner_plan_detail():
...
@@ -125,5 +242,6 @@ def planner_plan_detail():
# MAIN: ----------------------------------------------------------------------------------------------------------------
# MAIN: ----------------------------------------------------------------------------------------------------------------
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
model
=
pickle
.
load
(
open
(
'
model.pkcls
'
,
'
rb
'
))
cnx
=
mysql
.
connector
.
connect
(
**
constants
.
DDBB_CONFIG
)
cnx
=
mysql
.
connector
.
connect
(
**
constants
.
DDBB_CONFIG
)
app
.
run
(
debug
=
True
,
host
=
'
0.0.0.0
'
)
app
.
run
(
debug
=
True
,
host
=
'
0.0.0.0
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment