dinisdcosta commited on
Commit
a729a18
·
1 Parent(s): 21736ea

dina dinamico filter

Browse files
app/.DS_Store CHANGED
Binary files a/app/.DS_Store and b/app/.DS_Store differ
 
app/app.py CHANGED
@@ -25,7 +25,15 @@ server = app.server
25
 
26
  wine_similarity_df = pd.read_csv('data/wine_similarity.csv')
27
  wine_list = wine_similarity_df['NAME'].unique()
 
 
 
 
28
 
 
 
 
 
29
 
30
 
31
  ## Layout ##
@@ -34,8 +42,10 @@ dashboard_layout = html.Div([
34
  dcc.Link('About this project', href='/wiki'),
35
 
36
  dcc.Graph(id='graph-content'),
37
-
38
-
 
 
39
  dcc.Graph(id='world-map-fig'),
40
 
41
  html.H1(children='Wine Recommender', style={'textAlign':'center'}),
@@ -44,8 +54,15 @@ dashboard_layout = html.Div([
44
  ])
45
 
46
 
47
-
48
-
 
 
 
 
 
 
 
49
 
50
 
51
  wiki_layout = html.Div([
@@ -94,9 +111,11 @@ def display_page(pathname):
94
  Output('graph-content', 'figure'),
95
  Output('wine-recommendation', 'children'),
96
  Output('world-map-fig', 'figure'),
97
- Input('dropdown-selection', 'value')
 
 
98
  )
99
- def update_graph(value):
100
  ### Wine Recommendation ###
101
  recommended_wines = None
102
  if value:
@@ -107,6 +126,11 @@ def update_graph(value):
107
  ### World Map of wineyards ###
108
 
109
  geo_df = pd.read_csv('data/processed_wineyards.csv')
 
 
 
 
 
110
 
111
 
112
  world_map_fig = px.scatter_map(geo_df,
 
25
 
26
  wine_similarity_df = pd.read_csv('data/wine_similarity.csv')
27
  wine_list = wine_similarity_df['NAME'].unique()
28
+ geo = pd.read_csv('data/processed_wineyards.csv')
29
+ wine_regions=list(geo['Region'].unique()) + ['all']
30
+ wine_country = list(geo['Country'].unique()) + ['all']
31
+ # local_type = list(geo['LOCAL TYPE'].unique()) + ['all']
32
 
33
+ # WT_GLOBAL = '*' if
34
+
35
+
36
+ # wine_country = geo['Country'].unique()
37
 
38
 
39
  ## Layout ##
 
42
  dcc.Link('About this project', href='/wiki'),
43
 
44
  dcc.Graph(id='graph-content'),
45
+ html.H1(children='Country', style={'textAlign':'center'}),
46
+ dcc.Dropdown(wine_country, wine_country[-1], id='dropdown-wc'),
47
+ html.H1(children='Region', style={'textAlign':'center'}),
48
+ dcc.Dropdown(['all'],'all', id='dropdown-wr'),
49
  dcc.Graph(id='world-map-fig'),
50
 
51
  html.H1(children='Wine Recommender', style={'textAlign':'center'}),
 
54
  ])
55
 
56
 
57
+ @app.callback(
58
+ Output('dropdown-wr', 'options'),
59
+ Input('dropdown-wc', 'value')
60
+ )
61
+ def set_wine_type_options(selected_wine_type):
62
+ # Return the options based on the selected wine country
63
+ pattern = r'.*' if selected_wine_type == 'all' else rf'{selected_wine_type}'
64
+ #selected_wine_type = r'*' if selected_wine_type == r'all' else selected_wine_type
65
+ return list(geo[geo['Country'].str.match(pattern, na=False)]['Region'].unique()) + ['all']
66
 
67
 
68
  wiki_layout = html.Div([
 
111
  Output('graph-content', 'figure'),
112
  Output('wine-recommendation', 'children'),
113
  Output('world-map-fig', 'figure'),
114
+ Input('dropdown-selection', 'value'),
115
+ Input('dropdown-wr', 'value'),
116
+ Input('dropdown-wc', 'value')
117
  )
118
+ def update_graph(value,wr,wc):
119
  ### Wine Recommendation ###
120
  recommended_wines = None
121
  if value:
 
126
  ### World Map of wineyards ###
127
 
128
  geo_df = pd.read_csv('data/processed_wineyards.csv')
129
+ wr = r'.*' if wr == 'all' else rf'{wr}'
130
+ #wr = r'*' if wr == 'all' else wr # wine region poiseu tbm tinha assim, mas agr tenho 2 filtros nao posos fazer infinitas condicoes assim ja sao 4, rota
131
+ #wc = r'*' if wc == 'all' else wc # wine country & geo_df['Country'].str.match(wc)
132
+ wc = r'.*' if wc == 'all' else rf'{wc}'
133
+ geo_df = geo_df[geo_df['Region'].str.contains(wr, case=False, na=False, regex=True) & geo_df['Country'].str.contains(wc, case=False, na=False, regex=True)]
134
 
135
 
136
  world_map_fig = px.scatter_map(geo_df,
app/core.py CHANGED
@@ -10,4 +10,13 @@ def get_top_5_similar_wines(wine_name: str, df: pd.DataFrame) -> pd.DataFrame:
10
  # Convert to list
11
  res = res["NAME"].values.tolist()
12
 
13
- return res
 
 
 
 
 
 
 
 
 
 
10
  # Convert to list
11
  res = res["NAME"].values.tolist()
12
 
13
+ return res
14
+
15
+ def recommend_wine(ratings_df, user, n=5):
16
+ user_cluster = ratings_df.loc[user, 'cluster']
17
+ user_ratings = ratings_df.loc[user].drop('cluster')
18
+ user_unrated = user_ratings[user_ratings == 0].index
19
+ cluster_users = ratings_df[ratings_df['cluster'] == user_cluster]
20
+ cluster_avg = cluster_users.mean().drop('cluster')
21
+ cluster_avg = cluster_avg[user_unrated]
22
+ return cluster_avg.sort_values(ascending=False).keys()[:n].tolist()
app/dashboard copy.ipynb ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "name": "stderr",
10
+ "output_type": "stream",
11
+ "text": [
12
+ "/Users/ddcosta/Documents/TDV/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020\n",
13
+ " warnings.warn(\n"
14
+ ]
15
+ },
16
+ {
17
+ "data": {
18
+ "text/html": [
19
+ "\n",
20
+ " <iframe\n",
21
+ " width=\"100%\"\n",
22
+ " height=\"650\"\n",
23
+ " src=\"http://0.0.0.0:8050/\"\n",
24
+ " frameborder=\"0\"\n",
25
+ " allowfullscreen\n",
26
+ " \n",
27
+ " ></iframe>\n",
28
+ " "
29
+ ],
30
+ "text/plain": [
31
+ "<IPython.lib.display.IFrame at 0x15619fbe0>"
32
+ ]
33
+ },
34
+ "metadata": {},
35
+ "output_type": "display_data"
36
+ }
37
+ ],
38
+ "source": [
39
+ "import os\n",
40
+ "import plotly.express as px\n",
41
+ "import plotly.graph_objects as go\n",
42
+ "import pandas as pd\n",
43
+ "from dash import Dash, html, dcc, Input, Output, callback\n",
44
+ "import plotly.express as px\n",
45
+ "import numpy as np\n",
46
+ "from plotly.subplots import make_subplots\n",
47
+ "import core\n",
48
+ "\n",
49
+ "df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder_unfiltered.csv')\n",
50
+ "debug = False\n",
51
+ "\n",
52
+ "external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n",
53
+ "\n",
54
+ "app = Dash(__name__, external_stylesheets=external_stylesheets)\n",
55
+ "\n",
56
+ "app.layout = html.Div([\n",
57
+ " dcc.Location(id='url', refresh=False),\n",
58
+ " html.Div(id='page-content')\n",
59
+ "])\n",
60
+ "\n",
61
+ "server = app.server\n",
62
+ "\n",
63
+ "\n",
64
+ "wine_similarity_df = pd.read_csv('data/wine_similarity.csv')\n",
65
+ "wine_list = wine_similarity_df['NAME'].unique()\n",
66
+ "geo = pd.read_csv('data/processed_wineyards.csv')\n",
67
+ "wine_regions=list(geo['Region'].unique()) + ['all']\n",
68
+ "wine_country = list(geo['Country'].unique()) + ['all']\n",
69
+ "# local_type = list(geo['LOCAL TYPE'].unique()) + ['all']\n",
70
+ "\n",
71
+ "# WT_GLOBAL = '*' if \n",
72
+ "\n",
73
+ "\n",
74
+ "# wine_country = geo['Country'].unique()\n",
75
+ "\n",
76
+ "\n",
77
+ "## Layout ##\n",
78
+ "\n",
79
+ "dashboard_layout = html.Div([\n",
80
+ " dcc.Link('About this project', href='/wiki'),\n",
81
+ "\n",
82
+ " dcc.Graph(id='graph-content'),\n",
83
+ " html.H1(children='Country', style={'textAlign':'center'}),\n",
84
+ " dcc.Dropdown(wine_country, wine_country[-1], id='dropdown-wc'),\n",
85
+ " html.H1(children='Region', style={'textAlign':'center'}),\n",
86
+ " dcc.Dropdown(['all'],'all', id='dropdown-wr'),\n",
87
+ " dcc.Graph(id='world-map-fig'),\n",
88
+ "\n",
89
+ " html.H1(children='Wine Recommender', style={'textAlign':'center'}),\n",
90
+ " dcc.Dropdown(wine_list, wine_list[0], id='dropdown-selection'),\n",
91
+ " html.Div(id='wine-recommendation', children=''),\n",
92
+ "])\n",
93
+ "\n",
94
+ "\n",
95
+ "@app.callback(\n",
96
+ " Output('dropdown-wr', 'options'),\n",
97
+ " Input('dropdown-wc', 'value')\n",
98
+ ")\n",
99
+ "def set_wine_type_options(selected_wine_type):\n",
100
+ " # Return the options based on the selected wine country\n",
101
+ " pattern = r'.*' if selected_wine_type == 'all' else rf'{selected_wine_type}'\n",
102
+ " #selected_wine_type = r'*' if selected_wine_type == r'all' else selected_wine_type\n",
103
+ " return list(geo[geo['Country'].str.match(pattern, na=False)]['Region'].unique()) + ['all']\n",
104
+ "\n",
105
+ "\n",
106
+ "wiki_layout = html.Div([\n",
107
+ " dcc.Link('Dashboard', href='/'),\n",
108
+ "\n",
109
+ " html.H1('About this project'),\n",
110
+ "\n",
111
+ " html.Div([\n",
112
+ " html.Div([\n",
113
+ "\n",
114
+ " html.H3('What is this project about?'),\n",
115
+ "\n",
116
+ " html.P('We are a group of 4 Computer Science Engineering Students with a solid Artificial Intelligence background.'),\n",
117
+ " html.P('This project aims to showcase AI applications for improving Wine Tourism for SOGRAPE.'),\n",
118
+ "\n",
119
+ "\n",
120
+ " html.H3('\\'Bout us'),\n",
121
+ " html.Img(src='/assets/tourdevino_logo.webp', style={'width': '40%', 'height': 'auto', 'display': 'block', 'margin-left': 'auto', 'margin-right': 'auto'}),\n",
122
+ " html.P('This project was developed by a team of 4, in the context of the SOGRAPE 2024 hackathon.'),\n",
123
+ " html.P('The team members are:'),\n",
124
+ " html.H4('Rui Melo'),\n",
125
+ " html.H4('André Catarino'),\n",
126
+ " html.H4('Dinis Costa'),\n",
127
+ " html.H4('Paulo Fidalgo'),\n",
128
+ "\n",
129
+ "\n",
130
+ " ], className='six columns'),], className='row'),\n",
131
+ "],\n",
132
+ "style={'background-color': '#333', 'font-family': 'Fantasy', 'color': '#999', 'padding': '10px'}\n",
133
+ "\n",
134
+ ")\n",
135
+ "\n",
136
+ "# Update the index\n",
137
+ "@callback(Output('page-content', 'children'), Input('url', 'pathname'))\n",
138
+ "def display_page(pathname):\n",
139
+ " if pathname == '/':\n",
140
+ " return dashboard_layout\n",
141
+ " elif pathname == '/wiki':\n",
142
+ " return wiki_layout\n",
143
+ " else:\n",
144
+ " return '404'\n",
145
+ " # You could also return a 404 \"URL not found\" page here\n",
146
+ "\n",
147
+ "\n",
148
+ "@app.callback(\n",
149
+ " Output('graph-content', 'figure'),\n",
150
+ " Output('wine-recommendation', 'children'),\n",
151
+ " Output('world-map-fig', 'figure'),\n",
152
+ " Input('dropdown-selection', 'value'),\n",
153
+ " Input('dropdown-wr', 'value'),\n",
154
+ " Input('dropdown-wc', 'value')\n",
155
+ ")\n",
156
+ "def update_graph(value,wr,wc):\n",
157
+ " ### Wine Recommendation ###\n",
158
+ " recommended_wines = None\n",
159
+ " if value:\n",
160
+ " recommended_wines = core.get_top_5_similar_wines(value, wine_similarity_df)[1:]\n",
161
+ " recommended_wines = \"; \".join(recommended_wines)\n",
162
+ "\n",
163
+ "\n",
164
+ " ### World Map of wineyards ###\n",
165
+ "\n",
166
+ " geo_df = pd.read_csv('data/processed_wineyards.csv')\n",
167
+ " wr = r'.*' if wr == 'all' else rf'{wr}'\n",
168
+ " #wr = r'*' if wr == 'all' else wr # wine region poiseu tbm tinha assim, mas agr tenho 2 filtros nao posos fazer infinitas condicoes assim ja sao 4, rota \n",
169
+ " #wc = r'*' if wc == 'all' else wc # wine country & geo_df['Country'].str.match(wc)\n",
170
+ " wc = r'.*' if wc == 'all' else rf'{wc}'\n",
171
+ " geo_df = geo_df[geo_df['Region'].str.contains(wr, case=False, na=False, regex=True) & geo_df['Country'].str.contains(wc, case=False, na=False, regex=True)]\n",
172
+ "\n",
173
+ "\n",
174
+ " world_map_fig = px.scatter_map(geo_df,\n",
175
+ " lat=geo_df['coord_x'],\n",
176
+ " lon=geo_df['coord_y'],\n",
177
+ " hover_name=geo_df['name'],\n",
178
+ " zoom=4,\n",
179
+ " hover_data={\n",
180
+ " 'IsTouristic': True,\n",
181
+ " 'Wine Type': True,\n",
182
+ " 'Country': True,\n",
183
+ " 'Region': True,\n",
184
+ " 'Address': True,\n",
185
+ "\n",
186
+ " },\n",
187
+ " title='Wineyards around the world',\n",
188
+ " )\n",
189
+ " \n",
190
+ "\n",
191
+ "\n",
192
+ " return px.line(df, x='year', y='pop'), recommended_wines, world_map_fig\n",
193
+ "\n",
194
+ "\n",
195
+ "if __name__ == \"__main__\":\n",
196
+ " app.run_server(host=\"0.0.0.0\", port=\"8050\", debug=debug)"
197
+ ]
198
+ },
199
+ {
200
+ "cell_type": "code",
201
+ "execution_count": null,
202
+ "metadata": {},
203
+ "outputs": [],
204
+ "source": []
205
+ }
206
+ ],
207
+ "metadata": {
208
+ "kernelspec": {
209
+ "display_name": "atc-smart-shower-YhjpRjjr-py3.10",
210
+ "language": "python",
211
+ "name": "python3"
212
+ },
213
+ "language_info": {
214
+ "codemirror_mode": {
215
+ "name": "ipython",
216
+ "version": 3
217
+ },
218
+ "file_extension": ".py",
219
+ "mimetype": "text/x-python",
220
+ "name": "python",
221
+ "nbconvert_exporter": "python",
222
+ "pygments_lexer": "ipython3",
223
+ "version": "3.9.6"
224
+ },
225
+ "orig_nbformat": 4
226
+ },
227
+ "nbformat": 4,
228
+ "nbformat_minor": 2
229
+ }
app/dashboard.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 6,
6
  "metadata": {},
