-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35aa4d6
commit fa04d0f
Showing
57 changed files
with
9,603 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# CSD-WDM | ||
|
||
**Version 1.0** | ||
|
||
Python-based (v3.8.5) Water Demand Model | ||
|
||
## Description | ||
|
||
The Climate-Supply-Development Water Demand Model takes in monthly features to identify the key per-capita water demand 'drivers'. During model calibration, the training process evaluates feature correlation with observed gallons per-capita water use (gpcd), checks for feature collinearity and removes the lesser demand correlated co-linear feature, and performs recursive feature elimination to identify key demand drivers and optimize model accuracy in predicting water demand. | ||
|
||
## Getting Started | ||
|
||
Access the module here: | ||
|
||
** link to .py file and template ** | ||
|
||
### Prerequisites | ||
|
||
The following are modules used in the model that are not downloaded automatically with python. | ||
|
||
* Progressbar | ||
|
||
## Usage | ||
|
||
### Loading Data | ||
|
||
The user will provide two sets of data: historical data (loaded as historical_data) and forecast data (loaded as forecast_data). | ||
|
||
The historical data will be divided into training and testing data with the identification of three years: one drought year, one average year, and one surplus year. The training data will be used to calibrate the model and should not be less than 30 years. The testing data will be used in order to quantify the accuracy of the model's predictions when making predictions for varying conditions. | ||
|
||
The forecast data set will include the conditions anticipated by the user for the year which the prediction is being made for. | ||
|
||
Historical and forecast data files should each contain an excel file for each month. Excel files should have features listed along the top as column titles and years listed along the left side as row titles. These excel files will be loaded into a python dictionary format with the help of the provided template. | ||
|
||
Features may include the following or any other features desired by the user: | ||
|
||
| Feature | Suggested Units | Label | | ||
| --- | --- | --- | | ||
| Mean daily temperature | °C | | ||
| Monthly precipitation | mm | | ||
| Monthly snowfall | mm | Apr_snow_in Mar_snow_in etc | | ||
| Yearly snowfall | mm | Total_snow_in | | ||
| Snow shortage | mm | Snow_shortage | | ||
| Housing | units | | ||
| Population density | people / sq mile | | ||
| Streamflow of major streams | acre-feet | | ||
| Conservation goal | gpcd | cons_goal | | ||
| Mean monthly per capita water demand | gpcd | Target_gpcd | | ||
|
||
** Target_gpcd is a required feature ** | ||
|
||
Note: the CSD-WDM model used gpcd as units. If user wishes to have predictions in other units, conversions can be made after running the model and collecting values. | ||
|
||
### Model Inputs | ||
|
||
The following are inputs used within in the model: | ||
|
||
* Scoring is used to assess the fit of the model to the testing data. As of now, either the R squared method or Root Mean Square Error method can be used in the model. | ||
|
||
* Snow data and set conservation goals may be used in the data files if relevant for the area of interest, but must be set to False if not provided in the excel data. | ||
|
||
* Correlation threshold is the limit (number between 0 and 1) to be used when examining the relationship between a feature and the target. | ||
|
||
* Collinearity threshold is the limit (number between 0 and 1) to be used when examining the relationship between two features. This threshold is used to remove a feature with the weaker correlation. | ||
|
||
**Possible Inputs** | ||
|
||
| Name of Input | Choices | Enter in template | | ||
| --- | --- | --- | | ||
| **Snowfeatures** | Use snowfall data | [True, False] | | ||
| | Don't use snowfall data | [False] | | ||
| **Conservation** | Use conservation goal | [True, False] | | ||
| | Don't use conservation goal | [False] | | ||
| **Scoring** | R squared | 'R2' | | ||
| | Root Mean Square Error | 'RMSE' | | ||
|
||
| Name of Input | Default (may be editied) | In template | | ||
| --- | --- | --- | | ||
| **Correlation Threshold** | Test all values between 0 and .95 with increments of 0.05 | np.arange(0,0.95, 0.05) | | ||
| **Colinearity Threshold** | Test all values between .65 and .9 with increments of 0.0 | [0.65, 0.7, 0.75, 0.80, 0.85, 0.90] | | ||
|
||
### Accessing More Data | ||
|
||
More data may be accessed that is not automatically displayed in the CSD-WDM template. To access this data, the user must edit the module file. To print out lines with information about selected features, cv scores, number of selected features, final features, and values for error metrics, the user may remove the quote marks around the print lines in the Outdoor_Demand_Model and model_plots functions. For help with this or other challenges, feel free to contact the contributers via email. | ||
|
||
## Contributers | ||
|
||
**Ryan Johnson** | ||
|
||
[email protected] | ||
|
||
**Emily Baur** | ||
|
||
[email protected] |
Binary file not shown.