URBANITE RECOMMENDER API

This is a Flask application developed by Tecnalia.

Recommendation calls

/recommender/popularity

It recommends the most popular actions found in the DDBB.
It can filter by kpi if a kpi is provided.

Returns:
Json with actions (action_id, action_name, Longitud, Latitud, kpi_id_list, kpi_name_list, Popularity)

Input

Parameter Mandatory Data Example Regexp
kpi No int 7 -

/recommender/geographic/action_id

Provided action it returns a set of actions that are close by the location

Returns:
Json with actions (action_id, action_name, Longitud, Latitud, kpi_id_list, kpi_name_list, Distance_in_meters)

Input

Parameter Mandatory Data Example Regexp
action Yes int 7 -
kpi No int 12 -

/recommender/geographic/lat_lon

Provided latitude and logitude coordinations it returns a set of actions that are close by the location

Returns:
Json with actions (action_id, action_name, Longitud, Latitud, kpi_id_list, kpi_name_list, Popularity)

Input

Parameter Mandatory Data Example Regexp
lat Yes float 43.1231 -
lon Yes float -2.9345 -
kpi No int 12 -

/recommender/preferences

Provided a set of preferences it recommends the best actions with a collaborative filtering.

Returns:
Json with actions (action_id, action_name, Longitud, Latitud, kpi_id_list, kpi_name_list, Count)

Input

Parameter Mandatory Data Example Regexp
sports Preferences must add to 1 float 0.25 -
culture Preferences must add to 1 float 0.25 -
sightseeing Preferences must add to 1 float 0.4 -
culture Preferences must add to 1 float 0.1 -
kpi No int 7 -

/recommender/kpis/kpi_id

Provided a action it returns a set of kpis by their affinity regarding the provided action

Returns:
Json with kpis (kpi_id, kpi_name, Count, Popularity, Probability

Input

Parameter Mandatory Data Example Regexp
kpi Yes int 12 -

/recommender/kpis/action_id

Provided a action it returns a set of kpis by their affinity regarding the provided action

Returns:
Json with kpis (kpi_id, kpi_name, Count, Popularity, Probability)

Input

Parameter Mandatory Data Example Regexp
action Yes int 7 -

/recommender/bayesian

Provided a set of actions it recommends the best actions with a bayesian probability based collaborative filtering.

Returns:
Json with actions (action_id, action_name, Longitud, Latitud, kpi_id_list, kpi_name_list, Popularity)

Input

Parameter Mandatory Data Example Regexp
actions Yes str 10,7 ^[0-9]+(?:,[0-9]+)*$
kpi No int 7 -

Database

Saving information into the database to improve the recommender

/database/save/plan

Takes a json file that matches the structure that /plan/plan_detail creates and it stores it into the database.

Returns:
Nothing

Input:
A json file that matches the structure of the response of /planner/plan_detail