Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

437 add ml enabled galveston cge notebook #438

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to the INCORE documents generated by Sphinx package will be
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [Unreleased]

### Added
- ML enabled Galveston CGE notebook [#437](https://github.com/IN-CORE/incore-docs/issues/437)

## [4.14.0] - 2024-10-23

### Added
Expand Down
1 change: 1 addition & 0 deletions manual_jb/content/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ chapters:
- file: analyses/joplin_empirical_restoration
- file: analyses/mean_dmg
- file: analyses/mc_limit_state_prob
- file: analyses/ml_galveston_cge
- file: analyses/ml_joplin_cge
- file: analyses/ml_slc_cge
- file: analyses/multi_retrofit_optimization
Expand Down
51 changes: 26 additions & 25 deletions manual_jb/content/analyses.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,29 @@
24. [Interdependent Network Design Problem](analyses/indp)
25. [Joplin Computable General Equilibrium (CGE)](analyses/joplin_cge)
26. [Joplin empirical building restoration](analyses/joplin_empirical_building_restoration)
27. [Machine Learning Enabled Computable General Equilibrium (CGE) - Joplin](analyses/ml_joplin_cge.md)
28. [Machine Learning Enabled Computable General Equilibrium (CGE) - Salt Lake City](analyses/ml_slc_cge.md)
29. [Mean damage](analyses/mean_dmg)
30. [Monte Carlo limit state probability](analyses/mc_limit_state_prob)
31. [Multi-objective retrofit optimization](analyses/multi_retrofit_optimization)
32. [Network cascading interdependency functionality](analyses/nci_functionality)
33. [Pipeline damage](analyses/pipeline_dmg)
34. [Pipeline damage with repair rate](analyses/pipeline_dmg_w_repair_rate)
35. [Pipeline functionality](analyses/pipeline_functionality)
36. [Pipeline repair cost](analyses/pipeline_repair_cost)
37. [Pipeline restoration](analyses/pipeline_restoration)
38. [Population dislocation](analyses/populationdislocation)
39. [Residential building recovery](analyses/residential_building_recovery)
40. [Road damage](analyses/road_dmg)
41. [Salt Lake City Computable General Equilibrium (CGE)](analyses/slc_cge.md)
42. [Seaside Computable General Equilibrium (CGE)](analyses/seaside_cge)
43. [Social Vulnerability](analyses/social_vulnerability)
44. [Social Vulnerability Score](analyses/social_vulnerability_score)
45. [Tornado electric power network (EPN) damage](analyses/tornadoepn_dmg)
46. [Traffic flow recovery](analyses/traffic_flow_recovery)
47. [Transportation recovery](analyses/transportation_recovery)
48. [Water facility damage](analyses/waterfacility_dmg)
49. [Water network functionality](analyses/wfn_functionality)
50. [Water facility repair cost](analyses/water_facility_repair_cost)
51. [Water facility restoration](analyses/water_facility_restoration)
27. [Machine Learning Enabled Computable General Equilibrium (CGE) - Galveston](analyses/ml_galveston_cge.md)
28. [Machine Learning Enabled Computable General Equilibrium (CGE) - Joplin](analyses/ml_joplin_cge.md)
29. [Machine Learning Enabled Computable General Equilibrium (CGE) - Salt Lake City](analyses/ml_slc_cge.md)
30. [Mean damage](analyses/mean_dmg)
31. [Monte Carlo limit state probability](analyses/mc_limit_state_prob)
32. [Multi-objective retrofit optimization](analyses/multi_retrofit_optimization)
33. [Network cascading interdependency functionality](analyses/nci_functionality)
34. [Pipeline damage](analyses/pipeline_dmg)
35. [Pipeline damage with repair rate](analyses/pipeline_dmg_w_repair_rate)
36. [Pipeline functionality](analyses/pipeline_functionality)
37. [Pipeline repair cost](analyses/pipeline_repair_cost)
38. [Pipeline restoration](analyses/pipeline_restoration)
39. [Population dislocation](analyses/populationdislocation)
40. [Residential building recovery](analyses/residential_building_recovery)
41. [Road damage](analyses/road_dmg)
42. [Salt Lake City Computable General Equilibrium (CGE)](analyses/slc_cge.md)
43. [Seaside Computable General Equilibrium (CGE)](analyses/seaside_cge)
44. [Social Vulnerability](analyses/social_vulnerability)
45. [Social Vulnerability Score](analyses/social_vulnerability_score)
46. [Tornado electric power network (EPN) damage](analyses/tornadoepn_dmg)
47. [Traffic flow recovery](analyses/traffic_flow_recovery)
48. [Transportation recovery](analyses/transportation_recovery)
49. [Water facility damage](analyses/waterfacility_dmg)
50. [Water network functionality](analyses/wfn_functionality)
51. [Water facility repair cost](analyses/water_facility_repair_cost)
52. [Water facility restoration](analyses/water_facility_restoration)
59 changes: 59 additions & 0 deletions manual_jb/content/analyses/ml_galveston_cge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Machine Learning Enabled Computable General Equilibrium (CGE) - Galveston

**Description**

The "Machine Learning Enabled Computable General Equilibrium (CGE) - Galveston" analysis merges advanced machine learning with traditional CGE models to offer unprecedented insights into the economic impacts of disaster scenarios on Joplin. Trained on a comprehensive dataset of numerous simulated disasters and their economic effects, this hybrid approach excels in predicting the intricate dynamics of the city's economy under various crises.

A computable general equilibrium (CGE) model is based on fundamental economic principles. A CGE model uses multiple data sources to reflect the interactions of households, firms, and relevant government entities as they contribute to economic activity. The model is based on (1) utility-maximizing households that supply labor and capital, using the proceeds to pay for goods and services (both locally produced and imported) and taxes; (2) the production sector, with perfectly competitive, profit-maximizing firms using intermediate inputs, capital, land, and labor to produce goods and services for both domestic consumption and export; (3) the government sector that collects taxes and uses tax revenues in order to finance the provision of public services; and (4) the rest of the world.

The output of this analysis are CSV files with domestic supply, gross income, before- and post-disaster factor demand and household count.

**Contributors**

- Science: Charles Nicholson, Nushra Zannat, Hwayoung Jeon, Tao Lu, Harvey Cutler, Anita Pena
- Implementation: NCSA IN-CORE Dev Team


**Input parameters**

key name | type | name | description
--- | --- | --- | ---
`result_name` | `str` | Output File Name prefix | Sets the file name prefix for output files.

**Input datasets**

key name | type | name | description
--- | --- | --- | ---
`sector_shocks` <sup>*</sup> | [`incore:capitalShocks`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:capitalShocks) | Capital shocks | Building states to capital <br>shocks per sector.

**Output datasets**

key name | type | name | description
--- | --- | --- | ---
`domestic-supply` <sup>*</sup> | [`incore:Employment`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:Employment) | Supply results | A dataset containing domestic supply results (format: CSV).
`gross-income` <sup>*</sup> | [`incore:Employment`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:Employment) | Gross income | A dataset of resulting gross income (format: CSV).
`pre-disaster-factor-demand` <sup>*</sup> | [`incore:FactorDemand`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:FactorDemand) | Factor demand | A dataset of factor demand before disaster (format: CSV).
`post-disaster-factor-demand` <sup>*</sup> | [`incore:FactorDemand`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:FactorDemand) | Factor demand | A dataset of factor demand after disaster (format: CSV).
`household-count` <sup>*</sup> | [`incore:HouseholdCount`](https://incore.ncsa.illinois.edu/semantics/api/types/incore:HouseholdCount) | Household count | A dataset of household count (format: CSV).

<small>(* required)</small>

**Execution**

code snippet:

```
# Create Machine Learning Enabled CGE Galveston Model
mlcgegalveston = MlEnabledCgeGalveston(client)

# Set analysis input datasets
mlcgegalveston.load_remote_input_dataset("sector_shocks", sector_shocks)

# Optional parameters for file naming
mlcgegalveston.set_parameter("result_name", "test_galveston_mlcge_result")

# Run Galveston CGE model analysis
mlcgegalveston.run_analysis()
```

full analysis: [ml_enabled_jgalveston_cge.ipynb](https://github.com/IN-CORE/incore-docs/blob/main/notebooks/ml_enabled_galveston_cge.ipynb)
24 changes: 12 additions & 12 deletions notebooks/galveston_community_app.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "957d73f9",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -89,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "39b41540",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "58b1565c",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -175,7 +175,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "bfb2b053",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -214,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "ef7f95aa",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -337,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "ed824b73",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -405,7 +405,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"id": "da807655",
"metadata": {},
"outputs": [],
Expand All @@ -419,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"id": "46ed6e01",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -530,7 +530,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"id": "dbd1a228",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -690,7 +690,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 30,
"id": "cf28d307",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -781,7 +781,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "incore",
"language": "python",
"name": "python3"
},
Expand All @@ -795,7 +795,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
Loading
Loading