Skip to content

Commit 613356c

Browse files
authored
notebooks: Update templates & notebooks with 'document' parameter in vm.init() (#486)
* Setup for adjusting templates * Edit * Edit * Edit * Monitoring template * Separating out about validmind * Proofreading * Cell IDs * Need to fix template issue * Hmm * should work now? * Role/document type selection function * Testing * Updating About ValidMind function * Updating Installation funciton pt1 * Installation choice setup function * Save point * Editing Setup instructions function pt2 * Editing Next steps function * Cleaning up the notebook * Editing README * Formatting * Trying again * One last formatting thing * Hm, I lied * DHFJKSD * Adjustment for monitoring about * Adjustment for monitoring install * Edit * Monitoring notebooks edited * Edit * Validation + edit * Edit... * Validation tutorial * Quickstarts done * Tutorials done * Proofreading * Save point * Save point * Save point * Save point * Save point * Save point * Save point * Save point * Save point * Save point * Save point * Cleanup
1 parent ef050c0 commit 613356c

74 files changed

Lines changed: 2447 additions & 904 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

notebooks/code_sharing/clustering/quickstart_cluster_demo.ipynb

Lines changed: 110 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,68 +34,100 @@
3434
]
3535
},
3636
{
37-
"attachments": {},
3837
"cell_type": "markdown",
39-
"metadata": {
40-
"id": "ZNcbDRubSPc1"
41-
},
38+
"id": "setup-intro",
39+
"metadata": {},
4240
"source": [
43-
"## Before you begin\n",
44-
"\n",
45-
"To use the ValidMind Library with a Jupyter notebook, you need to install and initialize the ValidMind Library first, along with getting your Python environment ready. When running this notebook locally, this includes installing any missing prerequisite modules that you discover with `pip install`. "
41+
"## Setting up"
4642
]
4743
},
4844
{
49-
"attachments": {},
5045
"cell_type": "markdown",
46+
"id": "setup-install",
5147
"metadata": {},
5248
"source": [
53-
"## Install the ValidMind Library\n",
49+
"### Install the ValidMind Library\n",
50+
"\n",
51+
"<div class=\"alert alert-block alert-info\" style=\"background-color: #B5B5B510; color: black; border: 1px solid #083E44; border-left-width: 5px; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);border-radius: 5px;\"><span style=\"color: #083E44;\"><b>Recommended Python versions</b></span>\n",
52+
"<br></br>\n",
53+
"Python 3.8 <= x <= 3.11</div>\n",
5454
"\n",
5555
"To install the library:"
5656
]
5757
},
5858
{
5959
"cell_type": "code",
6060
"execution_count": null,
61-
"metadata": {
62-
"id": "6G5-kHOZ7YWk"
63-
},
61+
"id": "install-code",
62+
"metadata": {},
6463
"outputs": [],
6564
"source": [
6665
"%pip install -q validmind"
6766
]
6867
},
6968
{
70-
"attachments": {},
7169
"cell_type": "markdown",
72-
"metadata": {
73-
"id": "_ZqI8W5jSPc1"
74-
},
70+
"id": "setup-initialize",
71+
"metadata": {},
7572
"source": [
76-
"## Initialize the ValidMind Library\n",
77-
"\n",
78-
"ValidMind generates a unique _code snippet_ for each registered model to connect with your developer environment. You initialize the ValidMind Library with this code snippet, which ensures that your documentation and tests are uploaded to the correct model when you run the notebook.\n",
73+
"### Initialize the ValidMind Library"
74+
]
75+
},
76+
{
77+
"cell_type": "markdown",
78+
"id": "register-model",
79+
"metadata": {},
80+
"source": [
81+
"#### Register sample model\n",
7982
"\n",
80-
"### Get your code snippet\n",
83+
"Let's first register a sample model for use with this notebook.\n",
8184
"\n",
8285
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
8386
"\n",
84-
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
87+
"2. In the left sidebar, navigate to **Inventory** and click **+ Register Model**.\n",
8588
"\n",
86-
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
89+
"3. Enter the model details and click **Next >** to continue to assignment of model stakeholders. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
8790
"\n",
88-
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
91+
"4. Select your own name under the **MODEL OWNER** drop-down.\n",
8992
"\n",
90-
"Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/model-documentation/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:"
93+
"5. Click **Register Model** to add the model to your inventory."
94+
]
95+
},
96+
{
97+
"cell_type": "markdown",
98+
"id": "apply-template",
99+
"metadata": {},
100+
"source": [
101+
"#### Apply documentation template\n",
102+
"\n",
103+
"Once you've registered your model, let's select a documentation template. A template predefines sections for your model documentation and provides a general outline to follow, making the documentation process much easier.\n",
104+
"\n",
105+
"1. In the left sidebar that appears for your model, click **Documents** and select **Development**.\n",
106+
"\n",
107+
"2. Under **TEMPLATE**, select `{template}`.\n",
108+
"\n",
109+
"3. Click **Use Template** to apply the template."
110+
]
111+
},
112+
{
113+
"cell_type": "markdown",
114+
"id": "code-snippet",
115+
"metadata": {},
116+
"source": [
117+
"#### Get your code snippet\n",
118+
"\n",
119+
"Initialize the ValidMind Library with the *code snippet* unique to each model per document, ensuring your test results are uploaded to the correct model and automatically populated in the right document in the ValidMind Platform when you run this notebook.\n",
120+
"\n",
121+
"1. On the left sidebar that appears for your model, select **Getting Started** and select `Development` from the **DOCUMENT** drop-down menu.\n",
122+
"2. Click **Copy snippet to clipboard**.\n",
123+
"3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/model-documentation/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:"
91124
]
92125
},
93126
{
94127
"cell_type": "code",
95128
"execution_count": null,
96-
"metadata": {
97-
"id": "5hqGn9jHSPc2"
98-
},
129+
"id": "initialize-code",
130+
"metadata": {},
99131
"outputs": [],
100132
"source": [
101133
"# Load your model identifier credentials from an `.env` file\n",
@@ -112,10 +144,32 @@
112144
" # api_key=\"...\",\n",
113145
" # api_secret=\"...\",\n",
114146
" # model=\"...\",\n",
115-
" #document=\"documentation\",\n",
147+
" document=\"documentation\",\n",
116148
")"
117149
]
118150
},
151+
{
152+
"cell_type": "markdown",
153+
"id": "preview-template",
154+
"metadata": {},
155+
"source": [
156+
"### Preview the documentation template\n",
157+
"\n",
158+
"Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your model. A template predefines sections for your model documentation and provides a general outline to follow, making the documentation process much easier.\n",
159+
"\n",
160+
"You will upload documentation and test results unique to your model based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:"
161+
]
162+
},
163+
{
164+
"cell_type": "code",
165+
"execution_count": null,
166+
"id": "template-code",
167+
"metadata": {},
168+
"outputs": [],
169+
"source": [
170+
"vm.preview_template()"
171+
]
172+
},
119173
{
120174
"attachments": {},
121175
"cell_type": "markdown",
@@ -390,24 +444,43 @@
390444
]
391445
},
392446
{
393-
"attachments": {},
394447
"cell_type": "markdown",
448+
"id": "next-steps",
395449
"metadata": {},
396450
"source": [
397451
"## Next steps\n",
398452
"\n",
399-
"You can look at the results of this test suite right in the notebook where you ran the code, as you would expect. But there is a better way: view the test results as part of your model documentation right in the ValidMind Platform: \n",
453+
"You can look at the output produced by the ValidMind Library right in the notebook where you ran the code, as you would expect. But there is a better way — use the ValidMind Platform to work with your model documentation."
454+
]
455+
},
456+
{
457+
"cell_type": "markdown",
458+
"id": "next-document",
459+
"metadata": {},
460+
"source": [
461+
"### Work with your model documentation\n",
462+
"\n",
463+
"1. From the **Inventory** in the ValidMind Platform, go to the model you registered earlier. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/working-with-model-inventory.html))\n",
464+
"\n",
465+
"2. In the left sidebar that appears for your model, click **Development** under Documents.\n",
400466
"\n",
401-
"1. In the ValidMind Platform, click **Documentation** under Documents for the model you registered earlier. ([Need more help?](https://docs.validmind.ai/guide/model-documentation/working-with-model-documentation.html)\n",
467+
"What you see is the full draft of your model documentation in a more easily consumable version. From here, you can make qualitative edits to model documentation, view guidelines, collaborate with validators, and submit your model documentation for approval when it's ready. [Learn more ...](https://docs.validmind.ai/guide/working-with-model-documentation.html)"
468+
]
469+
},
470+
{
471+
"cell_type": "markdown",
472+
"id": "next-resources",
473+
"metadata": {},
474+
"source": [
475+
"### Discover more learning resources\n",
402476
"\n",
403-
"2. Expand the following sections and take a look around:\n",
404-
" \n",
405-
" - **2. Data Preparation**\n",
406-
" - **3. Model Development**\n",
477+
"We offer many interactive notebooks to help you automate testing, documenting, validating, and more:\n",
407478
"\n",
408-
"What you can see now is a much more easily consumable version of the documentation, including the results of the tests you just performed, along with other parts of your model documentation that still need to be completed. There is a wealth of information that gets uploaded when you run the full test suite, so take a closer look around, especially at test results that might need attention (hint: some of the tests in 2.1 Data description look like they need some attention).\n",
479+
"- [Run tests & test suites](https://docs.validmind.ai/developer/how-to/testing-overview.html)\n",
480+
"- [Use ValidMind Library features](https://docs.validmind.ai/developer/how-to/feature-overview.html)\n",
481+
"- [Code samples by use case](https://docs.validmind.ai/guide/samples-jupyter-notebooks.html)\n",
409482
"\n",
410-
"If you want to learn more about where you are in the model documentation process, take a look at our documentation on the [ValidMind Library](https://docs.validmind.ai/developer/validmind-library.html).\n"
483+
"Or, visit our [documentation](https://docs.validmind.ai/) to learn more about ValidMind."
411484
]
412485
},
413486
{

notebooks/code_sharing/credit_risk/assign_prediction_probabilities.ipynb

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,17 @@
6868
"\n",
6969
"### Install the ValidMind Library\n",
7070
"\n",
71+
"<div class=\"alert alert-block alert-info\" style=\"background-color: #B5B5B510; color: black; border: 1px solid #083E44; border-left-width: 5px; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);border-radius: 5px;\"><span style=\"color: #083E44;\"><b>Recommended Python versions</b></span>\n",
72+
"<br></br>\n",
73+
"Python 3.8 <= x <= 3.11</div>\n",
74+
"\n",
7175
"To install the library:"
7276
]
7377
},
7478
{
7579
"cell_type": "code",
7680
"execution_count": null,
81+
"id": "install-code",
7782
"metadata": {},
7883
"outputs": [],
7984
"source": [
@@ -97,7 +102,7 @@
97102
"\n",
98103
"#### Register sample model\n",
99104
"\n",
100-
"Let's first register a sample model for use with this notebook:\n",
105+
"Let's first register a sample model for use with this notebook.\n",
101106
"\n",
102107
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
103108
"\n",
@@ -120,7 +125,7 @@
120125
"\n",
121126
"Once you've registered your model, let's select a documentation template. A template predefines sections for your model documentation and provides a general outline to follow, making the documentation process much easier.\n",
122127
"\n",
123-
"1. In the left sidebar that appears for your model, click **Documents** and select **Documentation**.\n",
128+
"1. In the left sidebar that appears for your model, click **Documents** and select **Development**.\n",
124129
"\n",
125130
"2. Under **TEMPLATE**, select `Binary classification`.\n",
126131
"\n",
@@ -135,15 +140,17 @@
135140
"\n",
136141
"#### Get your code snippet\n",
137142
"\n",
138-
"ValidMind generates a unique _code snippet_ for each registered model to connect with your developer environment. You initialize the ValidMind Library with this code snippet, which ensures that your documentation and tests are uploaded to the correct model when you run the notebook.\n",
143+
"Initialize the ValidMind Library with the *code snippet* unique to each model per document, ensuring your test results are uploaded to the correct model and automatically populated in the right document in the ValidMind Platform when you run this notebook.\n",
139144
"\n",
140-
"1. On the left sidebar that appears for your model, select **Getting Started** and click **Copy snippet to clipboard**.\n",
141-
"2. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/model-documentation/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:"
145+
"1. On the left sidebar that appears for your model, select **Getting Started** and select `Development` from the **DOCUMENT** drop-down menu.\n",
146+
"2. Click **Copy snippet to clipboard**.\n",
147+
"3. Next, [load your model identifier credentials from an `.env` file](https://docs.validmind.ai/developer/model-documentation/store-credentials-in-env-file.html) or replace the placeholder with your own code snippet:"
142148
]
143149
},
144150
{
145151
"cell_type": "code",
146152
"execution_count": null,
153+
"id": "initialize-code",
147154
"metadata": {},
148155
"outputs": [],
149156
"source": [
@@ -161,7 +168,7 @@
161168
" # api_key=\"...\",\n",
162169
" # api_secret=\"...\",\n",
163170
" # model=\"...\",\n",
164-
" # document=\"documentation\",\n",
171+
" document=\"documentation\",\n",
165172
")"
166173
]
167174
},
@@ -173,14 +180,15 @@
173180
"\n",
174181
"### Preview the documentation template\n",
175182
"\n",
176-
"Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your model.\n",
183+
"Let's verify that you have connected the ValidMind Library to the ValidMind Platform and that the appropriate *template* is selected for your model. A template predefines sections for your model documentation and provides a general outline to follow, making the documentation process much easier.\n",
177184
"\n",
178185
"You will upload documentation and test results unique to your model based on this template later on. For now, **take a look at the default structure that the template provides with [the `vm.preview_template()` function](https://docs.validmind.ai/validmind/validmind.html#preview_template)** from the ValidMind library and note the empty sections:"
179186
]
180187
},
181188
{
182189
"cell_type": "code",
183190
"execution_count": null,
191+
"id": "template-code",
184192
"metadata": {},
185193
"outputs": [],
186194
"source": [
@@ -736,7 +744,6 @@
736744
},
737745
{
738746
"cell_type": "markdown",
739-
"id": "copyright-0871b365e3924d0995a276dbbbcf62c1",
740747
"metadata": {},
741748
"source": [
742749
"<!-- VALIDMIND COPYRIGHT -->\n",

0 commit comments

Comments
 (0)