{ "cells": [ { "cell_type": "markdown", "id": "a8906e25", "metadata": {}, "source": [ "
\n", " \n", "
\n", "\n", "# Welcome to the `rubicon_ml` examples!\n", "\n", "Try out `rubicon_ml` for yourself without any setup required! If you'd like to learn more about \n", "`rubicon_ml` before getting started, check out the \n", "[documentation on GitHub](https://capitalone.github.io/rubicon-ml/)." ] }, { "cell_type": "markdown", "id": "ff483f5a", "metadata": {}, "source": [ "## Exploring an existing `rubicon_ml` project\n", "\n", "Below we'll explore an existing `rubicon_ml` project using the built-in visualization module to \n", "inspect and analyze some previously trained models.\n", "\n", "[This GitHub repository](https://github.com/ryanSoley/experimenting-with-rubicon) contains\n", "a simple classification model in `my_model/my_model.py`. Over three commits, three\n", "different types of models were used to classify species of penguins by\n", "some physical characteristics. During each model run, `rubicon_ml` was used to log the results.\n", "\n", "The `rubicon_ml` logs from that project have been copied locally into this Binder session. In \n", "a more realistic use case, you may be reading shared `rubicon_ml` logs from S3.\n", "\n", "There are a number of questions you'll be able to answer by using the experiment table below:\n", "* What were the input parameters and output metrics of each model run?\n", "* What type of model did each run use?\n", "* Where is the source code that was used to generate each model run's logs?\n", "* Which model and input parameters produced the best results?\n", "\n", "**Note: `default_server_url` should match the root of the URL currently in your address \n", "bar - change as necessary.**" ] }, { "cell_type": "code", "execution_count": null, "id": "84fa6aae", "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "from rubicon_ml import Rubicon\n", "from rubicon_ml.viz import ExperimentsTable\n", "\n", "\n", "default_server_url = \"https://hub.gke2.mybinder.org/\"\n", "# default_server_url = \"https://hub-binder.mybinder.ovh\"\n", "port = 8050\n", "\n", "requests_pathname_prefix = f\"{os.environ['JUPYTERHUB_SERVICE_PREFIX']}proxy/{port}/\"\n", "\n", "dash_kwargs = {\"requests_pathname_prefix\": requests_pathname_prefix}\n", "run_server_kwargs = {\"proxy\": f\"http://127.0.0.1:{port}::{default_server_url}\", \"port\": port}\n", "\n", "rubicon = Rubicon(persistence=\"filesystem\", root_dir=f\"{os.getcwd()}/rubicon-root\")\n", "project = rubicon.get_project(name=\"Classifying Penguins\")\n", "\n", "experiments_table = ExperimentsTable(experiments=project.experiments())\n", "experiments_table.show(dash_kwargs=dash_kwargs, run_server_kwargs=run_server_kwargs)" ] }, { "cell_type": "markdown", "id": "d4429895", "metadata": {}, "source": [ "## Running Other `rubicon_ml` Examples\n", "\n", "You can run any of the examples from the `rubicon_ml` docs in this Binder session! These examples \n", "will show how to log your own projects and experiments, share and visualize them. Run the cell below \n", "to generate the links to these examples for the current Binder session.\n", "\n", "**Note: The examples in the \"Visualizations\" section will need to be manually updated to provide \n", "the `show` and `serve` methods the same `dash_kwargs` and `run_server_kwargs` arguments as the cell \n", "above.**" ] }, { "cell_type": "code", "execution_count": null, "id": "fa80f31e", "metadata": {}, "outputs": [], "source": [ "session_base_url = os.path.dirname(os.path.dirname(os.path.dirname((\n", " default_server_url + requests_pathname_prefix\n", "))))\n", "\n", "print(f\"Quick Look: \\t{session_base_url}/tree/notebooks/quick-look\")\n", "print(f\"Examples: \\t{session_base_url}/tree/notebooks/logging-examples\")\n", "print(f\"Integrations: \\t{session_base_url}/tree/notebooks/integrations\")\n", "print(f\"Visualizations: {session_base_url}/tree/notebooks/viz\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" } }, "nbformat": 4, "nbformat_minor": 5 }