Making predictions in a notebook environment
If you took a day's (or a few days') break after the previous chapter, it's likely that your connection to the remote virtual machine ended. Because of that, you'll need to reconnect and start the API once again. There are ways to make your API always running, but that's out of the scope of this book. Furthermore, if you've moved the TPOT_Book_KeyPair.pem
file to some other folder, you'll have to reset the permissions:
- With that in mind, execute the first command line from the following snippet, only if you have to reset the permissions:
> chmod 400 TPOT_Book_KeyPair.pem > ssh -i "TPOT_Book_KeyPair.pem" [email protected] > cd api > python3 app.py
- Your API is running now. The next step is to open a JupyterLab or Jupyter Notebook environment and make a request. You'll need the
requests
library to do so, so here's how to import...