How to Monitor And Log your Machine Learning Experiment Remotely with HyperDash | by Khuyen Tran | Towards Data Science

Have you ever found yourself training a machine learning model and keep your eyes in front of your laptop screen for a long time? Especially when training a deep learning model on Google Colab, you want to know when the training is done so you can be in front of the laptop before losing connection.
If the experiment takes hours to finish, imagine what you can do during that time? Go for a walk, cook, take a bathroom break without bringing the laptop into the bathroom. Wouldn’t it be amazing if there is a tool that can help you to monitor the experiment from remote?
Luckily, with Hyperdash, you can monitor your training remotely (web, iOS, and Android). You can see the progress and get notified when the experiment is done. Better yet, keep a log of the results and the hyperparameters of your experiment!
$ pip install --upgrade pip && pip install hyperdash
Sign up for Hyperdash account
$ hd signup
You can choose either to sign up with an email or GitHub. Then login with the account you have just created
$ hyperdash login
If you decide to si with email. This is what you will see
Hyperdash is available in both Appstore and Google Play. You can download it and sign into your account.
Once you have signed in, your experiments on your laptop will be shown and saved to your phone! Let’s make sure it works by running
$ hd demo
You can see the program is running both in the terminal and in your app
Cool! So how can we use this? The great thing about Hyperdash is that it is extremely to use and get started. Let’s see how to use this for your data science project.
I will work with a dataset of heart disease from Kaggle. Our task is to predict whether the patient has heart disease or not. To have a quick sense of how Hyperdash works, you can run the notebook in this repository and observe how the Hyperdash app on your phone changes!
Start with splitting the data into training and test set
Use Hyperdash to record your experiment
Steps to use Hyperdash:
Name: Declare your experiment object in each run with Experiment(name)
Parameters: Record the value of any hyperparameter with exp.param('name', value)
Metrics: Record the value of any metric you wish to see with exp.metric('name', score)
End: End the experiment with exp.end()
That’s it. You should be able to see the experiments running on your phone when running the code above
In the metrics tab, you can see the metrics you recorded in exp.metric()
And observe the hyperparameter
In Logs, you can also see more information about the model you use for training such as size, shape, and the information about the original data. These pieces of information are written in .json format.
With the above method, your experiment will not stop running without the code exp.end(). You can avoid the trouble of remembering this code by wrapping your experiment in a function
The moment you run this code, the experiment has finished running on your phone!
You can also observe the metric for each iteration by recording the metrics in each iteration
And you will see a beautiful graph with the accuracy and loss function over time
Hyperdash is really cool app, but it will not be useful unless you use it. I recommend you use it when you want to monitor the experiments remotely and quickly save the results and metrics you get. But for logging more sophisticated information about the experiment, I recommend using either Mlflow or Weights and Biases. If you are curious about how to use these tools, look out for my next tutorials on these amazing tools.
I like to write about basic data science concepts and play with different algorithms and data science tools. You could connect with me on LinkedIn and Twitter.
Star this repo if you want to check out the codes for all of the articles I have written. Follow me on Medium to stay informed with my latest data science articles like these: