Project
object.\n",
"- A DataRobot Model
object.\n",
"\n",
"Small adjustments may be needed depending on the Python version and DataRobot API version you are using."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Import libraries"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import datarobot as dr\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"import seaborn as sns\n",
"\n",
"sns.set_style(\"ticks\")\n",
"sns.set_context(\"poster\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Connect to DataRobot\n",
"\n",
"Read more about different options for [connecting to DataRobot from the client](https://docs.datarobot.com/en/docs/api/api-quickstart/api-qs.html)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# If the config file is not in the default location described in the API Quickstart guide, '~/.config/datarobot/drconfig.yaml', then you will need to call\n",
"# dr.Client(config_path='path-to-drconfig.yaml')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Select models\n",
"\n",
"For this workflow, select the top five performing models from the project."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"project = dr.Project.get(project_id=\"\n", " | featureName | \n", "impactNormalized | \n", "impactUnnormalized | \n", "redundantWith | \n", "model_type | \n", "model_id | \n", "rank | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "number_inpatient | \n", "1.000000 | \n", "0.031445 | \n", "None | \n", "eXtreme Gradient Boosted Trees Classifier with... | \n", "5e620be2d7c7a80c003d16a2 | \n", "0 | \n", "
1 | \n", "discharge_disposition_id | \n", "0.950723 | \n", "0.029896 | \n", "None | \n", "eXtreme Gradient Boosted Trees Classifier with... | \n", "5e620be2d7c7a80c003d16a2 | \n", "1 | \n", "
2 | \n", "medical_specialty | \n", "0.828289 | \n", "0.026046 | \n", "None | \n", "eXtreme Gradient Boosted Trees Classifier with... | \n", "5e620be2d7c7a80c003d16a2 | \n", "2 | \n", "
3 | \n", "number_diagnoses | \n", "0.609419 | \n", "0.019163 | \n", "None | \n", "eXtreme Gradient Boosted Trees Classifier with... | \n", "5e620be2d7c7a80c003d16a2 | \n", "3 | \n", "
4 | \n", "num_lab_procedures | \n", "0.543238 | \n", "0.017082 | \n", "None | \n", "eXtreme Gradient Boosted Trees Classifier with... | \n", "5e620be2d7c7a80c003d16a2 | \n", "4 | \n", "