Package: rubicon-ml
rubicon-mlPurposerubicon-ml is a data science tool that captures and stores model training and
execution information, like parameters and outcomes, in a repeatable and
searchable way. Itsgitintegration associates these inputs and outputs
directly with the model code that produced them to ensure full auditability and
reproducibility for both developers and stakeholders alike. While experimenting,
the dashboard makes it easy to explore, filter, visualize, and share
recorded work.p.s. If you're looking for Rubicon, the Java/ObjC Python bridge, visitthisinstead.Componentsrubicon-ml is composed of three parts:A Python library for storing and retrieving model inputs, outputs, and
analyses to filesystems that’s powered byfsspecA dashboard for exploring, comparing, and visualizing logged data built withdashAnd a process for sharing a selected subset of logged data with collaborators
or reviewers that leveragesintakeWorkflowUserubicon_mlto capture model inputs and outputs over time. It can be
easily integrated into existing Python models or pipelines and supports both
concurrent logging (so multiple experiments can be logged in parallel) and
asynchronous communication with S3 (so network reads and writes won’t block).Meanwhile, periodically review the logged data within the Rubicon dashboard to
steer the model tweaking process in the right direction. The dashboard lets you
quickly spot trends by exploring and filtering your logged results and
visualizes how the model inputs impacted the model outputs.When the model is ready for review, Rubicon makes it easy to share specific
subsets of the data with model reviewers and stakeholders, giving them the
context necessary for a complete model review and approval.UseCheck out theinteractive notebooks in this Binderto tryrubicon_mlfor yourself.Here's a simple example:fromrubicon_mlimportRubiconrubicon=Rubicon(persistence="filesystem",root_dir="/rubicon-root",auto_git_enabled=True)project=rubicon.create_project("Hello World",description="Using rubicon to track model results over time.")experiment=project.log_experiment(training_metadata=[SklearnTrainingMetadata("sklearn.datasets","my-data-set")],model_name="My Model Name",tags=["my_model_name"],)experiment.log_parameter("n_estimators",n_estimators)experiment.log_parameter("n_features",n_features)experiment.log_parameter("random_state",random_state)accuracy=rfc.score(X_test,y_test)experiment.log_metric("accuracy",accuracy)Then explore the project by running the dashboard:rubicon_ml ui --root-dir /rubicon-rootDocumentationFor a full overview, visit thedocs. If
you have suggestions or find a bug,please open an
issue.InstallThe Python library is available on Conda Forge viacondaand PyPi viapip.conda config --add channels conda-forge
conda install rubicon-mlorpip install rubicon-mlDevelopThe project uses conda to manage environments. First, installconda.
Then use conda to setup a development environment:condaenvcreate-fenvironment.yml
condaactivaterubicon-ml-devFinally, installrubicon_mllocally into the newly created environment.pipinstall-e".[all]"TestingThe tests are separated into unit and integration tests. They can be run
directly in the activated dev environment viapytest tests/unitorpytest tests/integration. Or by simply runningpytestto execute all of them.Note: some integration tests are intentionallymarkedto control when they
are run (i.e. not during CICD). These tests include:Integration tests that write to physical filesystems - local and S3. Local
files will be written to./test-rubiconrelative to where the tests are run.
An S3 path must also be provided to run these tests. By default, these
tests are disabled. To enable them, run:pytest -m "write_files" --s3-path "s3://my-bucket/my-key"Integration tests that run Jupyter notebooks. These tests are a bit slower
than the rest of the tests in the suite as they need to launch Jupyter servers.
By default, they are enabled. To disable them, run:pytest -m "not run_notebooks and not write_files"Note: When simply runningpytest,-m "not write_files"is the
default. So, we need to also apply it when disabling notebook tests.Code FormattingInstall and configure pre-commit to automatically runblack,flake8, andisortduring commits:install pre-commitrunpre-commit installto set up the git hook scriptsNowpre-commitwill run automatically on git commit and will ensure consistent
code format throughout the project. You can format without committing viapre-commit runor skip these checks withgit commit --no-verify.