{ "cells": [ { "cell_type": "markdown", "id": "b45defa6", "metadata": {}, "source": [ "# Link Plots to Features" ] }, { "cell_type": "markdown", "id": "d5ffb291", "metadata": {}, "source": [ "`Rubicon_ml` makes it easy to log plots with features and artifacts. In this example we'll walk through creating a feature dependency plot using the `shap` package and saving it to an artifact.\n", "\n", "Before getting started, we'll have to install some dependencies for this example." ] }, { "cell_type": "code", "execution_count": 1, "id": "e93423ad-ca93-415d-8dc0-051ce24f53c2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: matplotlib in /Users/nvd215/mambaforge/envs/rubicon-ml-dev/lib/python3.10/site-packages (3.6.1)\n", "Requirement already satisfied: kaleido in /Users/nvd215/mambaforge/envs/rubicon-ml-dev/lib/python3.10/site-packages (0.2.1)\n", "Requirement already satisfied: Pillow in /Users/nvd215/mambaforge/envs/rubicon-ml-dev/lib/python3.10/site-packages (9.2.0)\n", "Requirement already satisfied: shap in /Users/nvd215/mambaforge/envs/rubicon-ml-dev/lib/python3.10/site-packages (0.41.0)\n", "Requirement already satisfied: numba>=0.56.2 in /Users/nvd215/mambaforge/envs/rubicon-ml-dev/lib/python3.10/site-packages (0.56.2)\n" ] } ], "source": [ "! pip install matplotlib kaleido Pillow shap \"numba>=0.56.2\"" ] }, { "cell_type": "markdown", "id": "0e6c4ba0", "metadata": {}, "source": [ "## Set up\n", "First lets create a Rubicon `project` and create a pipeline with `rubicon_ml.sklearn.pipeline`." ] }, { "cell_type": "code", "execution_count": 2, "id": "932d5223", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
RubiconPipeline(project=<rubicon_ml.client.project.Project object at 0x167a37c40>,\n", " steps=[('gradientboostingregressor',\n", " GradientBoostingRegressor(random_state=1))])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
RubiconPipeline(project=<rubicon_ml.client.project.Project object at 0x167a37c40>,\n", " steps=[('gradientboostingregressor',\n", " GradientBoostingRegressor(random_state=1))])
GradientBoostingRegressor(random_state=1)