7
  "outputs": [
8
  {
@@ -20,38 +20,11 @@
20
  " "
21
  ],
22
  "text/plain": [
23
- "<IPython.lib.display.IFrame at 0x28f564370>"
24
  ]
25
  },
26
  "metadata": {},
27
  "output_type": "display_data"
28
- },
29
- {
30
- "name": "stderr",
31
- "output_type": "stream",
32
- "text": [
33
- "[2024-09-17 12:44:28,042] ERROR in app: Exception on /_dash-update-component [POST]\n",
34
- "Traceback (most recent call last):\n",
35
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/flask/app.py\", line 1473, in wsgi_app\n",
36
- " response = self.full_dispatch_request()\n",
37
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/flask/app.py\", line 882, in full_dispatch_request\n",
38
- " rv = self.handle_user_exception(e)\n",
39
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/flask/app.py\", line 880, in full_dispatch_request\n",
40
- " rv = self.dispatch_request()\n",
41
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/flask/app.py\", line 865, in dispatch_request\n",
42
- " return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]\n",
43
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/dash/dash.py\", line 1376, in dispatch\n",
44
- " ctx.run(\n",
45
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/dash/_callback.py\", line 514, in add_context\n",
46
- " raise err\n",
47
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/dash/_callback.py\", line 503, in add_context\n",
48
- " output_value = _invoke_callback(func, *func_args, **func_kwargs)\n",
49
- " File \"/Users/ruimelo/anaconda3/envs/gan-nlp/lib/python3.10/site-packages/dash/_callback.py\", line 43, in _invoke_callback\n",
50
- " return func(*args, **kwargs) # %% callback invoked %%\n",
51
- " File \"/var/folders/b4/lwfgccm95kqd2skcwvrt2fr00000gn/T/ipykernel_62984/1808289814.py\", line 112, in update_graph\n",
52
- " world_map_fig = px.scatter_map(geo_df,\n",
53
- "TypeError: scatter_map() got an unexpected keyword argument 'projection_type'\n"
54
- ]
55
  }
