-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
michael_fan
authored and
michael_fan
committed
Sep 8, 2021
1 parent
8f7f974
commit f745a7a
Showing
21 changed files
with
1,817 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 YudongChen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
## Curriculum Meta-Learning for Next POI Recommendation | ||
|
||
The codes for the paper: Curriculum Meta-Learning for Next POI Recommendation (KDD 2021). | ||
|
||
This repository is under construction. | ||
|
||
### Requirements | ||
|
||
``` | ||
python 3.6 | ||
paddlepaddle >= 2.0.0 | ||
numpy >= 1.19.0 | ||
x2paddle (please refer to https://github.com/PaddlePaddle/X2Paddle) | ||
``` | ||
|
||
### Run | ||
|
||
To run the codes, one should first put the map search data under the path `./data/dataset/`. | ||
Each city is a `.txt` file, where each line is the search records of one user in that city: | ||
|
||
```shell | ||
Each line: | ||
{user_id} \t {os_name} \t {search_record1} \t {search_record2} \t ... | ||
# {os_name}: the operation system of the user's mobile, e.g., "iphone", "andriod", etc. | ||
Each search record: | ||
{time}_{poiid}_{poiloc}_{poiname}_{poitype}_{userloc}_{network} | ||
# {time}: the timestamp when the user searched the POI, e.g., '2021-08-14 10:00:00' | ||
# {poiid}: the POI ID hashcode of the searched POI, e.g., 'wqxc4t8fd147a' | ||
# {poiloc}: the Mercator coordinates of the POI, e.g., '(12967374,4810843)' | ||
# {poiname}: the name of the POI, e.g., 'Happy Cinema' | ||
# {poitype}: the category of the POI, e.g., 'cinema' | ||
# {userloc}: the Mercator coordinates of the user when he/she searched the POI | ||
# {network}: '4G' or 'wifi' | ||
``` | ||
|
||
Next, set the config files under the path `./data/config/`: | ||
|
||
- `base_cities.txt`: The name of all the base cities (for meta-training). Each line for one city name. The city names **should exactly match** the names in `./data/dataset/`. The same below. E.g., | ||
|
||
``` | ||
beijing | ||
shanghai | ||
shenzhen | ||
... | ||
``` | ||
|
||
- `valid_cities.txt`: The name of all the valid cities (for meta-validation). | ||
|
||
- `test_cities.txt`: The name of all the test cities (for meta-testing). | ||
|
||
- `poi_category.txt`: All the POI categories in the raw dataset. Each line for one POI category. E.g., | ||
|
||
``` | ||
cinema | ||
school | ||
residential area | ||
... | ||
``` | ||
|
||
Finally, you can run the following instructions at `./`: | ||
|
||
```shell | ||
sh run_prep.sh | ||
sh run.sh | ||
``` | ||
|
||
As a fake example, you may run as follows to run our codes on fake dataset: | ||
|
||
```sh | ||
python preprocess/fake_data_generator.py | ||
sh run_prep.sh | ||
sh run.sh | ||
# Although the meta-learner cannot learn anything from the fake data.. | ||
``` | ||
|
||
Notice: there are still some warnings during running the codes, but it's just OK to run. | ||
|
||
|
||
|
||
### Cite | ||
|
||
Please cite the paper: | ||
|
||
``` | ||
@article{Chen2021CurriculumMF, | ||
title={Curriculum Meta-Learning for Next POI Recommendation}, | ||
author={Yudong Chen and Xin Wang and Miao Fan and Jizhou Huang and Shengwen Yang and Wenwu Zhu}, | ||
journal={Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery \& Data Mining}, | ||
year={2021} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"update_lr": 1e-3, | ||
"meta_lr": 1e-3, | ||
"update_step": 1, | ||
"update_step_test": 1, | ||
|
||
"task_batch_size": 4, | ||
|
||
"train_qry_batch_size": 512, | ||
"max_train_steps": 100000, | ||
"few_num": 512, | ||
|
||
"num_poi_types": 229, | ||
"num_time": 25, | ||
"embed_dim": 50, | ||
"poiid_dim": 50, | ||
"mlp_hidden": 300, | ||
"local_fix_var": 1, | ||
"global_fix_var": 1, | ||
|
||
|
||
"sample_batch_size": 1024, | ||
"test_task_batch_size": 1, | ||
"num_epoch": 10 | ||
} |
Oops, something went wrong.