{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "68bddf84-439e-461b-b7f9-4c9212ca81f5", "metadata": {}, "outputs": [], "source": [ "%%capture --no-display\n", "pip install gradio\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "d692b9ae-c7d4-40b6-9777-992a4303055b", "metadata": {}, "outputs": [], "source": [ "import gradio as gr" ] }, { "cell_type": "code", "execution_count": 3, "id": "9742e1cb-7e40-4af9-8c59-6a341c9d9b38", "metadata": {}, "outputs": [], "source": [ "import pickle\n", "import pandas as pd\n", "import shap\n", "from shap.plots._force_matplotlib import draw_additive_plot\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler # Importing function for scaling the data" ] }, { "cell_type": "markdown", "id": "7ab0387d-3a31-4164-a46e-b1bb57dbf33a", "metadata": {}, "source": [ "# App Code" ] }, { "cell_type": "code", "execution_count": 4, "id": "b168e539-83f7-4bb6-a112-fe8de8fdab52", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('WellBeing',\n", " 'SupportiveGM',\n", " 'Engagement',\n", " 'Workload',\n", " 'WorkEnvironment',\n", " 'Merit')" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'WellBeing', 'SupportiveGM', 'Engagement', 'Workload', 'WorkEnvironment', 'Merit'" ] }, { "cell_type": "code", "execution_count": 5, "id": "fc97600d-3c32-4d66-a60e-b416c170293b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "* Running on local URL: http://127.0.0.1:7860\n", "* Running on public URL: https://35c8546aedfc1b28e8.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "{icon} Each 0.1-point increase in {feature} {effect} by {abs(impact)}%.
\"\n", " insights_html += \"\n", " {risk_html}\n", " | \n", "\n", " Key Insights:\n", " {insights_html}\n", " | \n", "