56
  ],
57
  "source": [
@@ -82,7 +55,15 @@
82
  "\n",
83
  "wine_similarity_df = pd.read_csv('data/wine_similarity.csv')\n",
84
  "wine_list = wine_similarity_df['NAME'].unique()\n",
 
 
 
 
 
 
 
85
  "\n",
 
86
  "\n",
87
  "\n",
88
  "## Layout ##\n",
@@ -91,8 +72,10 @@
91
  " dcc.Link('About this project', href='/wiki'),\n",
92
  "\n",
93
  " dcc.Graph(id='graph-content'),\n",
94
- "\n",
95
- "\n",
 
 
96
  " dcc.Graph(id='world-map-fig'),\n",
97
  "\n",
98
  " html.H1(children='Wine Recommender', style={'textAlign':'center'}),\n",
@@ -101,8 +84,15 @@
101
  "])\n",
102
  "\n",
103
  "\n",
104
- "\n",
105
- "\n",
 
 
 
 
 
 
 
106
  "\n",
107
  "\n",
108
  "wiki_layout = html.Div([\n",
@@ -151,9 +141,11 @@
151
  " Output('graph-content', 'figure'),\n",
152
  " Output('wine-recommendation', 'children'),\n",
153
  " Output('world-map-fig', 'figure'),\n",
154
- " Input('dropdown-selection', 'value')\n",
 
 
155
  ")\n",
156
- "def update_graph(value):\n",
157
  " ### Wine Recommendation ###\n",
158
  " recommended_wines = None\n",
159
  " if value:\n",
@@ -164,6 +156,11 @@
164
  " ### World Map of wineyards ###\n",
165
  "\n",
166
  " geo_df = pd.read_csv('data/processed_wineyards.csv')\n",
 
 
 
 
 
167
  "\n",
168
  "\n",
169
  " world_map_fig = px.scatter_map(geo_df,\n",
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 33,
6
  "metadata": {},
7
  "outputs": [
8
  {
 
20
  " "
21
  ],
22
  "text/plain": [
23
+ "<IPython.lib.display.IFrame at 0x169ff4f10>"
24
  ]
25
  },
26
  "metadata": {},
27
  "output_type": "display_data"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
  ],
