Context Trails data
收藏资源简介:
Context Trails Repository containing the data used in the paper:Context Trails: A dataset to study contextual and route recommendation 📝 Instructions Since Foursquare does not grant explicit permission to redistribute the original data, you must run the download_process_poi_info.sh script located in the data directory to retrieve it. Before doing so, ensure that your Foursquare Developer API key is correctly set in the request_foursquare_API.py file. After executing the script, your repository should match the structure described below. 💻 Prerequisites Python 3.8 or higher is required. Install the required dependencies using the following command: pip install -r requirements.txt 📂 Repository Structure online_appendix.pdf: file with extended figures from those shown in the paper, depicting different characteristics of the data (route size, weather conditions, and so on). NewYorkCity.zip: data corresponding to New York City. PetalingJaya.zip: data corresponding to Petaling Jaya (Kuala Lumpur district). Tokyo.zip: data corresponding to the city of Tokyo. download_process_poi_info.sh: script for processing the data and download the Foursquare data. request_foursquare_API.py: code that uses Foursquare API to donwload the information regarding the POIs into a JSON file. generate_poi_data.py: code to create a CSV file from the previous JSON file. map_categories.py: code to extend the previous CSV into a file containing the level 1 categories. The structure of the data contained in each city (ZIP files) is as follows: POIS_<city>.csv: file containing the Foursquare ids on which we were able to retrieve their data from the API in November 2024. ALL_POIS_<city>.csv: file containing all the Foursquare ids of that city. POIS_INFO_<WikidataID>_<city>_lvl1_categories.csv (note that this file will be obtained through the Foursquare API): it is a CSV containing the following information obtained from the Foursquare API: fsq_id: original Foursquare id. latitude. longitude. category (each POI might contain more than one category). Each category separated by "-". price. rating. total_ratings. total_tips. a set of booleans denoting if the POI is open in that interval (1 open, 0 closed) in both weekdays (monday to friday) and weekends (Saturdays and Sundays). EarlyMorning is between 00:00 to 06:00. Morning is between 06:00 to 12:00. Afternoon is between 12:00 to 18:00. Night is between 18:00 to 24:00. the category of level 1 from Foursquare. <WikidataID>_<city>_trails_weather.zip: zip directory containing a CSV separated by ; containing the following information: trail_id: the id of the trail. user_id: the id of the user. venue_id: original Foursquare id. timestamp: date following the ISO 8601 format. temp: temperature in Cº at the moment of the check-in. precip: value of the precipitation at the moment of the check-in. windspeed: wind speed at the moment of the check-in. preciptype: type of the precipitation at the moment of the check-in. conditions: sky condition at the moment of the check-in. <WikidataID>_<city>_trails_weather_aggregated.zip: ZIP file containing 3 different files: <WikidataID>_<city>_trails_weather_aggregated.csv: CSV file separated by ";" containing the aggregated check-ins of each user (hence, all the trails are removed). It contains an additional column denoted as number_of_visits that contains the number of visits that that user have visited the specific POI. The timestamp represents the last time that the user visited that venue. <WikidataID>_<city>_trails_weather_aggregated_Temp80train.csv: CSV containing the check-ins of the users used to train the recommenders (80% of the most ancient ratings were used for training). <WikidataID>_<city>_trails_weather_aggregated_Temp20test.csv: CSV containing the check-ins of the users used to test the recommenders (20% of the most recent ratings were used for test). <WikidataID>_<city>_trails_routes_2_minroutes_4_minPois_training_test.zip: ZIP file containing the training and test set used for the route recommendation task. For every user with at least 2 different routes, if the last route contains at least 4 POIs, then is sent to test, else, it is sent to the training file. It contains 2 different files: <WikidataID>_<city>_trails_routes_2_minroutes_4_minPOIS_TestRouteTraining.csv: training file used for the route recommendation problem. <WikidataID>_<city>_trails_routes_2_minroutes_4_minPOIS_TestRouteTest.csv: test file used for the route recommendation problem. NOTE: the repository including code from the experiments conducted in the paper can be found here 👥Authors Pablo Sánchez - Universidad Pontificia Comillas Alejandro Bellogín - Universidad Autónoma de Madrid José Luis Jorro Aragoneses - Universidad Autónoma de Madrid 📬 Contact Pablo Sánchez - psperez@icai.comillas.edu 🙏 Acknowledgments This work was supported by grant PID2022-139131NB-I00 funded by MCIN/AEI/10.13039/501100011033 and by ''ERDF A way of making Europe''. Partially supported by Spanish Thematic Network on Recommender Systems (Action RED2022-134302-T funded by MCIN/AEI/10.13039/501100011033). We would like to thank Foursquare for providing access to their API, which enabled us to download and utilize valuable data for this project. We also acknowledge Visual Crossing Weather for granting access to their weather data services. This project made use of historical weather data from the years 2017 and 2018 for the cities of New York (USA), Petaling Jaya (Malaysia), and Tokyo (Japan). Visual Crossing Corporation. Visual Crossing Weather. (2017-2018). https://www.visualcrossing.com/
### 上下文轨迹(Context Trails) 本仓库包含论文《Context Trails: A dataset to study contextual and route recommendation》(《上下文轨迹:用于研究上下文与路线推荐的数据集》)中使用的数据集。 📝 使用说明 由于Foursquare未明确授予重新分发原始数据的权限,您必须运行data目录下的download_process_poi_info.sh脚本以获取数据。在此之前,请确保已在request_foursquare_API.py文件中正确配置您的Foursquare开发者API密钥。执行脚本后,您的仓库结构应与下文描述一致。 💻 前置依赖 需使用Python 3.8及以上版本。通过以下命令安装所需依赖: pip install -r requirements.txt 📂 仓库结构 online_appendix.pdf:包含论文中展示的扩展图表,用于呈现数据的各项特征(如轨迹规模、天气状况等)。 NewYorkCity.zip:对应纽约市的数据集。 PetalingJaya.zip:对应八打灵再也(吉隆坡辖区)的数据集。 Tokyo.zip:对应东京市的数据集。 download_process_poi_info.sh:用于处理数据并下载Foursquare数据的脚本。 request_foursquare_API.py:使用Foursquare API将POI(Point of Interest,兴趣点)信息下载为JSON文件的代码。 generate_poi_data.py:从上述JSON文件生成CSV文件的代码。 map_categories.py:将前述CSV文件扩展为包含一级类别的文件的代码。 各城市压缩包(ZIP文件)内部的数据结构如下: POIS_<city>.csv:包含2024年11月我们成功通过API获取数据的Foursquare ID对应的文件。 ALL_POIS_<city>.csv:包含该城市所有Foursquare ID的文件。 POIS_INFO_<WikidataID>_<city>_lvl1_categories.csv(该文件将通过Foursquare API获取):包含从Foursquare API获取的以下信息的CSV文件: - fsq_id:原始Foursquare ID - 纬度 - 经度 - 类别(每个POI可包含多个类别,类别间以“-”分隔) - 价格等级 - 评分 - 总评分数量 - 总点评数量 - 一组布尔值,分别表示工作日(周一至周五)和周末(周六、周日)各时段该POI是否营业(1为营业,0为停业),时段划分如下: - 清晨:00:00至06:00 - 上午:06:00至12:00 - 下午:12:00至18:00 - 夜间:18:00至24:00 - 来自Foursquare的一级类别。 <WikidataID>_<city>_trails_weather.zip:以分号分隔的CSV文件组成的压缩目录,包含以下信息: - trail_id:轨迹ID - user_id:用户ID - venue_id:原始Foursquare ID - timestamp:遵循ISO 8601标准的日期格式 - temp:签到时的气温(单位:摄氏度) - precip:签到时的降水量 - windspeed:签到时的风速 - preciptype:签到时的降水类型 - conditions:签到时的天空状况。 <WikidataID>_<city>_trails_weather_aggregated.zip:包含3个不同文件的压缩包: 1. <WikidataID>_<city>_trails_weather_aggregated.csv:以分号分隔的CSV文件,包含每个用户的聚合签到数据(所有轨迹信息均已移除)。新增列number_of_visits表示该用户访问特定POI的次数,timestamp表示该用户最后一次访问该场馆的时间。 2. <WikidataID>_<city>_trails_weather_aggregated_Temp80train.csv:包含用于训练推荐系统的用户签到数据(选取80%最早期的评分作为训练集)。 3. <WikidataID>_<city>_trails_weather_aggregated_Temp20test.csv:包含用于测试推荐系统的用户签到数据(选取20%最新的评分作为测试集)。 <WikidataID>_<city>_trails_routes_2_minroutes_4_minPois_training_test.zip:包含用于路线推荐任务的训练集与测试集的压缩包。规则为:对于拥有至少2条不同轨迹的用户,若其最后一条轨迹包含至少4个POI,则将其划入测试集,否则划入训练集。该压缩包包含两个文件: 1. <WikidataID>_<city>_trails_routes_2_minroutes_4_minPOIS_TestRouteTraining.csv:用于路线推荐任务的训练文件。 2. <WikidataID>_<city>_trails_routes_2_minroutes_4_minPOIS_TestRouteTest.csv:用于路线推荐任务的测试文件。 注意:包含论文中实验代码的仓库可在此处获取。 👥 作者 巴勃罗·桑切斯(Pablo Sánchez)—— 波蒂奇亚·科米利亚斯大学 亚历杭德罗·贝洛金(Alejandro Bellogín)—— 马德里自治大学 何塞·路易斯·约罗·阿拉贡内斯(José Luis Jorro Aragoneses)—— 马德里自治大学 📬 联系方式 巴勃罗·桑切斯:psperez@icai.comillas.edu 🙏 致谢 本研究受到由西班牙科学与创新部(MCIN)/西班牙国家研究局(AEI)/10.13039/501100011033 资助的项目 PID2022-139131NB-I00 以及“欧洲区域发展基金(ERDF)—— 打造欧洲的路径”支持。 部分研究得到西班牙推荐系统主题网络(由MCIN/AEI/10.13039/501100011033 资助的 RED2022-134302-T 行动)的支持。 我们感谢Foursquare提供的API访问权限,使我们能够下载并使用本项目所需的宝贵数据。 我们同时感谢Visual Crossing Weather开放其气象数据服务的访问权限。本项目使用了2017年至2018年期间美国纽约、马来西亚八打灵再也以及日本东京的历史气象数据。Visual Crossing Corporation. Visual Crossing Weather. (2017-2018). https://www.visualcrossing.com/



