This tutorial guides you through building and running a simple linear regression model to forecast water temperature for the VERA (Virginia Ecologically-informed Reservoir Assessment) Forecasting Challenge. Youโll use R-based tools to preprocess the required data, with validation and submission steps implemented in a Python notebook. Check out the detailed vera4cast-example repository version of this tutorial, from where it is adapted.
โ Option 1. Fork and open from GitHub inside Colab (Recommended)
- Sign into GitHub and navigate to the tutorial repository https://github.com/LTREB-reservoirs/PY-VERA_EXAMPLE.
- Click the "Fork" button on the top right of the repository page to fork a copy of the repository to your own GitHub account.
- Once your fork is created, in a new browser tab, go to https://colab.research.google.com. You may need to log into your Google account to set up Colab if you have never used it before.
- Select "open notebook" โ Choose the GitHub tab
- Go back to your forked GitHub repository and copy the link to the repository. It will be something like:
https://github.com/YourUsername/PY-VERA_EXAMPLE/blob/main/Vera_Example.ipynb. Paste this link in the GitHub tab search bar โ Press Enter. - From your account, select the
PY-VERA_EXAMPLErepository andmainbranch to open in Colab. Click on theVera_Example.ipynbfile to open. - You have now opened your own copy of the
Vera_Example.ipynbtutorial in Colab. - Run the โSetupโ commands below to install all required R libraries.
- Any changes you make and save will be committed directly to your fork on GitHub. When you save for the first time, you may need to verify your account and permit Colab to access your GitHub account to make the first commit.
- Once you have made your first commit on your forked repository, an "Open in Colab" badge will automatically be generated at the top of the
Vera_Example.ipynbfile. From now on, you can simply click this button to open the file in your Colab.
๐ฆ Option 2. Download ZIP & Upload Manually
- On GitHub, click Code โ Download ZIP.
- Unzip the folder anywhere on your computer.
- Open Google Colab, go to File โ Upload notebook, and select
Vera_Example.ipynb. - Run the โSetupโ commands below to install all required R libraries.
โ๏ธ 3. Setting up your Colab Environment with R packages (This step is also done in the notebook)
You can run these commands in your Colab notebook for required R packages installation (Setup):
!R -e "install.packages(c('reticulate','dplyr','arrow'), repos='http://cran.us.r-project.org')"
!R -e "remotes::install_github('LTREB-reservoirsvera4castHelpers')"