In this tutorial, we'll cover how to train a simple model from the Gradient CLI.
In this tutorial we’ll cover how to train a model from the command line interface. This tutorial assumes that you’ve already installed the Gradient CLI, obtained an API key, created a Project, and launched a Jupyter notebook; if not, then feel free to check out those tutorials before starting.
Models are trained using Gradient Experiments. We’ll submit our dataset and Python code to the Experiment in order to train the model.
For this tutorial we’ll use a simple dataset which includes a person’s years of job experience, and their salary. We also have a file named “train dot py” which contains the code for generating the model by applying linear regression to the dataset. We’ll access these files from a GitHub repository.
Let’s start by going to our Project on the Gradient console and copying our Project ID. Then, from the CLI, type
Now we’ll run the command, and we can see that our experiment has been created and is running. Our code outputs some useful metrics, and completes successfully. The experiment generated a Python pickle file of our trained model that was stored at the location we specified in the command, which was the “salary” directory under storage.
We can also check out past experiments from the Gradient console.
And that’s all there is to training a model from the Gradient CLI.