Skip to content

Updated "Get your code snippet" section for relevant notebooks #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
" - [Key concepts](#toc1_3_) \n",
"- [Install the ValidMind Library](#toc2_) \n",
"- [Initialize the ValidMind Library](#toc3_) \n",
" - [Get your code snippet](#toc3_1_) \n",
"- [Initialize the Python environment](#toc4_) \n",
" - [Preview the documentation template](#toc4_1_) \n",
"- [Load the sample dataset](#toc5_) \n",
Expand Down Expand Up @@ -154,24 +155,26 @@
"\n",
"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",
"\n",
"Get your code snippet:\n",
"<a id='toc3_1_'></a>\n",
"\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register new model**.\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
" - Documentation template: `Credit Risk Scorecard`\n",
" - Use case: `Risk Management/CECL`\n",
" - Use case: `Credit Risk - CECL`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"Next, replace this placeholder with your own code snippet:"
"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:"
]
},
{
Expand All @@ -180,15 +183,20 @@
"metadata": {},
"outputs": [],
"source": [
"import validmind as vm\n",
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"https://api.prod.validmind.ai/api/v1/tracking\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\"\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Document an Credit Risk Model\n",
"# Document a credit risk model\n",
"\n",
"Build and document an *application scorecard model* with the ValidMind Library by using Kaggle's [Lending Club](https://www.kaggle.com/datasets/devanshi23/loan-data-2007-2014/data) sample dataset to build a simple application scorecard.\n",
"\n",
Expand All @@ -27,6 +27,7 @@
" - [Key concepts](#toc1_3_) \n",
"- [Install the ValidMind Library](#toc2_) \n",
"- [Initialize the ValidMind Library](#toc3_) \n",
" - [Get your code snippet](#toc3_1_) \n",
"- [Initialize the Python environment](#toc4_) \n",
" - [Preview the documentation template](#toc4_1_) \n",
"- [Load the sample dataset](#toc5_) \n",
Expand Down Expand Up @@ -137,24 +138,26 @@
"\n",
"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",
"\n",
"Get your code snippet:\n",
"<a id='toc3_1_'></a>\n",
"\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register new model**.\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
" - Documentation template: `Credit Risk Scorecard`\n",
" - Use case: `Risk Management/CECL`\n",
" - Use case: `Credit Risk - CECL`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"Next, replace this placeholder with your own code snippet:"
"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:"
]
},
{
Expand All @@ -163,13 +166,20 @@
"metadata": {},
"outputs": [],
"source": [
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"https://api.prod.validmind.ai/api/v1/tracking\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\"\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
33 changes: 24 additions & 9 deletions notebooks/code_samples/custom_tests/implement_custom_tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
" - [New to ValidMind?](#toc3_1_) \n",
"- [Install the ValidMind Library](#toc4_) \n",
"- [Initialize the ValidMind Library](#toc5_) \n",
" - [Get your code snippet](#toc5_1_) \n",
"- [Implement a Custom Test](#toc6_) \n",
"- [Run the Custom Test](#toc7_) \n",
" - [Setup the Model and Dataset](#toc7_1_) \n",
Expand Down Expand Up @@ -141,17 +142,26 @@
"\n",
"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",
"\n",
"Get your code snippet:\n",
"<a id='toc5_1_'></a>\n",
"\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register new model**.\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
"3. Enter the model details, making sure to select **Binary classification** as the template and **Marketing/Sales - Attrition/Churn Management** as the use case, and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
" - Documentation template: `Binary classification`\n",
" - Use case: `Marketing/Sales - Attrition/Churn Management`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"Next, replace this placeholder with your own code snippet:\n"
"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:\n"
]
},
{
Expand All @@ -160,15 +170,20 @@
"metadata": {},
"outputs": [],
"source": [
"# Replace with your code snippet\n",
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"...\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\",\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
" - [New to ValidMind?](#toc4_2_) \n",
"- [Install the ValidMind Library](#toc5_) \n",
"- [Initialize the ValidMind Library](#toc6_) \n",
" - [Get your code snippet](#toc6_1_) \n",
"- [Set up custom tests](#toc7_) \n",
"- [Registering the test provider](#toc8_) \n",
" - [Test providers overview](#toc8_1_) \n",
Expand Down Expand Up @@ -154,17 +155,26 @@
"\n",
"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",
"\n",
"Get your code snippet:\n",
"<a id='toc6_1_'></a>\n",
"\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register new model**.\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
"3. Enter the model details, making sure to select the `Attrition/Churn Management` use case, and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
" - Documentation template: `Binary classification`\n",
" - Use case: `Marketing/Sales - Attrition/Churn Management`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"Next, replace this placeholder with your own code snippet:\n"
"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:\n"
]
},
{
Expand All @@ -173,15 +183,20 @@
"metadata": {},
"outputs": [],
"source": [
"# Replace with your code snippet\n",
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"...\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\",\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,24 @@
"\n",
"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",
"\n",
"Get your code snippet:\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register new model**.\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details, making sure to select **LLM-based Text Classification** as the template and **Marketing/Sales - Analytics** as the use case, and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
" - Documentation template: `LLM-based Text Classification`\n",
" - Use case: `Marketing/Sales - Analytics`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"Next, replace this placeholder with your own code snippet:\n"
"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:"
]
},
{
Expand All @@ -85,15 +92,20 @@
"metadata": {},
"outputs": [],
"source": [
"# Replace with your code snippet\n",
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"https://api.prod.validmind.ai/api/v1/tracking\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\",\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,53 @@
"%pip install -q validmind"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initialize the ValidMind Library\n",
"\n",
"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",
"\n",
"### Get your code snippet\n",
"\n",
"1. In a browser, [log in to ValidMind](https://docs.validmind.ai/guide/configuration/log-in-to-validmind.html).\n",
"\n",
"2. In the left sidebar, navigate to **Model Inventory** and click **+ Register Model**.\n",
"\n",
"3. Enter the model details and click **Continue**. ([Need more help?](https://docs.validmind.ai/guide/model-inventory/register-models-in-inventory.html))\n",
"\n",
" For example, to register a model for use with this notebook, select:\n",
"\n",
" - Documentation template: `LLM-based Text Summarization`\n",
"\n",
" You can fill in other options according to your preference.\n",
"\n",
"4. Go to **Getting Started** and click **Copy snippet to clipboard**.\n",
"\n",
"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:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Replace with your code snippet\n",
"# Load your model identifier credentials from an `.env` file\n",
"\n",
"%load_ext dotenv\n",
"%dotenv .env\n",
"\n",
"# Or replace with your code snippet\n",
"\n",
"import validmind as vm\n",
"\n",
"vm.init(\n",
" api_host=\"https://api.prod.validmind.ai/api/v1/tracking\",\n",
" api_key=\"...\",\n",
" api_secret=\"...\",\n",
" model=\"...\",\n",
" # api_host=\"...\",\n",
" # api_key=\"...\",\n",
" # api_secret=\"...\",\n",
" # model=\"...\",\n",
")"
]
},
Expand Down
Loading