Skip to content

Commit 3dbc651

Browse files
authored
Merge pull request #37 from diberry/azure-notebook
Azure notebooks changes for tutorials
2 parents 2c9c7dc + de43db3 commit 3dbc651

File tree

9 files changed

+51868
-270
lines changed

9 files changed

+51868
-270
lines changed

samples/azurenotebook/.ipynb_checkpoints/Personalizer-checkpoint.ipynb

Lines changed: 25411 additions & 0 deletions
Large diffs are not rendered by default.

samples/azurenotebook/.ipynb_checkpoints/Personalizer-dina-checkpoint.ipynb

Lines changed: 25423 additions & 0 deletions
Large diffs are not rendered by default.

samples/azurenotebook/Personalization.ipynb

Lines changed: 0 additions & 249 deletions
This file was deleted.

samples/azurenotebook/Personalizer.ipynb

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

samples/azurenotebook/README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1-
Open the Personalization.ipynb in Azure notebooks.
1+
# Personalizer simulation in an Azure notebook
22

3-
Copy actionfeatures.json, example.json, rankrequest.json to the same folder.
3+
This tutorial simulates a Personalizer loop _system_ which suggests which type of coffee a customer should order. The users and their preferences are stored in a [user dataset](usrs.json). Information about the coffee is also available and stored in a [coffee dataset](coffee.json).
44

5-
Make sure you update the personalization_base_url and subscription_key with your valid endpoints. (Please note that after you provision a Personalizer instance, it could take some time for the instance to be ready. Please check the Settings menu blade. If it displays the settings correctly, it means that the instance is ready.)
5+
Run the system for 10,000 requests and then create graph showing how fast and accurately the system learned.
6+
7+
Run an offline counterfactual evaluation to select an optimized learning policy, and apply that policy.
8+
9+
Run the system again, but for 2,000 requests and again create the graph showing the accuracy of the system.
10+
11+
## Prerequisites
12+
13+
* [Azure notebooks](https://notebooks.azure.com/) account
14+
* [Personalizer resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesPersonalizer)
15+
16+
## How to use this sample
17+
18+
All the instructions are in the notebook. Here is an abbreviated explanation.
19+
20+
1. Create a new Azure notebook project.
21+
1. Upload the files in this directory to the Azure notebook project.
22+
1. Open the Personalizer.ipynb file and change the following values:
23+
24+
* The value for `<your-resource-name>` in the `personalization_base_url` to the value for your Personalizer resource
25+
* The value for `<your-resource-key>` variable to one of the Personalizer resource keys.
26+
27+
1. Run each cell from top to bottom. Wait until each cell is complete before running the next cell.
28+
29+
## References
30+
31+
* [Full sample](https://github.com/Azure-Samples/cognitive-services-personalizer-samples/tree/master/samples/azurenotebook)
32+
* [Tutorial on docs.microsoft.com](https://docs.microsoft.com/azure/cognitive-services/personalizer/tutorial-use-azure-notebook-generate-loop-data)
File renamed without changes.

samples/azurenotebook/example.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

samples/azurenotebook/users.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"Alice": {
3+
"Sunny": {
4+
"Morning": "Cold brew",
5+
"Afternoon": "Iced mocha",
6+
"Evening": "Cold brew"
7+
},
8+
"Rainy": {
9+
"Morning": "Latte",
10+
"Afternoon": "Cappucino",
11+
"Evening": "Latte"
12+
},
13+
"Snowy": {
14+
"Morning": "Cappucino",
15+
"Afternoon": "Cappucino",
16+
"Evening": "Cappucino"
17+
}
18+
},
19+
"Bob": {
20+
"Sunny": {
21+
"Morning": "Cappucino",
22+
"Afternoon": "Iced mocha",
23+
"Evening": "Cold brew"
24+
},
25+
"Rainy": {
26+
"Morning": "Latte",
27+
"Afternoon": "Latte",
28+
"Evening": "Latte"
29+
},
30+
"Snowy": {
31+
"Morning": "Iced mocha",
32+
"Afternoon": "Iced mocha",
33+
"Evening": "Iced mocha"
34+
}
35+
},
36+
"Cathy": {
37+
"Sunny": {
38+
"Morning": "Latte",
39+
"Afternoon": "Cold brew",
40+
"Evening": "Cappucino"
41+
},
42+
"Rainy": {
43+
"Morning": "Cappucino",
44+
"Afternoon": "Latte",
45+
"Evening": "Iced mocha"
46+
},
47+
"Snowy": {
48+
"Morning": "Cold brew",
49+
"Afternoon": "Iced mocha",
50+
"Evening": "Cappucino"
51+
}
52+
},
53+
"Dave": {
54+
"Sunny": {
55+
"Morning": "Iced mocha",
56+
"Afternoon": "Iced mocha",
57+
"Evening": "Iced mocha"
58+
},
59+
"Rainy": {
60+
"Morning": "Latte",
61+
"Afternoon": "Latte",
62+
"Evening": "Latte"
63+
},
64+
"Snowy": {
65+
"Morning": "Cappucino",
66+
"Afternoon": "Cappucino",
67+
"Evening": "Cappucino"
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)