#!/usr/bin/env python # coding: utf-8 # # Integrate with Git # # ``rubicon_ml``'s ``git`` integration allows you to automatically track relevant version control # information like branches and commits during your model iteration process. # Use this integration when you are developing within a ``git`` repository to seamlessly tie # your ``rubicon_ml`` experiments directly to the model code that produced them - an audit and # governance must have! # # To enable this feature, instantiate the ``rubicon_ml`` object with ``auto_git_enabled=True``. # In[1]: from rubicon_ml import Rubicon rubicon = Rubicon(persistence="memory", auto_git_enabled=True) # Any **project** created with this client will have the URL of the GitHub repo's origin # automatically populated in the `github_url` property. # In[2]: project = rubicon.create_project("Automatic Git Integration") project.github_url # **Experiments** will have the current active branch name and last commit hash populated in # the ``branch_name`` and ``commit_hash`` fields, respectively. # In[3]: experiment = project.log_experiment(model_name="GitHub Model") experiment.branch_name, experiment.commit_hash # These properties can help easily associate **projects** and **experiments** with the exact # branches and commits they were run against so we can go back and reference the code later. # In[4]: from rubicon_ml.viz import Dashboard experiment.log_parameter(name="input", value=True) experiment.log_metric(name="output", value=1.0) Dashboard([experiment]).show() # Within the ``rubicon_ml`` dashboard, your experiments will be grouped by # commit hash, which will link directly to the commit on GitHub. # # ![dashboard](integration-git-dashboard.png "dashboard")