30
  "source": [
 
55
  "\n",
56
  "wine_similarity_df = pd.read_csv('data/wine_similarity.csv')\n",
57
  "wine_list = wine_similarity_df['NAME'].unique()\n",
58
+ "geo = pd.read_csv('data/processed_wineyards.csv')\n",
59
+ "wine_regions=list(geo['Region'].unique()) + ['all']\n",
60
+ "wine_country = list(geo['Country'].unique()) + ['all']\n",
61
+ "# local_type = list(geo['LOCAL TYPE'].unique()) + ['all']\n",
62
+ "\n",
63
+ "# WT_GLOBAL = '*' if \n",
64
+ "\n",
65
  "\n",
66
+ "# wine_country = geo['Country'].unique()\n",
67
  "\n",
68
  "\n",
69
  "## Layout ##\n",
 
72
  " dcc.Link('About this project', href='/wiki'),\n",
73
  "\n",
74
  " dcc.Graph(id='graph-content'),\n",
75
+ " html.H1(children='Country', style={'textAlign':'center'}),\n",
76
+ " dcc.Dropdown(wine_country, wine_country[-1], id='dropdown-wc'),\n",
77
+ " html.H1(children='Region', style={'textAlign':'center'}),\n",
78
+ " dcc.Dropdown(['all'],'all', id='dropdown-wr'),\n",
79
  " dcc.Graph(id='world-map-fig'),\n",
80
  "\n",
81
  " html.H1(children='Wine Recommender', style={'textAlign':'center'}),\n",
 
84
  "])\n",
85
  "\n",
86
  "\n",
87
+ "@app.callback(\n",
88
+ " Output('dropdown-wr', 'options'),\n",
89
+ " Input('dropdown-wc', 'value')\n",
90
+ ")\n",
91
+ "def set_wine_type_options(selected_wine_type):\n",
92
+ " # Return the options based on the selected wine country\n",
93
+ " pattern = r'.*' if selected_wine_type == 'all' else rf'{selected_wine_type}'\n",
94
+ " #selected_wine_type = r'*' if selected_wine_type == r'all' else selected_wine_type\n",
95
+ " return list(geo[geo['Country'].str.match(pattern, na=False)]['Region'].unique()) + ['all']\n",
96
  "\n",
97
  "\n",
98
  "wiki_layout = html.Div([\n",
 
141
  " Output('graph-content', 'figure'),\n",
142
  " Output('wine-recommendation', 'children'),\n",
143
  " Output('world-map-fig', 'figure'),\n",
144
+ " Input('dropdown-selection', 'value'),\n",
145
+ " Input('dropdown-wr', 'value'),\n",
146
+ " Input('dropdown-wc', 'value')\n",
147
  ")\n",
148
+ "def update_graph(value,wr,wc):\n",
149
  " ### Wine Recommendation ###\n",
150
  " recommended_wines = None\n",
151
  " if value:\n",
 
156
  " ### World Map of wineyards ###\n",
157
  "\n",
158
  " geo_df = pd.read_csv('data/processed_wineyards.csv')\n",
159
+ " wr = r'.*' if wr == 'all' else rf'{wr}'\n",
160
+ " #wr = r'*' if wr == 'all' else wr # wine region poiseu tbm tinha assim, mas agr tenho 2 filtros nao posos fazer infinitas condicoes assim ja sao 4, rota \n",
161
+ " #wc = r'*' if wc == 'all' else wc # wine country & geo_df['Country'].str.match(wc)\n",
162
+ " wc = r'.*' if wc == 'all' else rf'{wc}'\n",
163
+ " geo_df = geo_df[geo_df['Region'].str.contains(wr, case=False, na=False, regex=True) & geo_df['Country'].str.contains(wc, case=False, na=False, regex=True)]\n",
164
  "\n",
165
  "\n",
166
  " world_map_fig = px.scatter_map(geo_df,\n",
app/data/simulated_ratings.csv ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ,Azevedo,Gazela,Aura,Dedicado,Legado,Offley,Quinta dos Carvalhais,Série Ímpar,Antónia Adelaide Ferreira,Casa Ferreirinha,Finca Flichman,Herdade do peso,Marqués de Burgos,Porto Ferreira,Sandeman,Silk & Spice,Chateau Los Boldos,Framingham,LAN,Mateus,Quinta da Romeira,Santiago Ruiz,cluster
2
+ User1,0.0,0.06443997699726,0.3449056039735562,0.4550084646356445,0.41979810478787327,0.2879387614301103,0.0,0.2973576757817604,0.0,0.3822648242939971,0.14619597056891132,0.0,0.0,0.5847009321959864,0.13545994284272633,0.1423681523708309,0.0,0.06797446517051575,0.02832357962966947,0.0,0.07140870854193504,0.0,2
3
+ User2,0.5948287083965925,0.44335961955737735,0.011698380387221374,0.0,0.0,0.49461461311474775,0.0,0.005729251508012512,0.5693673814797996,0.4322713311933959,0.2728984924468866,0.40638688755439234,0.0,0.37012628159515615,0.498129573429527,0.0,0.004207885943851908,0.11060004916376354,0.4369501449455857,0.45779972434207394,0.0,0.0,1
4
+ User3,0.0,0.0,0.29838294973309265,0.4657199042028777,0.26565985691169125,0.5094252303834287,0.0,0.32004684954091545,0.0,0.10679835807652938,0.0,0.4649129286624588,0.15325728816020523,0.0,0.0,0.07261655507412768,0.010242393477639777,0.0,0.017909208118409015,0.0,0.0,0.3558953967569839,3
5
+ User4,0.28024230448237597,0.0,0.0005097401462152984,0.04796383935172499,0.0,0.1857647341786709,0.08764704883454955,0.0,0.03991944809676706,0.110225183032855,0.0,0.0,0.0,0.5859937865861393,0.0,0.0,0.5023002881776448,0.5918664889668852,0.2587072978717988,0.0,0.0,0.051117181147343094,2
6
+ User5,0.09634308627647437,0.14066903355970428,0.10293485587712714,0.4553746764355179,0.0,0.4869345681086372,0.0,0.4311585106516742,0.0,0.24811496404779287,0.5510956697548827,0.0,0.4075246541911244,0.0,0.15709875960918807,0.31785472737270526,0.3696157642396328,0.0,0.0,0.0,0.0,0.30336000500286053,3
7
+ User6,0.3836788510736391,0.1098283117344857,0.0,0.0,0.0,0.18588173392529472,0.13859449425182258,0.4448465261121869,0.1024410571436325,0.06329334892076999,0.2650121744558429,0.0,0.0,0.060439987271035944,0.15023768394105685,0.3669554562456546,0.0,0.2199089514466288,0.25665683291290653,0.0,0.026204197498154613,0.0,1
8
+ User7,0.0,0.3920086251570456,0.0,0.1767662523147273,0.5506733150660575,0.15756632321741504,0.0,0.0,0.028590221516500813,0.5481632790875741,0.0,0.38716996546800075,0.0,0.286805026150593,0.0,0.0,0.1849626035953743,0.0,0.0,0.031629537359761706,0.3274025764044375,0.0,2
9
+ User8,0.07015008767973574,0.2746908493398694,0.0,0.4389532928627571,0.1077299660140435,0.0,0.0,0.0,0.0,0.0011990194109436914,0.4302215088171518,0.16933426614988056,0.17027451120275983,0.13453467840723565,0.0,0.06865002034864331,0.29617939880934385,0.23794559511061197,0.0,0.49953169184761836,0.0,0.0,0
10
+ User9,0.1386448232275842,0.4101939670307645,0.13050471474811032,0.5098535805087442,0.0,0.0,0.12057424642664205,0.26904955675429365,0.1919239381193122,0.0,0.0,0.0,0.060940201981446784,0.0,0.0,0.5449458249135705,0.10005465592496798,0.17597402052521782,0.2216023196380994,0.48717283238101317,0.23179990756058655,0.0,0
11
+ User10,0.5099859112826219,0.15411543658398552,0.0,0.5392314426781997,0.37864448372694404,0.09372161879554441,0.26138464676129225,0.0,0.32981100063653745,0.37092018262896354,0.09021765235856893,0.007022363523726982,0.027634049721769083,0.0,0.17591577300184447,0.5799236457320623,0.48632435728710277,0.0,0.5434342889775089,0.0,0.560916204945844,0.0,1
12
+ User11,0.4907344183819379,0.4344187827799211,0.0,0.5093457600386548,0.0,0.18654010757181183,0.5337526353885789,0.0,0.0,0.0,0.0,0.5930258049472269,0.4840134906336293,0.0,0.0,0.0,0.0,0.5220987176965876,0.1900423950597112,0.3862408889374497,0.0,0.26737200126645944,2
13
+ User12,0.009001384870462203,0.2588228755844344,0.5531645980554327,0.4435729599341395,0.1499161362070529,0.3765417585969917,0.3169734766328086,0.0,0.39567073061604674,0.0,0.1689166601970613,0.0,0.06013024251061139,0.0,0.09215197024464838,0.33579953490025394,0.13199380601366284,0.0,0.03955060129989496,0.0,0.18969302517972064,0.5049167415026756,3
14
+ User13,0.453499080354259,0.0,0.49476294561193324,0.5057037541432848,0.23317856427007289,0.48657214874659116,0.0,0.3882066289773788,0.007093931351551119,0.5544968740436799,0.47866525482804867,0.1420275629954536,0.40814968201726587,0.07810858576329216,0.0,0.3244194518767177,0.054769801387188455,0.15717416512980453,0.5133740181138969,0.0,0.19988513345465797,0.30284702911256944,1
15
+ User14,0.4402260647917081,0.07801126851361406,0.21221770345012414,0.0,0.5686533408970778,0.4038718528812082,0.0,0.21490633619665123,0.0,0.0,0.01915503625826731,0.0,0.5607223742104395,0.0,0.3221263345811666,0.45591289785572053,0.3204098578293887,0.0617638893757515,0.3638345023877444,0.26457400436365486,0.0,0.09839728437646655,1
16
+ User15,0.0,0.2047930695450324,0.0,0.28120148043668236,0.5023716939281179,0.27746075003583415,0.0,0.4000511696287409,0.12177531769727867,0.0,0.234124794565289,0.37456634116159426,0.0,0.2449941548683301,0.08856405400051015,0.17766921135552138,0.0,0.3987093604861378,0.5408848273030081,0.16775634503300518,0.29377356284223644,0.061816429993099886,2
17
+ User16,0.07982087058173915,0.0,0.14307942175102384,0.0,0.5710001222796832,0.35063145313837274,0.5792453900756926,0.0,0.01991409177457515,0.00033257289139021484,0.0,0.26788119925248177,0.0,0.16433054887019827,0.0,0.21501298114990142,0.2712593359324773,0.0,0.0,0.5499836904275207,0.0,0.5955228066958206,3
18
+ User17,0.0,0.0,0.0869181230395879,0.10547634721994315,0.0,0.0,0.0,0.13897959393311066,0.05908076104305904,0.4382556383696188,0.06730302656742049,0.2626794917526991,0.1857936045052918,0.0,0.5406709608449177,0.13635248954993784,0.26364949010014704,0.5401502303403795,0.54714441393616,0.0,0.227859466340101,0.4562758240310243,4
19
+ User18,0.13883558932320028,0.29788155685698303,0.19970076969133344,0.28949770159662114,0.08329933226071451,0.3932916064656531,0.0,0.0,0.074290906155834,0.5362407775788408,0.34589264150933774,0.5072294528943904,0.47376258564796336,0.11837817702134223,0.0,0.5013688410074489,0.0,0.43159896074066917,0.0,0.11056069179883177,0.2798149758690487,0.41934461162463477,3
20
+ User19,0.5218202474852028,0.07664122200083079,0.0,0.0,0.3616809052382931,0.22832073521405571,0.2525084809736656,0.0033378369426543264,0.43915897070386845,0.2825256027909021,0.30160214869974833,0.40525576889827786,0.5564428572778898,0.5498404854985113,0.3711449840845372,0.0,0.047834504484624785,0.0,0.2585013076862389,0.0,0.0,0.0,1
21
+ User20,0.029560341680403335,0.24033370427347955,0.0,0.1738877491909827,0.30273582784169195,0.060594448473409,0.0,0.0,0.0,0.5438651130359812,0.0,0.3829665746484341,0.2113048781612582,0.0,0.3992815958563407,0.15373924590287846,0.14766458528893434,0.0,0.3034144679653882,0.5722203914115056,0.0,0.3651045510987594,4
22
+ User21,0.1803704868843823,0.03312490887391106,0.5822138465837621,0.16808181006732303,0.1610223053001859,0.3662869170063111,0.0,0.05877692125504719,0.5657036467734121,0.0,0.37956515166128324,0.40273401835811073,0.0,0.0,0.2370020249078192,0.0,0.2545040461135464,0.5704931306836588,0.0,0.04126984072212758,0.275253149537783,0.0,3
23
+ User22,0.5803222903936629,0.0,0.1911793827986239,0.28743893921105834,0.0,0.39318938429698413,0.0,0.1386703952686409,0.3191982984403767,0.31784920255388815,0.018905776218246295,0.0,0.0,0.07761341756775397,0.5234187315753706,0.0,0.5605935305156333,0.19358068365118564,0.0,0.0,0.5538487057451766,0.2090039770242006,1
24
+ User23,0.564742289172181,0.31456491653633945,0.2923245169154993,0.5556820534562514,0.0,0.33536163651870743,0.0,0.11525074895857457,0.576550468856355,0.4058524735095591,0.48936918566040366,0.019743097499617224,0.24106276434182095,0.16807894606394058,0.0,0.0,0.18873958860071527,0.11189658328670093,0.0,0.1635324939809637,0.30769575473839905,0.23634854185173138,3
25
+ User24,0.10401793505106938,0.0,0.0,0.2121631560035805,0.4175489514364896,0.0,0.0,0.0,0.2903936996257095,0.29186309163486723,0.0,0.3586630728681298,0.0,0.12274075033046006,0.07028622193020406,0.0,0.5454754732351085,0.0,0.0,0.37819554424237556,0.0,0.3417001041131804,3
26
+ User25,0.0,0.33159392716484637,0.2485401968189922,0.18236309424253938,0.0,0.036201292764200366,0.10801296111235315,0.0328733965441067,0.05249232628338141,0.3441534473102943,0.4240213545980517,0.48854770049487206,0.0,0.27662685241177487,0.1688636611847597,0.0392166378707165,0.14538563764608692,0.0,0.5244120621856385,0.3417283708981641,0.0,0.0,1
27
+ User26,0.2266073994608926,0.0,0.2593896115789308,0.0,0.0,0.36034265914041197,0.28483227771332964,0.5820248338747424,0.0950855095398615,0.22200225534294138,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.3850870855582066,0.42016106922457275,0.5280198396997361,0
28
+ User27,0.0,0.0,0.13564127195682696,0.15215279876073862,0.13730423278062243,0.264487283743162,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.15941203604598542,0.05431770517866252,0.30619614186812616,0.3996258777209536,0.0,0.0,0.16188199986490348,0.0,0.0,0
29
+ User28,0.28752253005312,0.5883421057681341,0.0,0.1305592571462474,0.0,0.0,0.0,0.34877103277425137,0.5996821324384495,0.48459267630647374,0.3614162186402604,0.5958755352200436,0.5326587767148043,0.32654823832540436,0.4424213294973566,0.23678487547292837,0.0,0.5719421404555378,0.0,0.2785168868554806,0.22713545071824537,0.0,4
30
+ User29,0.30002894291707016,0.0,0.0,0.5473218143333838,0.0,0.279618252346716,0.0,0.15824732227850102,0.553946267388341,0.0,0.4223445683325059,0.0,0.5374233599025852,0.13438407513195505,0.0485050168774821,0.0,0.0,0.21315788799257407,0.0,0.07838623606665274,0.504279561386561,0.5909544646535002,3
31
+ User30,0.0,0.05388542639416882,0.0,0.37105115095650976,0.0,0.0,0.3846948545251043,0.5233841722351129,0.0,0.0,0.03839102699301422,0.0,0.10425338543714502,0.06171190932654547,0.0,0.1524423157669157,0.21662268155417963,0.0,0.0,0.0,0.0586191561497903,0.0,0
32
+ User31,0.0,0.0,0.5603353758707176,0.0,0.43159733747320606,0.00032426033954890965,0.03719700976900342,0.0,0.5460281679492227,0.37430518524812784,0.4876285456758279,0.3912332686079586,0.4874509296225148,0.434556550245464,0.34976393111151005,0.5298349205953046,0.0,0.0,0.2530242622101221,0.2997548737795749,0.3515636183220512,0.1722280638457725,4
33
+ User32,0.0,0.0,0.0,0.0,0.0621578919835486,0.03983171269029562,0.0,0.0,0.2749745342743597,0.334884254448378,0.0,0.13019744995173066,0.4103743577141692,0.5830136216043978,0.11062494054111827,0.1602734401242737,0.5505148657623945,0.32120498770009964,0.4035023380330932,0.43162742577389956,0.356541420414339,0.34301670135053164,4
34
+ User33,0.0,0.5915740633809166,0.3127200587452136,0.0,0.46002113557926827,0.27038994954493567,0.0,0.0,0.5449954400221023,0.0,0.0,0.3445116214693915,0.49934742176364466,0.32510220410025104,0.2215504930206822,0.0,0.0,0.0,0.0,0.5368615846871744,0.0,0.3516954153552829,3
35
+ User34,0.012692438091185254,0.4350840155374355,0.054991587826238586,0.022378758402356258,0.42174290210089993,0.0,0.0,0.0,0.23699520717957734,0.19429322902185886,0.0,0.3667124509671652,0.41527312952678497,0.0,0.232952593898343,0.41480686019435287,0.47547361348438655,0.5245968706214659,0.4460180244896067,0.5407068954211206,0.5750078320905945,0.25739625827492296,4
36
+ User35,0.0,0.0547047673435318,0.22265415555016488,0.0,0.3093132111862691,0.0,0.0,0.0,0.0,0.0,0.20816651657849983,0.0,0.04774415165869117,0.35252410478806595,0.0,0.4364064806911411,0.0,0.0,0.0,0.0,0.0,0.3537698694822138,3
37
+ User36,0.0,0.0,0.03957274023501689,0.0,0.0,0.16189966494502617,0.49416497454528363,0.0,0.010872373693320836,0.0,0.07741243086215022,0.5418817053457718,0.0,0.10772361066162772,0.0,0.42771486886898225,0.0,0.37901567964849825,0.0,0.1280081292512476,0.5848001899673415,0.46909474709361887,0
38
+ User37,0.0,0.0075514241250908,0.0,0.22076214565229124,0.217378427163456,0.2104867503082588,0.23187767590066777,0.14176731283491395,0.28988805688268104,0.31312564506151375,0.4248277762787509,0.0,0.009114028797028828,0.13891103551177342,0.0,0.0,0.3141087798958231,0.28836183792899006,0.0,0.0,0.0,0.32200837050846165,3
39
+ User38,0.40610837420351675,0.0,0.3321286731411539,0.0,0.08962743801179329,0.5583131926683726,0.26873911240071535,0.08860166186705898,0.0,0.0,0.2947250968759826,0.0,0.09471916467244501,0.0768418027264346,0.10129351979596768,0.4389265045783397,0.010129930990343206,0.0,0.5121317419697824,0.2869481055247666,0.21826420559110793,0.0,1
40
+ User39,0.034059340302236674,0.0,0.3010627935064789,0.21137525807319657,0.17595637196717417,0.0,0.03967400214876726,0.0,0.23648587885037653,0.07264024456107088,0.16928826641601402,0.3187220771948669,0.08204069599892239,0.0,0.0,0.5596454906743811,0.19583357277000712,0.3762511966105456,0.0,0.43236525270468074,0.4650410507775359,0.0,0
41
+ User40,0.0,0.0,0.0,0.12551163227257578,0.0,0.031437478824392295,0.25450515275250385,0.3034738296003735,0.33782423850217336,0.0,0.03530592902453222,0.01849472489546944,0.02613903352238056,0.0,0.5445611385658631,0.43473358533612894,0.147959143603144,0.3904068539283695,0.35831846644819954,0.3661344587486042,0.0,0.43763173052522164,4
42
+ User41,0.0,0.4567203428686768,0.0,0.20784050934428533,0.05809747670710175,0.0,0.27799690431177737,0.5550076926416545,0.23823401308871162,0.0,0.0,0.0,0.44259891713798294,0.07636117714801904,0.02027464333037976,0.0,0.0,0.0,0.0,0.0,0.019633803078202172,0.48466270996020866,3
43
+ User42,0.1867864708658682,0.0,0.0,0.0,0.11913441212612963,0.0,0.24705481337285096,0.29917532351284026,0.4674240244741936,0.29087797345667576,0.08511576835057055,0.0,0.0,0.0,0.449814217322388,0.49329529051454235,0.44120344451517834,0.22394657267088336,0.0,0.0,0.0,0.2933706814809236,3
44
+ User43,0.17767068656691787,0.1297211161038433,0.0,0.47947946346227166,0.19206503005966524,0.0,0.3664780859146478,0.17967983632040885,0.0,0.0,0.378819381182515,0.11025945741075793,0.44134742442921515,0.3415371902835719,0.1854714557978131,0.44999416068439213,0.0,0.29021683223199757,0.0,0.3053162923577092,0.0,0.30944871902989524,3
45
+ User44,0.5213899406093725,0.0,0.19449318557140316,0.25726482660603556,0.4328638876730091,0.0,0.028277772335858375,0.09387713451459279,0.22143933020280404,0.0,0.11998887968063765,0.0,0.5995115099849714,0.2766131626892284,0.47935634543834915,0.0,0.0,0.37953228952588824,0.4457419175454479,0.5423711311298453,0.3585254407240841,0.0,4
46
+ User45,0.0,0.2870052198075532,0.0,0.0,0.0,0.0,0.2424609640472789,0.0,0.0,0.0,0.08208307662805558,0.0,0.16793012530991347,0.0,0.0,0.0,0.5251839095924018,0.5762848665743641,0.12820265488828264,0.0,0.0,0.5133426557915585,3
47
+ User46,0.17241998475525455,0.0,0.1640127290474782,0.10904584613184498,0.0,0.4654081001420455,0.33187850619756465,0.0,0.0,0.29620080889665623,0.0,0.5368250770269823,0.4972980789524113,0.0,0.0,0.0,0.5957954274975585,0.0,0.36802438214308275,0.0,0.42369224959967755,0.0,1
48
+ User47,0.14862566009908762,0.5777059532870571,0.0,0.3252752321455694,0.025615899056178115,0.015421230476927561,0.0,0.5607972630986877,0.0,0.21937597579625467,0.13677754868335013,0.0,0.23754083226693934,0.0,0.0,0.0,0.4497793240394081,0.3510913949901563,0.0,0.2863694354548707,0.0,0.0,0
49
+ User48,0.0,0.5476781916566271,0.35033188928283787,0.28882463180416473,0.24929741876949385,0.0,0.35578896865975507,0.0,0.12023935226235682,0.0,0.0,0.3741578977607911,0.0,0.4450085607968016,0.14116712918865482,0.49143493214075085,0.2167025691136596,0.0,0.0,0.03289550666009611,0.0,0.5261222389718577,2
50
+ User49,0.2736118464698639,0.4435561382823089,0.0,0.23018756201698143,0.0,0.5821491110835241,0.0,0.4724042466195686,0.10891059797213809,0.5138164902766649,0.3606669009358685,0.2865338418234925,0.5838639001626287,0.4621004850971502,0.3597427455351966,0.4131794895654105,0.012758272479440058,0.005800876219901441,0.0,0.42790154400732705,0.1465689688435441,0.40391396614438335,1
51
+ User50,0.4829163887514579,0.0,0.133192006640812,0.41813777434067934,0.0,0.0,0.34419939373889585,0.22536537185894412,0.0,0.0,0.017767733327109014,0.1592638495305797,0.0,0.02382762283565587,0.0,0.5769673873956498,0.0,0.2801150946539157,0.10494504203070287,0.46356255578134076,0.5687210084919697,0.2692953207890679,0
52
+ User51,0.16974186776921318,0.0,0.0,0.11684959648866078,0.48637448615818035,0.2983095343141575,0.07855901355135153,0.19096236994331595,0.5361239704483045,0.0,0.4771920164433432,0.5163652302465105,0.0,0.0,0.0,0.580663848183384,0.0,0.0,0.2320896930346592,0.09976779373463773,0.13377674075404578,0.0,1
53
+ User52,0.0,0.19332187272759693,0.0,0.14064951451520058,0.0,0.052013005379802024,0.10892226815284667,0.0,0.11647547807052128,0.001709542122584451,0.0,0.0,0.5858729076048327,0.0,0.0,0.5162616220440149,0.050266298134956866,0.21661925052647724,0.0,0.5993959362306726,0.0753327516719452,0.2789125372467848,0
54
+ User53,0.053788351664114664,0.07506888046474813,0.271262609100163,0.09832596504525704,0.0,0.5731478929839801,0.47643181396864676,0.0,0.0,0.0,0.16317666150882348,0.4554185241833689,0.0,0.3552617095220394,0.36503122530049714,0.21486013613548038,0.5972778024964489,0.5535786645847807,0.0,0.0,0.0,0.38029828790860587,2
55
+ User54,0.5952214484424866,0.0,0.0,0.06260901585490541,0.0,0.0,0.0,0.13876497678292177,0.0,0.13598343151160452,0.0,0.0,0.10032933269621669,0.17989921484674165,0.5125636073182077,0.0,0.2520799090740288,0.0,0.5721511473718052,0.0,0.0,0.34240353356518793,1
56
+ User55,0.0,0.22461648555219738,0.17864448079826256,0.02707273342259342,0.09492365090928778,0.13692740979038576,0.07489471683467108,0.0,0.05850021809334904,0.3843755921275994,0.2376540238579833,0.5908620501977737,0.1667199954313079,0.5001536015346911,0.04089021858537911,0.575527023381132,0.04871542603508894,0.1162546929600099,0.015225450251818096,0.0,0.5857219111670197,0.0,1
57
+ User56,0.2970499901584768,0.0,0.0,0.1455733554176708,0.050726112792606304,0.3752450192943868,0.0,0.0,0.0,0.37849374913526246,0.1571598706961712,0.16279747360888497,0.0,0.0,0.5248117823258046,0.0,0.3703202474483609,0.23431528593530326,0.5901581460849444,0.0,0.0,0.1932354909984052,1
58
+ User57,0.0,0.5210385540737039,0.07027341119715746,0.345705240196564,0.49435021425386183,0.5504234652149029,0.441893237995138,0.5703701934266624,0.0,0.09918866273712601,0.0,0.0,0.1463685827762462,0.37568079762663764,0.5938161516486068,0.0,0.32377659260681946,0.0,0.35901992520591197,0.0,0.018011844478396766,0.5369866914270404,2
59
+ User58,0.013578132451283698,0.05115018395133386,0.0,0.3345453132464834,0.16132029525896718,0.0929366157969993,0.1920642026853403,0.11047793772699144,0.053475226762646044,0.0,0.07478913495368167,0.22321366931526399,0.0,0.5512977689742072,0.1560497057099316,0.0,0.23876602035592132,0.5064663695411802,0.29784031750914175,0.0,0.0,0.08905195366901009,2
60
+ User59,0.0,0.0,0.0,0.0,0.05301487415189188,0.0,0.5906864387371719,0.04509901378708714,0.42816738173716573,0.2779441840338528,0.011432505904493961,0.0,0.4682779774399489,0.0,0.0032932744915233902,0.0,0.5177339776688876,0.47328494400871735,0.0,0.06408389447398943,0.0,0.0,3
61
+ User60,0.0,0.0,0.32567600633117777,0.10541755751213511,0.41217973015163323,0.2971385720254772,0.0,0.0,0.0,0.4378355554982495,0.0,0.0027267004526850824,0.0,0.0,7.409319084750177e-05,0.0,0.0,0.0,0.0,0.0,0.5426784688388218,0.0,1
62
+ User61,0.323756497788529,0.1630205392667582,0.0,0.12133456118354091,0.41031724752449505,0.4741984641046927,0.43038058956677905,0.0,0.0,0.5669270281870278,0.08886107134739551,0.27104785908264895,0.0,0.5517263691121336,0.15584665516802354,0.13293066486258742,0.12666268383252866,0.0,0.24088391795958164,0.0,0.0,0.0,2
63
+ User62,0.0,0.27427069985790675,0.0,0.0,0.058156861257493975,0.11928538714112025,0.3832644678603121,0.46815199398699514,0.011400839110305983,0.0,0.5098466292442044,0.14413230910940467,0.0,0.0,0.0,0.0,0.4443520070560254,0.0,0.042070514166521744,0.0,0.2538326077463239,0.0,1
64
+ User63,0.0,0.0,0.2736959540765832,0.24829985434526247,0.0604710522523928,0.0,0.0,0.0,0.544507431920662,0.0,0.411122833785156,0.07048360149033905,0.5140547283322819,0.0,0.40160254083680214,0.497409515030117,0.0,0.53999456502085,0.5005507635326183,0.2900096435197258,0.0,0.34787522300673135,4
65
+ User64,0.0,0.5629943082770776,0.0,0.0,0.0,0.0,0.0,0.15751270899171832,0.10948582037145627,0.2199202166230928,0.4529263737442507,0.17037854462407365,0.43780009571706957,0.0,0.3177387270128764,0.26499983062181465,0.0,0.5807123498570164,0.1564499777846683,0.5294229498771699,0.0,0.45082383015691085,4
66
+ User65,0.0,0.0,0.0,0.0,0.06055306818991568,0.12191192874518597,0.4873922400836356,0.0,0.3367325518453972,0.059776428566270856,0.29835669504816575,0.0,0.0,0.2777985382389019,0.0,0.0,0.12195883993637846,0.5577037564255407,0.0,0.15837835083672724,0.0,0.05963190519133388,3
67
+ User66,0.0,0.0,0.0,0.0,0.0,0.0,0.11394068602783936,0.25746986187272625,0.4454527599488918,0.14442847520692081,0.0,0.0,0.0,0.0,0.11183345716252024,0.20699068510284568,0.37817582996181476,0.0,0.09247076076325933,0.0,0.0,0.5318010294798708,3
68
+ User67,0.4397899396820023,0.0,0.5866234268117854,0.0,0.0,0.5991833966798319,0.3971386055941831,0.23981878830246406,0.220093536198803,0.0,0.0,0.14213445772991018,0.1525735476186233,0.0,0.10986747990278556,0.5675060187459291,0.11645146027954767,0.29790410631229713,0.2709357013926551,0.0,0.5205363788671833,0.0,1
69
+ User68,0.4130742753008676,0.0,0.0,0.0,0.2204782198650661,0.0,0.0,0.0,0.0,0.06203632528937997,0.0,0.0,0.0,0.0,0.18657409296508176,0.0,0.5697943450763896,0.4314095427388054,0.0,0.3029824836534748,0.0,0.0,0
70
+ User69,0.0,0.0,0.39088215401842774,0.0,0.0,0.4380240310223128,0.0,0.39536280717450345,0.23696276771433888,0.15661313459475823,0.04603105593595891,0.3054906189152242,0.5008806427514013,0.1942505919508637,0.020991814802662323,0.0,0.0,0.0,0.2553197599764232,0.0,0.0,0.38511268885807204,3
71
+ User70,0.3643936372021145,0.2319726816682176,0.17887019458432873,0.22447082862187562,0.0,0.1665892403098761,0.4840305942063483,0.0,0.34844349695282706,0.04413463406688212,0.5539230641881236,0.4196423632011751,0.0,0.34336883358020986,0.1287156761483138,0.0,0.02912646143388231,0.0,0.0,0.0,0.35311682784521514,0.31626185953963815,3
72
+ User71,0.5416064116975466,0.48168213148872685,0.5570883609365603,0.0,0.5922949022908363,0.2155347673690008,0.0,0.24042208012219535,0.3280899367869682,0.14320778273585733,0.17468680446731655,0.0,0.27786340103873275,0.24186045660928646,0.0,0.0,0.061987895790871606,0.0,0.0,0.06911173790215741,0.04816743678577651,0.0,1
73
+ User72,0.313744149540359,0.30551113841108724,0.0,0.04068444123387305,0.383602689754017,0.029723363516194534,0.0,0.0765276749181596,0.5524293685651317,0.0,0.0,0.5175818426649098,0.0,0.15519427903082894,0.34487267812469935,0.0,0.0,0.45662069866964405,0.0,0.0,0.03336043722153903,0.5812582800235234,3
74
+ User73,0.31744220142003643,0.0,0.0,0.23486146966428778,0.0,0.4394147963270483,0.5970637992357443,0.0,0.38365832213734885,0.20617968919524965,0.014037850817912645,0.25877654303681297,0.0,0.0,0.0,0.2605985687250113,0.0,0.24992154400035427,0.5081411195626607,0.5109073458145834,0.4909856717961021,0.0,0
75
+ User74,0.32902349026949407,0.17591200986595334,0.5670326909166996,0.37461183562836686,0.028513606923578405,0.21875884135146406,0.0,0.0,0.3236924103760651,0.0,0.11750492741087482,0.0,0.21551055664299446,0.0,0.5917782146732495,0.31830495655596225,0.0,0.20580218686365592,0.004584854124220383,0.39267760749615754,0.0,0.1599988199201685,0
76
+ User75,0.1683818252233562,0.2610863890715994,0.0,0.36285351829505486,0.0,0.0,0.0,0.481239303640309,0.08376384926227487,0.38973340676052015,0.589334600834023,0.0,0.0,0.22848834763317039,0.2557930674977932,0.014295180808246988,0.3688966121783006,0.0,0.4171174328289843,0.0,0.45310334524000406,0.023536856512704096,1
77
+ User76,0.0,0.035683215029075455,0.0,0.4906455194791207,0.0,0.5602079409152916,0.5972588003345289,0.4108804695981254,0.0,0.14051592879480213,0.0,0.0,0.19848636045538037,0.041153389788915584,0.0,0.21591456399933195,0.0,0.3452017426979135,0.4091410661123088,0.0,0.4322752175435971,0.4794757161977097,2
78
+ User77,0.0,0.050603560948505044,0.293465396527127,0.09515156065282038,0.0,0.5950594509336141,0.43424780203184354,0.07642517639267932,0.0,0.5962027954722449,0.38010035065745706,0.47608295850653604,0.0,0.0,0.39701225410082763,0.5734064462073348,0.4594076424897279,0.0,0.09759836591447513,0.0,0.016135072162808184,0.12729359840466026,1
79
+ User78,0.0,0.0,0.0,0.23524185360466554,0.0,0.08885715819056872,0.0,0.15373912360703723,0.0,0.0,0.0,0.032141381638303046,0.0,0.0,0.0,0.0,0.11744818249143263,0.14678789066284226,0.0,0.5179540198080322,0.47637443955688463,0.0,0
80
+ User79,0.49341450466452996,0.029729817548364013,0.5604222802861568,0.0,0.0,0.17802047518467468,0.0,0.5329496496952517,0.0,0.3640221213589514,0.36158434555559216,0.06907419728859465,0.17816712369193577,0.04508175789010305,0.0,0.11831675498025507,0.0,0.0,0.1116259657016403,0.28896175604866814,0.38349574328503633,0.0,1
81
+ User80,0.13271477765985107,0.0,0.10596096280523182,0.0,0.291112743656459,0.46360832334798674,0.0,0.03939695415972766,0.0,0.0,0.2709170623610614,0.10782631436549339,0.5930261417751347,0.3427275980791643,0.33859207086936727,0.0,0.04412696479993927,0.48706839101789545,0.0,0.24448149477387426,0.29165244640995025,0.48186590582951183,3
82
+ User81,0.0,0.0,0.24476096700169303,0.0,0.0,0.5140677415921983,0.0,0.5347543307426125,0.0,0.5694437278457607,0.3598601663114923,0.02090739172648648,0.0,0.4931329287719419,0.5953284061652524,0.0,0.0,0.16572910235479144,0.07810285467582745,0.34411777403242894,0.1167087469166721,0.0,1
83
+ User82,0.18026455436427358,0.1156874830338096,0.04078682525627375,0.06894113164124394,0.0,0.0,0.28215569805202767,0.09030583533654923,0.0,0.3653991531172097,0.3832031324462528,0.0,0.09958373145435395,0.2476101128800704,0.4979300472405097,0.0,0.3148052857050997,0.12842525508541613,0.2829753320121101,0.0,0.5128406039109308,0.0,1
84
+ User83,0.48109495257741863,0.0,0.0,0.09414346669624751,0.0,0.0,0.3859454068381529,0.414011714562035,0.0,0.1770367894345667,0.0,0.0,0.05272772571991191,0.5275869293231169,0.055778980819632284,0.5017309065785452,0.5756314171894995,0.5001251375426726,0.09933197071465472,0.0,0.3973135689570252,0.0,2
85
+ User84,0.021812149404977332,0.0,0.0,0.31325563466722683,0.5508836650874708,0.17223136139999462,0.5351724537391703,0.0,0.511094513312179,0.005217205924030521,0.03207586601734369,0.0,0.0,0.0,0.32375628902490183,0.22486073145802188,0.0,0.0,0.17211600727546095,0.40287523223414545,0.5997766029072015,0.0,0
86
+ User85,0.48672125381106146,0.0,0.03421757966141481,0.0,0.4226892269848198,0.43195636612641697,0.0,0.0,0.0,0.0,0.1931184963180973,0.0,0.3016681241673259,0.355855055670352,0.0011801225395337012,0.008464934441668959,0.05899602111918134,0.007760610858397965,0.0,0.0,0.0,0.35658251147538067,1
87
+ User86,0.46602146689529667,0.22103951781719267,0.3029139307094908,0.0,0.3226639849885583,0.15064758766013164,0.27991471532441736,0.3348328339617085,0.019329119190820143,0.03559309635283736,0.06298874247606023,0.34252204271484776,0.11192405006105821,0.0,0.531929997124331,0.05307928910419135,0.0,0.32695214483009305,0.24068552894214468,0.24887015775378973,0.29646289086849054,0.4935603727720439,4
88
+ User87,0.0,0.3720568987890752,0.5205832401065829,0.13593154184250433,0.45265549541552264,0.0,0.0,0.45085840518998244,0.025518980964805094,0.3658098604380212,0.0,0.11542442322472168,0.20632065352195028,0.0,0.0,0.15974909156015027,0.5328819073920424,0.4086699078293071,0.3895594845752821,0.3486099376352424,0.5429168099068442,0.45228822143380365,4
89
+ User88,0.0,0.010184349869685083,0.0,0.25512912627266804,0.11021018140937433,0.03958860125881525,0.0,0.22349734451444014,0.0,0.0,0.412504746484872,0.4056097254780193,0.32692072918653214,0.0,0.44283366243377253,0.26250735677484094,0.31245123089374327,0.0,0.0574511926043918,0.5930799001513889,0.0,0.0,0
90
+ User89,0.20415557183913124,0.533725891993232,0.07584966916138947,0.0,0.40545161307316535,0.09598617586767832,0.0015462622980766394,0.0,0.0,0.4702826132577035,0.0,0.5723965525339069,0.503692739143441,0.28205698642428134,0.0,0.08110009311600763,0.0,0.5884326591273256,0.0,0.0,0.0,0.15272893565323165,2
91
+ User90,0.0,0.5698054787677937,0.16553953766466856,0.37409843678879584,0.04471646279350194,0.48195276835574985,0.0,0.5919510394817478,0.29271034081676717,0.0,0.3359625489322624,0.0,0.1669244492634545,0.3797245525473806,0.0,0.20627052316192307,0.11213614152638496,0.0,0.0,0.0,0.19691789666273962,0.123262357713388,3
92
+ User91,0.0,0.20030523109706744,0.1719123415279128,0.5576044141959011,0.0,0.5048753545710591,0.0,0.2053325986155251,0.302547579622364,0.1183243804025298,0.29128532137238816,0.0,0.5980238570549099,0.5237176838481544,0.0,0.5387609882692606,0.31732726672188005,0.5883162643392182,0.10367078986333422,0.5905118455894296,0.4079104240726128,0.1973314735829812,3
93
+ User92,0.0,0.0,0.15827131639775227,0.17886354038301244,0.020234565973269225,0.3525121276133617,0.1299862052442311,0.0,0.28447241504813914,0.16313053091207863,0.4333749666678205,0.0,0.061053208259534864,0.0,0.0,0.37978805990681963,0.10001220264985566,0.26578383657477256,0.0,0.39794863754395826,0.20646529983740547,0.18207722269895332,3
94
+ User93,0.0,0.5171515067372275,0.3630420975752141,0.4633446623107137,0.11208975220032613,0.08493097258414029,0.3670201379300767,0.500206272907845,0.0,0.0,0.0,0.35474677656858644,0.39196575630288044,0.302809453374861,0.0,0.0,0.0,0.0,0.46136567861702227,0.0,0.11470017616609773,0.0,2
95
+ User94,0.0,0.3865411696986174,0.0,0.031064447257078576,0.0,0.0,0.18885572826448827,0.0,0.586188021604667,0.5403253833390701,0.0,0.05281199214661425,0.23490468660024866,0.0,0.0,0.4755122745182674,0.23188711627951286,0.0,0.4135839672562054,0.0,0.2721119189561785,0.0,3
96
+ User95,0.17100006393047495,0.007745109151490515,0.0,0.14984585597494815,0.1497118626459485,0.31309627346668634,0.0,0.0,0.0,0.09623056565719601,0.3549271533976337,0.0,0.0,0.21060519870008965,0.0,0.0,0.34586782173012354,0.0,0.32030743542229645,0.05143475753026994,0.34415048017287386,0.0,1
97
+ User96,0.0,0.016234802011631966,0.03585132618344644,0.0,0.5548375871155714,0.0,0.43763642233909994,0.24431551646867777,0.5410582724703552,0.5438900999811414,0.4407535028246655,0.2696649544954962,0.0,0.3167244817868943,0.2647972385796775,0.552165613328333,0.0,0.0,0.0,0.0,0.2715526797229607,0.0,3
98
+ User97,0.5206390038804264,0.0,0.0,0.5987445249677196,0.0,0.5420281283251223,0.365816713103598,0.12254215749946973,0.0,0.0,0.0,0.22228286456857627,0.009905659416592605,0.0,0.0,0.14837064392197974,0.3786059672520027,0.0,0.0,0.0,0.0,0.18168294658173767,1
99
+ User98,0.12680334485379985,0.36666189833070084,0.0,0.5036848767336752,0.40426056893480733,0.4884421779052134,0.09015393284559292,0.0,0.478360837952004,0.0727863618462975,0.42563756581199286,0.0,0.4551392970373934,0.0,0.3216712822018709,0.0,0.009228643332754416,0.0,0.0,0.18675270733159,0.0,0.0,3
100
+ User99,0.19177241080352725,0.38060622083193607,0.5033286943264796,0.5493091507292845,0.4546085813613189,0.0,0.009397482815163727,0.008353840399218715,0.0,0.0,0.19159573735260427,0.0,0.030614290163828994,0.4359123657307592,0.3604242409137196,0.5355855924755755,0.0,0.5078226878868471,0.23602159313161453,0.0,0.5464275697996035,0.0,2
101
+ User100,0.20891014918325357,0.08947080625748927,0.051629025929939676,0.2570978955037906,0.0,0.0,0.0,0.0,0.0,0.0818839853009764,0.0,0.0,0.5629023984586625,0.3518521235135985,0.0,0.14985779304638602,0.06444663961768105,0.0,0.3392833667538724,0.10537230818388466,0.0,0.0,1
app/data/wineyards.csv CHANGED
@@ -1,4 +1,4 @@
1
- NAME,IsTouristic,LOCAL TYPE,WINE TYPE,SIZE,COUNTRY,REGION,ADDRESS,COORD
2
  Quinta de Azevedo,No,Quinta,Verde,41,Portugal,Douro,"R. Conde de Azevedo 237, 4750-511 Roriz","41.57330853032964, -8.533706262471226"
3
  Quinta do Porto,No,Quinta,Douro,27,Portugal,Douro,"N226, 5100","41.1285485073888, -7.816127554438324"
4
  Quinta do Seixo,Quinta do Seixo,Quinta,,100,Portugal,Douro,"Largo de Eiras 37, 5150-084 Almendra","41.02111060351561, -7.011243914386894"
 
1
+ NAME,IsTouristic,LOCAL_TYPE,WINE_TYPE,SIZE,COUNTRY,REGION,ADDRESS,COORD
2
  Quinta de Azevedo,No,Quinta,Verde,41,Portugal,Douro,"R. Conde de Azevedo 237, 4750-511 Roriz","41.57330853032964, -8.533706262471226"
3
  Quinta do Porto,No,Quinta,Douro,27,Portugal,Douro,"N226, 5100","41.1285485073888, -7.816127554438324"
4
  Quinta do Seixo,Quinta do Seixo,Quinta,,100,Portugal,Douro,"Largo de Eiras 37, 5150-084 Almendra","41.02111060351561, -7.011243914386894"