CIS-2730, Lab #8: Predicting Temperature

Reading: ...

In this lab, you will train a simple model that can predict temperatures in the Winooski valley of Vermont using (mock) data gathered by various sensors spread around the region.

You will not need your BeaglePlay for this lab.

Part 1: Exploring the Analysis

In this part, you will review the analysis as done with a simple model. Take note of the final results. In the second part, you will modify the model to see if you can get improved results.

Proceed as follows.

  1. Download the Springtail Jupyter notebook and load it into Visual Studio Code.

  2. Be sure the Anaconda Python is selected as the "kernel" used to run the notebook. Look for the selected kernel in the upper right corner of the VS Code window.

  3. Go through the notebook, executing each cell one at a time. Read the text cells and study the code in the code cells so that you have some understanding about what is happening.

Part 2: Improving the model

In this part, you will change the model to give it more flexibility and, hopefully, a better ability to fit the training data.

Let us suppose that the temperatures in the lowest part of the valley, near the river, tend to be warmer than the temperatures on either side where the mountains are. To give the model the flexibility to adapt to that, we will add a quadratic term in the latitude dimension. This would allow the model to "bend" the surface representing the baseline temperature so that it goes down (toward cooler temperatures) on either side of the valley.

Thus, we will change the contribution to the predicted temperature due to latitude from c1 * latitude to c0 * latitude**2 + c1 * latitude. Note that c3 will absorb any changes to the constant term required by this modification. As a result, the final version of c3 may not have any obvious physical significance.

  1. Modify the model function to make the change described above. Also, give c0 a suitable initial value (0.0 might be reasonable).

  2. Make whatever other modifications are needed to the notebook to account for this change.

  3. Evaluate your new model and compare its performance with the original model. Does it produce a lower RMS error?

Note that this model assumes the amplitude, frequency, and phase of the daily variations are the same everywhere. Specifically, a, ω and φ are not functions of location. The location information is used only to define the baseline of the daily variation. This is probably not realistic. A more complex module would allow a, ω and φ to be functions of location according to some formula. Doing this would introduce many more tunable parameters into the model and would require more data to properly train those parameters. Would the extra work provide a better fit to the data (i.e., lower RMS error)? One would have to try it to find out.

Submission

Submit your updated Springtail.ipynb notebook.


Last Revised: 2024-04-24
© Copyright 2024 by Peter Chapin <peter.chapin@vermontstate.edu>