After installing ValidMind, you’ll want to periodically make sure you are on the latest version to access any new features and other enhancements.
\n",
- "\n",
- "Retrieve the information for the currently installed version of ValidMind:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "%pip show validmind"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "If the version returned is lower than the version indicated in our [production open-source code](https://github.com/validmind/validmind-library/blob/prod/validmind/__version__.py), restart your notebook and run:\n",
- "\n",
- "```bash\n",
- "%pip install --upgrade validmind\n",
- "```"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "You may need to restart your kernel after running the upgrade package for changes to be applied."
+ "This notebook is outdated — please refer to the new [**Quickstart for model documentation**](../quickstart/quickstart_model_documentation.ipynb) instead."
]
}
],
diff --git a/notebooks/code_samples/quickstart_model_documentation.ipynb b/notebooks/quickstart/quickstart_model_documentation.ipynb
similarity index 88%
rename from notebooks/code_samples/quickstart_model_documentation.ipynb
rename to notebooks/quickstart/quickstart_model_documentation.ipynb
index cf3467117..d261fa185 100644
--- a/notebooks/code_samples/quickstart_model_documentation.ipynb
+++ b/notebooks/quickstart/quickstart_model_documentation.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "21a28d0f",
+ "id": "930f895c",
"metadata": {},
"source": [
"# Quickstart for model documentation\n",
@@ -19,9 +19,54 @@
},
{
"cell_type": "markdown",
- "id": "5928bca4",
+ "id": "f52d9a79",
+ "metadata": {},
+ "source": [
+ "::: {.content-hidden when-format=\"html\"}\n",
+ "## Contents \n",
+ "- [Introduction](#toc1_) \n",
+ "- [About ValidMind](#toc2_) \n",
+ " - [Before you begin](#toc2_1_) \n",
+ " - [New to ValidMind?](#toc2_2_) \n",
+ " - [Key concepts](#toc2_3_) \n",
+ "- [Setting up](#toc3_) \n",
+ " - [Install the ValidMind Library](#toc3_1_) \n",
+ " - [Initialize the ValidMind Library](#toc3_2_) \n",
+ " - [Get your code snippet](#toc3_2_1_) \n",
+ " - [Initialize the Python environment](#toc3_3_) \n",
+ "- [Getting to know ValidMind](#toc4_) \n",
+ " - [Preview the documentation template](#toc4_1_) \n",
+ " - [View model documentation in the ValidMind Platform](#toc4_2_) \n",
+ "- [Import the sample dataset](#toc5_) \n",
+ "- [Preprocess the raw dataset](#toc6_) \n",
+ "- [Initialize the ValidMind datasets](#toc7_) \n",
+ "- [Initialize a model object](#toc8_) \n",
+ " - [Assign predictions](#toc8_1_) \n",
+ "- [Run the full suite of tests](#toc9_) \n",
+ "- [In summary](#toc10_) \n",
+ "- [Next steps](#toc11_) \n",
+ " - [Work with your model documentation](#toc11_1_) \n",
+ " - [Discover more learning resources](#toc11_2_) \n",
+ "- [Upgrade ValidMind](#toc12_) \n",
+ "\n",
+ ":::\n",
+ "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "dc60685b",
"metadata": {},
"source": [
+ "Recommended Python versions\n",
@@ -128,7 +184,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "install-python-ebd70fee-b6be-462e-a43a-fbe14f18fb62",
+ "id": "137a184c",
"metadata": {},
"outputs": [],
"source": [
@@ -137,9 +193,11 @@
},
{
"cell_type": "markdown",
- "id": "install-initialize-3db79826-578b-48d3-8cca-3f3e69bd0ada",
+ "id": "fcba7f6a",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### 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."
@@ -147,9 +205,10 @@
},
{
"cell_type": "markdown",
- "id": "install-snippet-6eafc0c3-27cc-4e1e-8179-7dff1686d8d4",
"metadata": {},
"source": [
+ "
\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",
@@ -185,7 +244,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "install-init-a90debbe-251c-46cc-b9ea-5c8588467df6",
+ "id": "676525d3",
"metadata": {},
"outputs": [],
"source": [
@@ -208,9 +267,10 @@
},
{
"cell_type": "markdown",
- "id": "aa61686d",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### Initialize the Python environment\n",
"\n",
"Next, let's import the necessary libraries and set up your Python environment for data analysis:\n",
@@ -222,7 +282,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "881f26af",
+ "id": "16d6590c",
"metadata": {},
"outputs": [],
"source": [
@@ -233,17 +293,20 @@
},
{
"cell_type": "markdown",
- "id": "7fc8ea4c",
+ "id": "3b712d70",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Getting to know ValidMind"
]
},
{
"cell_type": "markdown",
- "id": "af99b2cb",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### Preview the documentation template\n",
"\n",
"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",
@@ -254,7 +317,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "a14b9091",
+ "id": "ebe60f73",
"metadata": {},
"outputs": [],
"source": [
@@ -263,9 +326,11 @@
},
{
"cell_type": "markdown",
- "id": "d155b6a4",
+ "id": "19b4bc15",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### View model documentation in the ValidMind Platform\n",
"\n",
"Next, let's head to the ValidMind Platform to see the template in action:\n",
@@ -279,9 +344,10 @@
},
{
"cell_type": "markdown",
- "id": "bd309b56",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Import the sample dataset\n",
"\n",
"First, let's import the public [Bank Customer Churn Prediction](https://www.kaggle.com/datasets/shantanudhakadd/bank-customer-churn-prediction) dataset from Kaggle so that we have something to work with.\n",
@@ -295,7 +361,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "c952eb18",
+ "id": "fe4b41d1",
"metadata": {},
"outputs": [],
"source": [
@@ -311,9 +377,10 @@
},
{
"cell_type": "markdown",
- "id": "7a87224a",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Preprocess the raw dataset\n",
"\n",
"Next, let's preprocess the imported dataset to get ready for running tests with ValidMind:\n",
@@ -332,17 +399,39 @@
"metadata": {},
"outputs": [],
"source": [
- "train_df, validation_df, test_df = customer_churn.preprocess(raw_df)\n",
- "\n",
+ "# Split the datasets\n",
+ "train_df, validation_df, test_df = customer_churn.preprocess(raw_df)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "14a41fec",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Separate features and targets\n",
"x_train = train_df.drop(customer_churn.target_column, axis=1)\n",
"y_train = train_df[customer_churn.target_column]\n",
"x_val = validation_df.drop(customer_churn.target_column, axis=1)\n",
- "y_val = validation_df[customer_churn.target_column]\n",
- "\n",
+ "y_val = validation_df[customer_churn.target_column]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "d2d98065",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Initialize XGBoost classifier\n",
"model = xgb.XGBClassifier(early_stopping_rounds=10)\n",
+ "\n",
+ "# Set evaluation metrics\n",
"model.set_params(\n",
" eval_metric=[\"error\", \"logloss\", \"auc\"],\n",
")\n",
+ "# Fit the model\n",
"model.fit(\n",
" x_train,\n",
" y_train,\n",
@@ -353,9 +442,10 @@
},
{
"cell_type": "markdown",
- "id": "5c9071d6",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Initialize the ValidMind datasets\n",
"\n",
"Before you can run tests with your preprocessed datasets, you must first initialize a ValidMind `Dataset` object using the [`init_dataset`](https://docs.validmind.ai/validmind/validmind.html#init_dataset) function from the ValidMind (`vm`) module. **This step is always necessary every time you want to connect a dataset to documentation and produce test results through ValidMind,** but you only need to do it once per dataset.\n",
@@ -371,7 +461,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "df034911",
+ "id": "6044e6fd",
"metadata": {},
"outputs": [],
"source": [
@@ -400,9 +490,10 @@
},
{
"cell_type": "markdown",
- "id": "a14260db",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Initialize a model object\n",
"\n",
"You'll also need to initialize a ValidMind model object (`vm_model`) that can be passed to other functions for analysis and tests on the data for our model.\n",
@@ -413,7 +504,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "f6a7c68c",
+ "id": "65cac73f",
"metadata": {},
"outputs": [],
"source": [
@@ -425,9 +516,10 @@
},
{
"cell_type": "markdown",
- "id": "42b74d2e",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### Assign predictions\n",
"\n",
"Once the model has been registered you can assign model predictions to the training and testing datasets.\n",
@@ -441,7 +533,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "17c7411a",
+ "id": "efccd449",
"metadata": {},
"outputs": [],
"source": [
@@ -456,9 +548,10 @@
},
{
"cell_type": "markdown",
- "id": "443e914d",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Run the full suite of tests\n",
"\n",
"This is where it all comes together — you are now ready to **run the documentation tests for the model as defined by the documentation template** you looked at earlier.\n",
@@ -515,7 +608,7 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "8174830b",
+ "id": "4fa0d340",
"metadata": {},
"outputs": [],
"source": [
@@ -524,9 +617,11 @@
},
{
"cell_type": "markdown",
- "id": "e5401c1f",
+ "id": "52170211",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## In summary\n",
"\n",
"In this notebook, you learned how to:\n",
@@ -542,9 +637,11 @@
},
{
"cell_type": "markdown",
- "id": "next-steps-9782d94b-b8dd-4894-b7ca-c3d92ec548fd",
+ "id": "81c2798e",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Next steps\n",
"\n",
"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."
@@ -552,9 +649,11 @@
},
{
"cell_type": "markdown",
- "id": "next-docs-bdd1e7e2-32f7-4a95-b39f-e8b4aa2e1214",
+ "id": "4336ff4b",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### Work with your model documentation\n",
"\n",
"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",
@@ -566,9 +665,11 @@
},
{
"cell_type": "markdown",
- "id": "next-resources-9214c11f-23b8-48d3-8c56-e96c675dea8c",
+ "id": "b5a53889",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"### Discover more learning resources\n",
"\n",
"For a more in-depth introduction to using the ValidMind Library for development, check out our introductory development series and the accompanying interactive training:\n",
@@ -586,9 +687,10 @@
},
{
"cell_type": "markdown",
- "id": "upgrade-vm-5193df48-8e35-43df-9f30-76c1156707a2",
"metadata": {},
"source": [
+ "
\n",
+ "\n",
"## Upgrade ValidMind\n",
"\n",
"
After installing ValidMind, you’ll want to periodically make sure you are on the latest version to access any new features and other enhancements.
\n",
From a9ae24c063b6f8dd6f0a0729e67aae37e1ffad92 Mon Sep 17 00:00:00 2001
From: Beck <164545837+validbeck@users.noreply.github.com>
Date: Wed, 14 May 2025 08:47:37 -0700
Subject: [PATCH 08/26] Editing
---
.../quickstart_model_documentation.ipynb | 217 ++++++++++++------
1 file changed, 153 insertions(+), 64 deletions(-)
diff --git a/notebooks/quickstart/quickstart_model_documentation.ipynb b/notebooks/quickstart/quickstart_model_documentation.ipynb
index d261fa185..d0acdd4ca 100644
--- a/notebooks/quickstart/quickstart_model_documentation.ipynb
+++ b/notebooks/quickstart/quickstart_model_documentation.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
- "id": "930f895c",
+ "id": "f2c17b2d",
"metadata": {},
"source": [
"# Quickstart for model documentation\n",
@@ -12,14 +12,14 @@
"To document a model with the ValidMind Library, we'll:\n",
"\n",
"1. Import a sample dataset and preprocess it\n",
- "2. Split the dataset into training and testing datasets and initialize them for use with ValidMind\n",
+ "2. Split the datasets and initialize them for use with ValidMind\n",
"3. Initialize a model object for use with testing\n",
"4. Run a full suite of tests as defined by our documentation template, which will send the results of those tests to the ValidMind Platform"
]
},
{
"cell_type": "markdown",
- "id": "f52d9a79",
+ "id": "05dce32a",
"metadata": {},
"source": [
"::: {.content-hidden when-format=\"html\"}\n",
@@ -38,16 +38,21 @@
" - [Preview the documentation template](#toc4_1_) \n",
" - [View model documentation in the ValidMind Platform](#toc4_2_) \n",
"- [Import the sample dataset](#toc5_) \n",
- "- [Preprocess the raw dataset](#toc6_) \n",
- "- [Initialize the ValidMind datasets](#toc7_) \n",
- "- [Initialize a model object](#toc8_) \n",
- " - [Assign predictions](#toc8_1_) \n",
- "- [Run the full suite of tests](#toc9_) \n",
- "- [In summary](#toc10_) \n",
- "- [Next steps](#toc11_) \n",
- " - [Work with your model documentation](#toc11_1_) \n",
- " - [Discover more learning resources](#toc11_2_) \n",
- "- [Upgrade ValidMind](#toc12_) \n",
+ "- [Preprocessing the raw dataset](#toc6_) \n",
+ " - [Split the dataset](#toc6_1_) \n",
+ " - [Separate features and targets](#toc6_2_) \n",
+ "- [Training an XGBoost classifier model](#toc7_) \n",
+ " - [Set evaluation metrics](#toc7_1_) \n",
+ " - [Fit the model](#toc7_2_) \n",
+ "- [Initialize the ValidMind datasets](#toc8_) \n",
+ "- [Initialize a model object](#toc9_) \n",
+ " - [Assign predictions](#toc9_1_) \n",
+ "- [Run the full suite of tests](#toc10_) \n",
+ "- [In summary](#toc11_) \n",
+ "- [Next steps](#toc12_) \n",
+ " - [Work with your model documentation](#toc12_1_) \n",
+ " - [Discover more learning resources](#toc12_2_) \n",
+ "- [Upgrade ValidMind](#toc13_) \n",
"\n",
":::\n",
"