Commit 53fdd6e9 authored by Amelie Royer's avatar Amelie Royer

Adding test run examples

parent 3eef7b1f
1 Beverages 80
2 Breakfast Foods 20
3 Canned Foods 110
4 Canned Products 10
5 Carousel 5
6 Checkout 10
7 Dairy 100
8 Deli 70
9 Eggs 25
10 Frozen Foods 155
11 Health and Hygiene 95
12 Household 160
13 Meat 10
14 Periodicals 25
15 Produce 220
16 Seafood 10
17 Snack Foods 180
18 Snacks 40
19 Starchy Foods 30
20 Alcoholic Beverages 40
21 Baked Goods 45
22 Baking Goods 120
\ No newline at end of file
0 0 500 16.4792565208
1 1 500 11.294463039
2 2 500 14.8259443525
3 3 500 12.2200714364
4 4 500 14.0995349876
1 1.0
2 1.0
3 1.0
4 1.0
5 1.0
6 1.0
7 1.0
8 1.0
9 1.0
10 1.0
11 1.0
12 1.0
13 1.0
14 1.0
15 1.0
16 1.0
17 1.0
18 1.0
19 1.0
20 1.0
21 1.0
22 1.0
This diff is collapsed.
507 States
22 Actions (Items)
5 user profiles
2 history length
1.100000 alpha
3 product clustering level
-----> Load and Cluster products
22 product profiles (1561 products)
> Periodicals: 1.60%
> Dairy: 6.41%
> Carousel: 0.32%
> Checkout: 0.64%
> Breakfast Foods: 1.28%
> Deli: 4.48%
> Eggs: 1.60%
> Beverages: 5.12%
> Produce: 14.09%
> Alcoholic Beverages: 2.56%
> Frozen Foods: 9.93%
> Canned Products: 0.64%
> Meat: 0.64%
> Seafood: 0.64%
> Health and Hygiene: 6.09%
> Snacks: 2.56%
> Household: 10.25%
> Snack Foods: 11.53%
> Baking Goods: 7.69%
> Canned Foods: 7.05%
> Starchy Foods: 1.92%
> Baked Goods: 2.88%
-----> [Optional] Export states description
-----> Load user sessions and shop profits 
-----> Reward function
507 States in the database
22 Actions in the database
-----> Clustering
Create cluster 0 with mean perplexity 16.479
Create cluster 1 with mean perplexity 11.294
Create cluster 2 with mean perplexity 14.826
Create cluster 3 with mean perplexity 12.220
Create cluster 4 with mean perplexity 14.100
-----> Probability inference
-----> End
All outputs are in /home/amelie/Rotations/ChatterjeeRotation/Code/Models/Foodmart523/foodmart_u5_k2_pl3
This diff is collapsed.
Item 0
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
\ No newline at end of file
0 1 1
1 1 1
2 1 1
3 1 1
4 1 1
5 1 1
6 1 1
7 1 1
8 1 1
9 1 1
\ No newline at end of file
1 1.00000
2 1.00000
3 1.00000
4 1.00000
5 1.00000
6 1.00000
7 1.00000
8 1.00000
9 1.00000
10 1.00000
111 States
10 Actions (Items)
10 user profiles
2 history length
10 product clustering level
-----> Test sequences generation
-----> Rewards generation
-----> Probability inference
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -230,7 +230,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Extract POMDP transition probabilities from the Foodmart dataset.')
parser.add_argument('-in', '--data', type=str, default=os.path.join(base_folder, "Data", "Foodmart", "data"), help="Path to data directory or archive.")
parser.add_argument('-o', '--output', type=str, default=os.path.join(base_folder, "Code", "Models"), help="Path to output directory.")
parser.add_argument('-u', '--ulevel', type=int, default=3, help="Number of environments to create.")
parser.add_argument('-u', '--ulevel', type=int, default=5, help="Number of environments to create.")
parser.add_argument('-p', '--plevel', type=int, default=4, help="Clustering level for product categorization (0: no lumping to 4:lumping by family). See product classes hierarchy.")
parser.add_argument('-k', '--history', type=int, default=2, help="Length of the history to consider for one state of the MEMDP.")
parser.add_argument('-D', '--D', type=int, default=500, help="Number of sequences to keep to estimate each environment's transition function.")
......
......@@ -126,13 +126,36 @@ The following variables can be configured at the beginning of the ``run.sh`` scr
#### examples
synthetic recommandations, 10 environments, 10 actions, ~100 states
```bash
cd Data/
python prepare_synth.py --norm --zip -n 10 -k 2
cd ../Code/
./run.sh -m mdp -d rd -n 10 -k 2 -c
./run.sh -m pamcp -d rd -n 10 -k 2 -c
```
* if needed, generate the data (already available on the repository)
```bash
cd Data/
python prepare_synth.py --norm --zip -n 10 -k 2
```
* run the code
```bash
cd ../Code/
./run.sh -m mdp -d rd -n 10 -k 2 -c
./run.sh -m pamcp -d rd -n 10 -k 2 -c
```
Foodmart recommandations, 5 environments, 22 actions, ~500 states
* if needed, generate the data (already available on the repository)
```bash
cd Data/
python prepare_foodmart.py --norm --zip -u 5 -p 3 -k 2
```
* run the code
```bash
cd ../Code/
./run.sh -m mdp -d fm -n 3 -k 2 -u 5 -c
./run.sh -m pamcp -d rd -n 3 -k 2 -u 5 -c
./run.sh -m pbvi -d rd -n 3 -k 2 -u 5 -c
```
# Known issues
* When using the ``--zip`` option for data generation, it might be necessary to run the script with ``python3`` due to an [issue](https://bugs.python.org/issue23306) with the gzip library in python < 3.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment