Spaces:
Sleeping
Sleeping
atodorov284 commited on
Commit ·
31e91d0
1
Parent(s): 3e9466a
documented all code and update docs
Browse files- docs/_build/doctrees/environment.pickle +0 -0
- docs/_build/doctrees/streamlit_src.controllers.doctree +0 -0
- docs/_build/doctrees/streamlit_src.models.doctree +0 -0
- docs/_build/doctrees/streamlit_src.views.doctree +0 -0
- docs/_build/html/_modules/streamlit_src/controllers/admin_controller.html +15 -10
- docs/_build/html/_modules/streamlit_src/controllers/home_controller.html +36 -12
- docs/_build/html/_modules/streamlit_src/controllers/user_controller.html +18 -15
- docs/_build/html/_modules/streamlit_src/models/air_quality_model.html +61 -19
- docs/_build/html/_modules/streamlit_src/views/admin_view.html +18 -12
- docs/_build/html/_modules/streamlit_src/views/home_view.html +61 -14
- docs/_build/html/air_quality_forecast.html +22 -22
- docs/_build/html/genindex.html +23 -15
- docs/_build/html/objects.inv +0 -0
- docs/_build/html/searchindex.js +1 -1
- docs/_build/html/streamlit_src.controllers.html +37 -24
- docs/_build/html/streamlit_src.html +17 -10
- docs/_build/html/streamlit_src.models.html +73 -18
- docs/_build/html/streamlit_src.views.html +96 -30
- streamlit_src/controllers/admin_controller.py +6 -1
- streamlit_src/controllers/home_controller.py +28 -3
- streamlit_src/models/air_quality_model.py +53 -10
- streamlit_src/views/admin_view.py +9 -3
- streamlit_src/views/home_view.py +49 -4
docs/_build/doctrees/environment.pickle
CHANGED
|
Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ
|
|
|
docs/_build/doctrees/streamlit_src.controllers.doctree
CHANGED
|
Binary files a/docs/_build/doctrees/streamlit_src.controllers.doctree and b/docs/_build/doctrees/streamlit_src.controllers.doctree differ
|
|
|
docs/_build/doctrees/streamlit_src.models.doctree
CHANGED
|
Binary files a/docs/_build/doctrees/streamlit_src.models.doctree and b/docs/_build/doctrees/streamlit_src.models.doctree differ
|
|
|
docs/_build/doctrees/streamlit_src.views.doctree
CHANGED
|
Binary files a/docs/_build/doctrees/streamlit_src.views.doctree and b/docs/_build/doctrees/streamlit_src.views.doctree differ
|
|
|
docs/_build/html/_modules/streamlit_src/controllers/admin_controller.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.controllers.admin_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">os</span>
|
| 73 |
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Tuple</span>
|
|
@@ -233,7 +233,12 @@
|
|
| 233 |
<span class="s2">"The data must be unnormalized."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 234 |
<span class="s2">"PM25, PM10, O3, NO2 should be in micrograms per cubic meter (µg/m³)."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 235 |
<span class="s2">"Temperature should be in degrees Celcius"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 236 |
-
<span class="s2">"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
<span class="s2">"The dataset must contain a total of 33 columns in the specified order."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 238 |
<span class="s2">"I accept that my data will be used for a prediction using a custom model."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 239 |
<span class="s2">"I understand that my data will not be saved."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
|
@@ -418,7 +423,7 @@
|
|
| 418 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 419 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 420 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 421 |
-
|
| 422 |
|
| 423 |
</footer>
|
| 424 |
</div>
|
|
@@ -429,7 +434,7 @@
|
|
| 429 |
jQuery(function () {
|
| 430 |
SphinxRtdTheme.Navigation.enable(true);
|
| 431 |
});
|
| 432 |
-
</script>
|
| 433 |
|
| 434 |
</body>
|
| 435 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.controllers.admin_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">os</span>
|
| 73 |
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Tuple</span>
|
|
|
|
| 233 |
<span class="s2">"The data must be unnormalized."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 234 |
<span class="s2">"PM25, PM10, O3, NO2 should be in micrograms per cubic meter (µg/m³)."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 235 |
<span class="s2">"Temperature should be in degrees Celcius"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 236 |
+
<span class="s2">"Humidity should be in percentages"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 237 |
+
<span class="s2">"Visibility should be in kilometers"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 238 |
+
<span class="s2">"Solar Radiation should be in watts per square meter (W/m²)."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 239 |
+
<span class="s2">"Precipitation should be in millimeters"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 240 |
+
<span class="s2">"Wind Speed should be in kilometers per hour (km/h)."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 241 |
+
<span class="s2">"Wind Direction should be in degrees"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 242 |
<span class="s2">"The dataset must contain a total of 33 columns in the specified order."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 243 |
<span class="s2">"I accept that my data will be used for a prediction using a custom model."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
| 244 |
<span class="s2">"I understand that my data will not be saved."</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
|
|
|
|
| 423 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 424 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 425 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 426 |
+
|
| 427 |
|
| 428 |
</footer>
|
| 429 |
</div>
|
|
|
|
| 434 |
jQuery(function () {
|
| 435 |
SphinxRtdTheme.Navigation.enable(true);
|
| 436 |
});
|
| 437 |
+
</script>
|
| 438 |
|
| 439 |
</body>
|
| 440 |
+
</html>
|
docs/_build/html/_modules/streamlit_src/controllers/home_controller.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.controllers.home_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">time</span>
|
|
@@ -80,11 +80,24 @@
|
|
| 80 |
<div class="viewcode-block" id="HomeController">
|
| 81 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController">[docs]</a>
|
| 82 |
<span class="k">class</span> <span class="nc">HomeController</span><span class="p">:</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
<span class="n">__ADMIN_PASSWORD_HASH</span> <span class="o">=</span> <span class="p">(</span>
|
| 84 |
<span class="s2">"240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9"</span>
|
| 85 |
<span class="p">)</span>
|
| 86 |
|
| 87 |
-
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
<span class="bp">self</span><span class="o">.</span><span class="n">home_view</span> <span class="o">=</span> <span class="n">HomeView</span><span class="p">()</span>
|
| 89 |
<span class="bp">self</span><span class="o">.</span><span class="n">user_controller</span> <span class="o">=</span> <span class="n">UserController</span><span class="p">()</span>
|
| 90 |
<span class="bp">self</span><span class="o">.</span><span class="n">admin_controller</span> <span class="o">=</span> <span class="n">AdminController</span><span class="p">()</span>
|
|
@@ -92,14 +105,25 @@
|
|
| 92 |
|
| 93 |
<div class="viewcode-block" id="HomeController._hash_password">
|
| 94 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController._hash_password">[docs]</a>
|
| 95 |
-
<span class="k">def</span> <span class="nf">_hash_password</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">password</span><span class="p">):</span>
|
| 96 |
<span class="w"> </span><span class="sd">"""Hash the input password using SHA-256."""</span>
|
| 97 |
<span class="k">return</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha256</span><span class="p">(</span><span class="n">password</span><span class="o">.</span><span class="n">encode</span><span class="p">())</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span></div>
|
| 98 |
|
| 99 |
|
| 100 |
<div class="viewcode-block" id="HomeController._run">
|
| 101 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController._run">[docs]</a>
|
| 102 |
-
<span class="k">def</span> <span class="nf">_run</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
<span class="k">if</span> <span class="s2">"is_admin_logged_in"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">st</span><span class="o">.</span><span class="n">session_state</span><span class="p">:</span>
|
| 104 |
<span class="n">st</span><span class="o">.</span><span class="n">session_state</span><span class="o">.</span><span class="n">is_admin_logged_in</span> <span class="o">=</span> <span class="kc">False</span>
|
| 105 |
|
|
@@ -139,7 +163,7 @@
|
|
| 139 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 140 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 141 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 142 |
-
|
| 143 |
|
| 144 |
</footer>
|
| 145 |
</div>
|
|
@@ -150,7 +174,7 @@
|
|
| 150 |
jQuery(function () {
|
| 151 |
SphinxRtdTheme.Navigation.enable(true);
|
| 152 |
});
|
| 153 |
-
</script>
|
| 154 |
|
| 155 |
</body>
|
| 156 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.controllers.home_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">time</span>
|
|
|
|
| 80 |
<div class="viewcode-block" id="HomeController">
|
| 81 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController">[docs]</a>
|
| 82 |
<span class="k">class</span> <span class="nc">HomeController</span><span class="p">:</span>
|
| 83 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 84 |
+
<span class="sd"> Handles the logic for the home page, including switching between user and admin views.</span>
|
| 85 |
+
|
| 86 |
+
<span class="sd"> The home page is the main entry point for the Streamlit application.</span>
|
| 87 |
+
<span class="sd"> It contains a text input for the admin password, which is hashed and compared to the stored hash.</span>
|
| 88 |
+
<span class="sd"> If the password is correct, the user is logged in as an admin and the admin view is displayed.</span>
|
| 89 |
+
<span class="sd"> Otherwise, the user view is displayed.</span>
|
| 90 |
+
<span class="sd"> """</span>
|
| 91 |
+
<span class="c1"># This needs to be hidden as an env variable but we couldn't manage with HuggingFace yet, severe security issue</span>
|
| 92 |
<span class="n">__ADMIN_PASSWORD_HASH</span> <span class="o">=</span> <span class="p">(</span>
|
| 93 |
<span class="s2">"240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9"</span>
|
| 94 |
<span class="p">)</span>
|
| 95 |
|
| 96 |
+
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 97 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 98 |
+
<span class="sd"> Initializes the HomeController class by setting up the home view, user controller,</span>
|
| 99 |
+
<span class="sd"> and admin controller. Also triggers the _run method to start the application.</span>
|
| 100 |
+
<span class="sd"> """</span>
|
| 101 |
<span class="bp">self</span><span class="o">.</span><span class="n">home_view</span> <span class="o">=</span> <span class="n">HomeView</span><span class="p">()</span>
|
| 102 |
<span class="bp">self</span><span class="o">.</span><span class="n">user_controller</span> <span class="o">=</span> <span class="n">UserController</span><span class="p">()</span>
|
| 103 |
<span class="bp">self</span><span class="o">.</span><span class="n">admin_controller</span> <span class="o">=</span> <span class="n">AdminController</span><span class="p">()</span>
|
|
|
|
| 105 |
|
| 106 |
<div class="viewcode-block" id="HomeController._hash_password">
|
| 107 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController._hash_password">[docs]</a>
|
| 108 |
+
<span class="k">def</span> <span class="nf">_hash_password</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">password</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
| 109 |
<span class="w"> </span><span class="sd">"""Hash the input password using SHA-256."""</span>
|
| 110 |
<span class="k">return</span> <span class="n">hashlib</span><span class="o">.</span><span class="n">sha256</span><span class="p">(</span><span class="n">password</span><span class="o">.</span><span class="n">encode</span><span class="p">())</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span></div>
|
| 111 |
|
| 112 |
|
| 113 |
<div class="viewcode-block" id="HomeController._run">
|
| 114 |
<a class="viewcode-back" href="../../../streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController._run">[docs]</a>
|
| 115 |
+
<span class="k">def</span> <span class="nf">_run</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 116 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 117 |
+
<span class="sd"> Runs the application logic for the home page.</span>
|
| 118 |
+
|
| 119 |
+
<span class="sd"> This method is responsible for rendering the home page and</span>
|
| 120 |
+
<span class="sd"> handling the user's choice of whether to view the user dashboard</span>
|
| 121 |
+
<span class="sd"> or admin dashboard. If the user chooses to view the admin dashboard,</span>
|
| 122 |
+
<span class="sd"> the user is prompted to enter the admin password. If the password</span>
|
| 123 |
+
<span class="sd"> is valid, the user is logged in as an admin and the admin dashboard</span>
|
| 124 |
+
<span class="sd"> is displayed. If the password is invalid, the user is logged out and</span>
|
| 125 |
+
<span class="sd"> the user dashboard is displayed.</span>
|
| 126 |
+
<span class="sd"> """</span>
|
| 127 |
<span class="k">if</span> <span class="s2">"is_admin_logged_in"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">st</span><span class="o">.</span><span class="n">session_state</span><span class="p">:</span>
|
| 128 |
<span class="n">st</span><span class="o">.</span><span class="n">session_state</span><span class="o">.</span><span class="n">is_admin_logged_in</span> <span class="o">=</span> <span class="kc">False</span>
|
| 129 |
|
|
|
|
| 163 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 164 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 165 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 166 |
+
|
| 167 |
|
| 168 |
</footer>
|
| 169 |
</div>
|
|
|
|
| 174 |
jQuery(function () {
|
| 175 |
SphinxRtdTheme.Navigation.enable(true);
|
| 176 |
});
|
| 177 |
+
</script>
|
| 178 |
|
| 179 |
</body>
|
| 180 |
+
</html>
|
docs/_build/html/_modules/streamlit_src/controllers/user_controller.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.controllers.user_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Tuple</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
|
@@ -95,8 +95,10 @@
|
|
| 95 |
<span class="sd"> """</span>
|
| 96 |
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="n">AirQualityModel</span><span class="p">()</span>
|
| 97 |
<span class="bp">self</span><span class="o">.</span><span class="n">_view</span> <span class="o">=</span> <span class="n">UserView</span><span class="p">()</span>
|
| 98 |
-
|
| 99 |
-
<span class="
|
|
|
|
|
|
|
| 100 |
|
| 101 |
<span class="bp">self</span><span class="o">.</span><span class="n">_who_guidelines</span> <span class="o">=</span> <span class="p">{</span>
|
| 102 |
<span class="s2">"Pollutant"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"NO2 (µg/m³)"</span><span class="p">,</span> <span class="s2">"O3 (µg/m³)"</span><span class="p">],</span>
|
|
@@ -123,7 +125,8 @@
|
|
| 123 |
<span class="w"> </span><span class="sd">"""</span>
|
| 124 |
<span class="sd"> Shows the main page of the user interface.</span>
|
| 125 |
<span class="sd"> """</span>
|
| 126 |
-
<span class="
|
|
|
|
| 127 |
|
| 128 |
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_current_data_available</span><span class="p">():</span>
|
| 129 |
<span class="bp">self</span><span class="o">.</span><span class="n">_view</span><span class="o">.</span><span class="n">data_not_available</span><span class="p">()</span>
|
|
@@ -143,7 +146,7 @@
|
|
| 143 |
<span class="w"> </span><span class="sd">"""</span>
|
| 144 |
<span class="sd"> Checks if the current data is available.</span>
|
| 145 |
|
| 146 |
-
<span class="sd"> The current data is not available from
|
| 147 |
<span class="sd"> This is because the API is queried every 15 minutes, and the</span>
|
| 148 |
<span class="sd"> data is not available for a short period of time before and after</span>
|
| 149 |
<span class="sd"> the new data is fetched.</span>
|
|
@@ -151,8 +154,8 @@
|
|
| 151 |
<span class="sd"> :return: True if the current data is available, False otherwise.</span>
|
| 152 |
<span class="sd"> """</span>
|
| 153 |
<span class="n">current_time</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
| 154 |
-
<span class="n">start_time</span> <span class="o">=</span> <span class="n">
|
| 155 |
-
<span class="n">end_time</span> <span class="o">=</span> <span class="n">
|
| 156 |
<span class="k">if</span> <span class="n">start_time</span> <span class="o"><=</span> <span class="n">current_time</span> <span class="o"><=</span> <span class="n">end_time</span><span class="p">:</span>
|
| 157 |
<span class="k">return</span> <span class="kc">False</span>
|
| 158 |
<span class="k">return</span> <span class="kc">True</span></div>
|
|
@@ -534,7 +537,7 @@
|
|
| 534 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 535 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 536 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 537 |
-
|
| 538 |
|
| 539 |
</footer>
|
| 540 |
</div>
|
|
@@ -545,7 +548,7 @@
|
|
| 545 |
jQuery(function () {
|
| 546 |
SphinxRtdTheme.Navigation.enable(true);
|
| 547 |
});
|
| 548 |
-
</script>
|
| 549 |
|
| 550 |
</body>
|
| 551 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.controllers.user_controller</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Tuple</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
|
|
|
| 95 |
<span class="sd"> """</span>
|
| 96 |
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="n">AirQualityModel</span><span class="p">()</span>
|
| 97 |
<span class="bp">self</span><span class="o">.</span><span class="n">_view</span> <span class="o">=</span> <span class="n">UserView</span><span class="p">()</span>
|
| 98 |
+
|
| 99 |
+
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_current_data_available</span><span class="p">():</span>
|
| 100 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">_today_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="o">.</span><span class="n">get_today_data</span><span class="p">()</span>
|
| 101 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">_next_three_days</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="o">.</span><span class="n">next_three_day_predictions</span><span class="p">()</span>
|
| 102 |
|
| 103 |
<span class="bp">self</span><span class="o">.</span><span class="n">_who_guidelines</span> <span class="o">=</span> <span class="p">{</span>
|
| 104 |
<span class="s2">"Pollutant"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"NO2 (µg/m³)"</span><span class="p">,</span> <span class="s2">"O3 (µg/m³)"</span><span class="p">],</span>
|
|
|
|
| 125 |
<span class="w"> </span><span class="sd">"""</span>
|
| 126 |
<span class="sd"> Shows the main page of the user interface.</span>
|
| 127 |
<span class="sd"> """</span>
|
| 128 |
+
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_current_data_available</span><span class="p">():</span>
|
| 129 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">_view</span><span class="o">.</span><span class="n">two_columns_layout</span><span class="p">(</span><span class="mf">0.7</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_raise_awareness</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_quiz</span><span class="p">)</span>
|
| 130 |
|
| 131 |
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_current_data_available</span><span class="p">():</span>
|
| 132 |
<span class="bp">self</span><span class="o">.</span><span class="n">_view</span><span class="o">.</span><span class="n">data_not_available</span><span class="p">()</span>
|
|
|
|
| 146 |
<span class="w"> </span><span class="sd">"""</span>
|
| 147 |
<span class="sd"> Checks if the current data is available.</span>
|
| 148 |
|
| 149 |
+
<span class="sd"> The current data is not available from 00:00 to 04:15.</span>
|
| 150 |
<span class="sd"> This is because the API is queried every 15 minutes, and the</span>
|
| 151 |
<span class="sd"> data is not available for a short period of time before and after</span>
|
| 152 |
<span class="sd"> the new data is fetched.</span>
|
|
|
|
| 154 |
<span class="sd"> :return: True if the current data is available, False otherwise.</span>
|
| 155 |
<span class="sd"> """</span>
|
| 156 |
<span class="n">current_time</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
| 157 |
+
<span class="n">start_time</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="s2">"00:00"</span><span class="p">,</span> <span class="s2">"%H:%M"</span><span class="p">)</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
| 158 |
+
<span class="n">end_time</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">strptime</span><span class="p">(</span><span class="s2">"04:15"</span><span class="p">,</span> <span class="s2">"%H:%M"</span><span class="p">)</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
| 159 |
<span class="k">if</span> <span class="n">start_time</span> <span class="o"><=</span> <span class="n">current_time</span> <span class="o"><=</span> <span class="n">end_time</span><span class="p">:</span>
|
| 160 |
<span class="k">return</span> <span class="kc">False</span>
|
| 161 |
<span class="k">return</span> <span class="kc">True</span></div>
|
|
|
|
| 537 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 538 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 539 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 540 |
+
|
| 541 |
|
| 542 |
</footer>
|
| 543 |
</div>
|
|
|
|
| 548 |
jQuery(function () {
|
| 549 |
SphinxRtdTheme.Navigation.enable(true);
|
| 550 |
});
|
| 551 |
+
</script>
|
| 552 |
|
| 553 |
</body>
|
| 554 |
+
</html>
|
docs/_build/html/_modules/streamlit_src/models/air_quality_model.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.models.air_quality_model</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">os</span>
|
|
@@ -92,13 +92,25 @@
|
|
| 92 |
<div class="viewcode-block" id="AirQualityModel">
|
| 93 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel">[docs]</a>
|
| 94 |
<span class="k">class</span> <span class="nc">AirQualityModel</span><span class="p">:</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 96 |
-
<span class="bp">self</span><span class="o">.</span><span class="n">
|
| 97 |
-
<span class="bp">self</span><span class="o">.</span><span class="n">
|
| 98 |
|
| 99 |
<div class="viewcode-block" id="AirQualityModel.get_today_data">
|
| 100 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_today_data">[docs]</a>
|
| 101 |
-
<span class="k">def</span> <span class="nf">get_today_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
| 102 |
<span class="w"> </span><span class="sd">"""</span>
|
| 103 |
<span class="sd"> Returns the air quality data for today from the past 3 days data.</span>
|
| 104 |
|
|
@@ -116,14 +128,14 @@
|
|
| 116 |
|
| 117 |
<div class="viewcode-block" id="AirQualityModel.next_three_day_predictions">
|
| 118 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions">[docs]</a>
|
| 119 |
-
<span class="k">def</span> <span class="nf">next_three_day_predictions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
| 120 |
-
<span class="
|
|
|
|
|
|
|
| 121 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PREDICTION_PATH</span><span class="p">)</span>
|
| 122 |
|
| 123 |
-
<span class="c1"># correct data is todays data row</span>
|
| 124 |
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s2">"date"</span><span class="p">]</span> <span class="o">==</span> <span class="n">pd</span><span class="o">.</span><span class="n">Timestamp</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">)]</span>
|
| 125 |
|
| 126 |
-
<span class="c1"># Create a DataFrame with the relevant information for the next three days</span>
|
| 127 |
<span class="n">next_three_days</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
|
| 128 |
<span class="p">{</span>
|
| 129 |
<span class="s2">"Day"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"Day 1"</span><span class="p">,</span> <span class="s2">"Day 2"</span><span class="p">,</span> <span class="s2">"Day 3"</span><span class="p">],</span>
|
|
@@ -145,14 +157,34 @@
|
|
| 145 |
|
| 146 |
<div class="viewcode-block" id="AirQualityModel.get_all_data_last_three_days">
|
| 147 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days">[docs]</a>
|
| 148 |
-
<span class="k">def</span> <span class="nf">get_all_data_last_three_days</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PAST_DATA_PATH</span><span class="p">)</span>
|
| 150 |
<span class="k">return</span> <span class="n">data</span></div>
|
| 151 |
|
| 152 |
|
| 153 |
<div class="viewcode-block" id="AirQualityModel.get_last_three_days">
|
| 154 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days">[docs]</a>
|
| 155 |
-
<span class="k">def</span> <span class="nf">get_last_three_days</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
<span class="c1"># Extract NO2 and O3 values for the last three days</span>
|
| 157 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PAST_DATA_PATH</span><span class="p">)</span>
|
| 158 |
<span class="n">last_three_days</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
|
|
@@ -175,7 +207,17 @@
|
|
| 175 |
|
| 176 |
<div class="viewcode-block" id="AirQualityModel.calculate_metrics">
|
| 177 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics">[docs]</a>
|
| 178 |
-
<span class="k">def</span> <span class="nf">calculate_metrics</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
<span class="n">model_predictions</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PREDICTION_PATH</span><span class="p">)</span>
|
| 180 |
|
| 181 |
<span class="n">yesterday</span> <span class="o">=</span> <span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="o">-</span> <span class="n">timedelta</span><span class="p">(</span><span class="n">days</span><span class="o">=</span><span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">)</span>
|
|
@@ -318,7 +360,7 @@
|
|
| 318 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 319 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 320 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 321 |
-
|
| 322 |
|
| 323 |
</footer>
|
| 324 |
</div>
|
|
@@ -329,7 +371,7 @@
|
|
| 329 |
jQuery(function () {
|
| 330 |
SphinxRtdTheme.Navigation.enable(true);
|
| 331 |
});
|
| 332 |
-
</script>
|
| 333 |
|
| 334 |
</body>
|
| 335 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.models.air_quality_model</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
| 73 |
<span class="kn">import</span> <span class="nn">os</span>
|
|
|
|
| 92 |
<div class="viewcode-block" id="AirQualityModel">
|
| 93 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel">[docs]</a>
|
| 94 |
<span class="k">class</span> <span class="nc">AirQualityModel</span><span class="p">:</span>
|
| 95 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 96 |
+
<span class="sd"> A class that loads the air quality model and makes predictions.</span>
|
| 97 |
+
<span class="sd"> </span>
|
| 98 |
+
<span class="sd"> The model is loaded from a pickle file located at PREDICTION_PATH.</span>
|
| 99 |
+
<span class="sd"> </span>
|
| 100 |
+
<span class="sd"> Attributes</span>
|
| 101 |
+
<span class="sd"> ----------</span>
|
| 102 |
+
<span class="sd"> _WHO_NO2_LEVEL : int</span>
|
| 103 |
+
<span class="sd"> The WHO air quality level for NO2 in micrograms per cubic meter.</span>
|
| 104 |
+
<span class="sd"> _WHO_O3_LEVEL : int</span>
|
| 105 |
+
<span class="sd"> The WHO air quality level for O3 in micrograms per cubic meter.</span>
|
| 106 |
+
<span class="sd"> """</span>
|
| 107 |
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 108 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">_WHO_NO2_LEVEL</span> <span class="o">=</span> <span class="mi">25</span>
|
| 109 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">_WHO_O3_LEVEL</span> <span class="o">=</span> <span class="mi">100</span>
|
| 110 |
|
| 111 |
<div class="viewcode-block" id="AirQualityModel.get_today_data">
|
| 112 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_today_data">[docs]</a>
|
| 113 |
+
<span class="k">def</span> <span class="nf">get_today_data</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">:</span>
|
| 114 |
<span class="w"> </span><span class="sd">"""</span>
|
| 115 |
<span class="sd"> Returns the air quality data for today from the past 3 days data.</span>
|
| 116 |
|
|
|
|
| 128 |
|
| 129 |
<div class="viewcode-block" id="AirQualityModel.next_three_day_predictions">
|
| 130 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions">[docs]</a>
|
| 131 |
+
<span class="k">def</span> <span class="nf">next_three_day_predictions</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
| 132 |
+
<span class="w"> </span><span class="sd">'''</span>
|
| 133 |
+
<span class="sd"> Returns the predictions for the next three days.</span>
|
| 134 |
+
<span class="sd"> '''</span>
|
| 135 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PREDICTION_PATH</span><span class="p">)</span>
|
| 136 |
|
|
|
|
| 137 |
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="s2">"date"</span><span class="p">]</span> <span class="o">==</span> <span class="n">pd</span><span class="o">.</span><span class="n">Timestamp</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">)]</span>
|
| 138 |
|
|
|
|
| 139 |
<span class="n">next_three_days</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
|
| 140 |
<span class="p">{</span>
|
| 141 |
<span class="s2">"Day"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"Day 1"</span><span class="p">,</span> <span class="s2">"Day 2"</span><span class="p">,</span> <span class="s2">"Day 3"</span><span class="p">],</span>
|
|
|
|
| 157 |
|
| 158 |
<div class="viewcode-block" id="AirQualityModel.get_all_data_last_three_days">
|
| 159 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days">[docs]</a>
|
| 160 |
+
<span class="k">def</span> <span class="nf">get_all_data_last_three_days</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
| 161 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 162 |
+
<span class="sd"> Returns all the air quality data for the last three days from the past 3 days data.</span>
|
| 163 |
+
<span class="sd"> </span>
|
| 164 |
+
<span class="sd"> The data is obtained from a CSV file located at PAST_DATA_PATH.</span>
|
| 165 |
+
<span class="sd"> </span>
|
| 166 |
+
<span class="sd"> Returns</span>
|
| 167 |
+
<span class="sd"> -------</span>
|
| 168 |
+
<span class="sd"> pd.DataFrame</span>
|
| 169 |
+
<span class="sd"> A pandas DataFrame with the air quality data for the last three days.</span>
|
| 170 |
+
<span class="sd"> """</span>
|
| 171 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PAST_DATA_PATH</span><span class="p">)</span>
|
| 172 |
<span class="k">return</span> <span class="n">data</span></div>
|
| 173 |
|
| 174 |
|
| 175 |
<div class="viewcode-block" id="AirQualityModel.get_last_three_days">
|
| 176 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days">[docs]</a>
|
| 177 |
+
<span class="k">def</span> <span class="nf">get_last_three_days</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
| 178 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 179 |
+
<span class="sd"> Returns all the air quality data for the last three days from the past 3 days data.</span>
|
| 180 |
+
<span class="sd"> </span>
|
| 181 |
+
<span class="sd"> The data is obtained from a CSV file located at PAST_DATA_PATH.</span>
|
| 182 |
+
<span class="sd"> </span>
|
| 183 |
+
<span class="sd"> Returns</span>
|
| 184 |
+
<span class="sd"> -------</span>
|
| 185 |
+
<span class="sd"> pd.DataFrame</span>
|
| 186 |
+
<span class="sd"> A pandas DataFrame with the air quality data for the last three days.</span>
|
| 187 |
+
<span class="sd"> """</span>
|
| 188 |
<span class="c1"># Extract NO2 and O3 values for the last three days</span>
|
| 189 |
<span class="n">data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PAST_DATA_PATH</span><span class="p">)</span>
|
| 190 |
<span class="n">last_three_days</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
|
|
|
|
| 207 |
|
| 208 |
<div class="viewcode-block" id="AirQualityModel.calculate_metrics">
|
| 209 |
<a class="viewcode-back" href="../../../streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics">[docs]</a>
|
| 210 |
+
<span class="k">def</span> <span class="nf">calculate_metrics</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
| 211 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 212 |
+
<span class="sd"> Calculates the root mean squared error for the predictions of the last three days.</span>
|
| 213 |
+
<span class="sd"> </span>
|
| 214 |
+
<span class="sd"> The data is obtained from a CSV file located at PREDICTION_PATH.</span>
|
| 215 |
+
<span class="sd"> </span>
|
| 216 |
+
<span class="sd"> Returns</span>
|
| 217 |
+
<span class="sd"> -------</span>
|
| 218 |
+
<span class="sd"> pd.DataFrame</span>
|
| 219 |
+
<span class="sd"> A pandas DataFrame with the root mean squared error for the predictions of the last three days.</span>
|
| 220 |
+
<span class="sd"> """</span>
|
| 221 |
<span class="n">model_predictions</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">PREDICTION_PATH</span><span class="p">)</span>
|
| 222 |
|
| 223 |
<span class="n">yesterday</span> <span class="o">=</span> <span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="o">-</span> <span class="n">timedelta</span><span class="p">(</span><span class="n">days</span><span class="o">=</span><span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">)</span>
|
|
|
|
| 360 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 361 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 362 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 363 |
+
|
| 364 |
|
| 365 |
</footer>
|
| 366 |
</div>
|
|
|
|
| 371 |
jQuery(function () {
|
| 372 |
SphinxRtdTheme.Navigation.enable(true);
|
| 373 |
});
|
| 374 |
+
</script>
|
| 375 |
|
| 376 |
</body>
|
| 377 |
+
</html>
|
docs/_build/html/_modules/streamlit_src/views/admin_view.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.views.admin_view</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="c1"># views/user_view.py</span>
|
| 73 |
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span>
|
|
@@ -93,7 +93,13 @@
|
|
| 93 |
|
| 94 |
<div class="viewcode-block" id="AdminView.show_admin_pages">
|
| 95 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.admin_view.AdminView.show_admin_pages">[docs]</a>
|
| 96 |
-
<span class="k">def</span> <span class="nf">show_admin_pages</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
<span class="n">page</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">selectbox</span><span class="p">(</span>
|
| 98 |
<span class="s2">"Select a page:"</span><span class="p">,</span>
|
| 99 |
<span class="p">[</span>
|
|
@@ -160,8 +166,8 @@
|
|
| 160 |
<span class="p">)</span>
|
| 161 |
<span class="n">st</span><span class="o">.</span><span class="n">markdown</span><span class="p">(</span><span class="s2">"""</span>
|
| 162 |
<span class="s2"> - **Normalization**: The data must be **unnormalized**.</span>
|
| 163 |
-
<span class="s2"> - **Units**: All measurements should
|
| 164 |
-
<span class="s2"> - **Data Structure**: The dataset must contain a total of **33 columns** with the following order:</span>
|
| 165 |
<span class="s2"> - **Optional**: `date`</span>
|
| 166 |
<span class="s2"> - `PM25` (today)</span>
|
| 167 |
<span class="s2"> - `PM10` (today)</span>
|
|
@@ -261,7 +267,7 @@
|
|
| 261 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 262 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 263 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 264 |
-
|
| 265 |
|
| 266 |
</footer>
|
| 267 |
</div>
|
|
@@ -272,7 +278,7 @@
|
|
| 272 |
jQuery(function () {
|
| 273 |
SphinxRtdTheme.Navigation.enable(true);
|
| 274 |
});
|
| 275 |
-
</script>
|
| 276 |
|
| 277 |
</body>
|
| 278 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.views.admin_view</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="c1"># views/user_view.py</span>
|
| 73 |
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Dict</span>
|
|
|
|
| 93 |
|
| 94 |
<div class="viewcode-block" id="AdminView.show_admin_pages">
|
| 95 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.admin_view.AdminView.show_admin_pages">[docs]</a>
|
| 96 |
+
<span class="k">def</span> <span class="nf">show_admin_pages</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
| 97 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 98 |
+
<span class="sd"> Displays a dropdown for selecting different admin pages.</span>
|
| 99 |
+
|
| 100 |
+
<span class="sd"> Returns:</span>
|
| 101 |
+
<span class="sd"> str: The selected page from the dropdown.</span>
|
| 102 |
+
<span class="sd"> """</span>
|
| 103 |
<span class="n">page</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">selectbox</span><span class="p">(</span>
|
| 104 |
<span class="s2">"Select a page:"</span><span class="p">,</span>
|
| 105 |
<span class="p">[</span>
|
|
|
|
| 166 |
<span class="p">)</span>
|
| 167 |
<span class="n">st</span><span class="o">.</span><span class="n">markdown</span><span class="p">(</span><span class="s2">"""</span>
|
| 168 |
<span class="s2"> - **Normalization**: The data must be **unnormalized**.</span>
|
| 169 |
+
<span class="s2"> - **Units**: All measurements should as specified below**.</span>
|
| 170 |
+
<span class="s2"> - **Data Structure**: The dataset must contain a total of **33 columns** (34 with date) with the following order:</span>
|
| 171 |
<span class="s2"> - **Optional**: `date`</span>
|
| 172 |
<span class="s2"> - `PM25` (today)</span>
|
| 173 |
<span class="s2"> - `PM10` (today)</span>
|
|
|
|
| 267 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 268 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 269 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 270 |
+
|
| 271 |
|
| 272 |
</footer>
|
| 273 |
</div>
|
|
|
|
| 278 |
jQuery(function () {
|
| 279 |
SphinxRtdTheme.Navigation.enable(true);
|
| 280 |
});
|
| 281 |
+
</script>
|
| 282 |
|
| 283 |
</body>
|
| 284 |
+
</html>
|
docs/_build/html/_modules/streamlit_src/views/home_view.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
-
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -67,7 +67,7 @@
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
-
|
| 71 |
<h1>Source code for streamlit_src.views.home_view</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
| 73 |
|
|
@@ -75,26 +75,73 @@
|
|
| 75 |
<div class="viewcode-block" id="HomeView">
|
| 76 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView">[docs]</a>
|
| 77 |
<span class="k">class</span> <span class="nc">HomeView</span><span class="p">:</span>
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
<div class="viewcode-block" id="HomeView.set_layout">
|
| 82 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.set_layout">[docs]</a>
|
| 83 |
-
<span class="k">def</span> <span class="nf">set_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
<span class="n">st</span><span class="o">.</span><span class="n">set_page_config</span><span class="p">(</span><span class="n">page_title</span><span class="o">=</span><span class="s2">"Air Quality Monitoring Dashboard"</span><span class="p">,</span> <span class="n">layout</span><span class="o">=</span><span class="s2">"wide"</span><span class="p">)</span>
|
| 85 |
<span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">"Air Quality Monitoring"</span><span class="p">)</span></div>
|
| 86 |
|
| 87 |
|
| 88 |
<div class="viewcode-block" id="HomeView.show_dashboard_switch">
|
| 89 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.show_dashboard_switch">[docs]</a>
|
| 90 |
-
<span class="k">def</span> <span class="nf">show_dashboard_switch</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
<span class="n">page</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">radio</span><span class="p">(</span><span class="s2">"Go to"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"User Dashboard"</span><span class="p">,</span> <span class="s2">"Admin Dashboard"</span><span class="p">])</span>
|
| 92 |
<span class="k">return</span> <span class="n">page</span></div>
|
| 93 |
|
| 94 |
|
| 95 |
<div class="viewcode-block" id="HomeView.prompt_admin_password">
|
| 96 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.prompt_admin_password">[docs]</a>
|
| 97 |
-
<span class="k">def</span> <span class="nf">prompt_admin_password</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
<span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">markdown</span><span class="p">(</span><span class="s2">"### Admin Access Required"</span><span class="p">)</span>
|
| 99 |
<span class="k">return</span> <span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">text_input</span><span class="p">(</span><span class="s2">"Enter Admin Password:"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s2">"password"</span><span class="p">)</span></div>
|
| 100 |
</div>
|
|
@@ -114,7 +161,7 @@
|
|
| 114 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 115 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 116 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 117 |
-
|
| 118 |
|
| 119 |
</footer>
|
| 120 |
</div>
|
|
@@ -125,7 +172,7 @@
|
|
| 125 |
jQuery(function () {
|
| 126 |
SphinxRtdTheme.Navigation.enable(true);
|
| 127 |
});
|
| 128 |
-
</script>
|
| 129 |
|
| 130 |
</body>
|
| 131 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="../../../_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="../../../_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="../../../_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="../../../genindex.html" />
|
| 20 |
+
<link rel="search" title="Search" href="../../../search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="../../../index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 67 |
</div>
|
| 68 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 69 |
<div itemprop="articleBody">
|
| 70 |
+
|
| 71 |
<h1>Source code for streamlit_src.views.home_view</h1><div class="highlight"><pre>
|
| 72 |
<span></span><span class="kn">import</span> <span class="nn">streamlit</span> <span class="k">as</span> <span class="nn">st</span>
|
| 73 |
|
|
|
|
| 75 |
<div class="viewcode-block" id="HomeView">
|
| 76 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView">[docs]</a>
|
| 77 |
<span class="k">class</span> <span class="nc">HomeView</span><span class="p">:</span>
|
| 78 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 79 |
+
<span class="sd"> The HomeView class manages the layout and logic for the home page, </span>
|
| 80 |
+
<span class="sd"> including the user and admin dashboard navigation.</span>
|
| 81 |
+
|
| 82 |
+
<span class="sd"> Attributes:</span>
|
| 83 |
+
<span class="sd"> None</span>
|
| 84 |
+
|
| 85 |
+
<span class="sd"> Methods:</span>
|
| 86 |
+
<span class="sd"> __init__: Initializes the HomeView class by setting up the home layout.</span>
|
| 87 |
+
<span class="sd"> set_layout: Sets the layout of the home page.</span>
|
| 88 |
+
<span class="sd"> show_dashboard_switch: Displays the user and admin dashboard navigation.</span>
|
| 89 |
+
<span class="sd"> prompt_admin_password: Prompts the user for the admin password.</span>
|
| 90 |
+
<span class="sd"> """</span>
|
| 91 |
+
<div class="viewcode-block" id="HomeView.__init__">
|
| 92 |
+
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.__init__">[docs]</a>
|
| 93 |
+
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 94 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 95 |
+
<span class="sd"> Initializes the HomeView class by setting up the home layout.</span>
|
| 96 |
+
|
| 97 |
+
<span class="sd"> This method is responsible for setting up the Streamlit page configuration and</span>
|
| 98 |
+
<span class="sd"> creating the sidebar title.</span>
|
| 99 |
+
<span class="sd"> """</span>
|
| 100 |
+
<span class="bp">self</span><span class="o">.</span><span class="n">set_layout</span><span class="p">()</span></div>
|
| 101 |
+
|
| 102 |
|
| 103 |
<div class="viewcode-block" id="HomeView.set_layout">
|
| 104 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.set_layout">[docs]</a>
|
| 105 |
+
<span class="k">def</span> <span class="nf">set_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
| 106 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 107 |
+
<span class="sd"> Sets the layout of the home page.</span>
|
| 108 |
+
|
| 109 |
+
<span class="sd"> This method is responsible for setting up the Streamlit page configuration</span>
|
| 110 |
+
<span class="sd"> and creating the sidebar title.</span>
|
| 111 |
+
<span class="sd"> """</span>
|
| 112 |
<span class="n">st</span><span class="o">.</span><span class="n">set_page_config</span><span class="p">(</span><span class="n">page_title</span><span class="o">=</span><span class="s2">"Air Quality Monitoring Dashboard"</span><span class="p">,</span> <span class="n">layout</span><span class="o">=</span><span class="s2">"wide"</span><span class="p">)</span>
|
| 113 |
<span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">"Air Quality Monitoring"</span><span class="p">)</span></div>
|
| 114 |
|
| 115 |
|
| 116 |
<div class="viewcode-block" id="HomeView.show_dashboard_switch">
|
| 117 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.show_dashboard_switch">[docs]</a>
|
| 118 |
+
<span class="k">def</span> <span class="nf">show_dashboard_switch</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
| 119 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 120 |
+
<span class="sd"> Displays the user and admin dashboard navigation.</span>
|
| 121 |
+
|
| 122 |
+
<span class="sd"> This method is responsible for displaying the user and admin dashboard navigation</span>
|
| 123 |
+
<span class="sd"> in the sidebar. It returns the page selected by the user.</span>
|
| 124 |
+
|
| 125 |
+
<span class="sd"> Returns:</span>
|
| 126 |
+
<span class="sd"> str: The page selected by the user.</span>
|
| 127 |
+
<span class="sd"> """</span>
|
| 128 |
<span class="n">page</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">radio</span><span class="p">(</span><span class="s2">"Go to"</span><span class="p">,</span> <span class="p">[</span><span class="s2">"User Dashboard"</span><span class="p">,</span> <span class="s2">"Admin Dashboard"</span><span class="p">])</span>
|
| 129 |
<span class="k">return</span> <span class="n">page</span></div>
|
| 130 |
|
| 131 |
|
| 132 |
<div class="viewcode-block" id="HomeView.prompt_admin_password">
|
| 133 |
<a class="viewcode-back" href="../../../streamlit_src.views.html#streamlit_src.views.home_view.HomeView.prompt_admin_password">[docs]</a>
|
| 134 |
+
<span class="k">def</span> <span class="nf">prompt_admin_password</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
| 135 |
+
<span class="w"> </span><span class="sd">"""</span>
|
| 136 |
+
<span class="sd"> Prompts the user for the admin password.</span>
|
| 137 |
+
|
| 138 |
+
<span class="sd"> This method is responsible for prompting the user for the admin password</span>
|
| 139 |
+
<span class="sd"> when the user navigates to the admin dashboard. It displays a text input</span>
|
| 140 |
+
<span class="sd"> field in the sidebar with a placeholder saying "Enter Admin Password:".</span>
|
| 141 |
+
|
| 142 |
+
<span class="sd"> Returns:</span>
|
| 143 |
+
<span class="sd"> str: The password entered by the user.</span>
|
| 144 |
+
<span class="sd"> """</span>
|
| 145 |
<span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">markdown</span><span class="p">(</span><span class="s2">"### Admin Access Required"</span><span class="p">)</span>
|
| 146 |
<span class="k">return</span> <span class="n">st</span><span class="o">.</span><span class="n">sidebar</span><span class="o">.</span><span class="n">text_input</span><span class="p">(</span><span class="s2">"Enter Admin Password:"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s2">"password"</span><span class="p">)</span></div>
|
| 147 |
</div>
|
|
|
|
| 161 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 162 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 163 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 164 |
+
|
| 165 |
|
| 166 |
</footer>
|
| 167 |
</div>
|
|
|
|
| 172 |
jQuery(function () {
|
| 173 |
SphinxRtdTheme.Navigation.enable(true);
|
| 174 |
});
|
| 175 |
+
</script>
|
| 176 |
|
| 177 |
</body>
|
| 178 |
+
</html>
|
docs/_build/html/air_quality_forecast.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
-
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -20,17 +20,17 @@
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src package" href="streamlit_src.html" />
|
| 23 |
-
<link rel="prev" title="air-quality-forecast" href="modules.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
-
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
@@ -119,7 +119,7 @@
|
|
| 119 |
</div>
|
| 120 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 121 |
<div itemprop="articleBody">
|
| 122 |
-
|
| 123 |
<section id="air-quality-forecast-package">
|
| 124 |
<h1>air_quality_forecast package<a class="headerlink" href="#air-quality-forecast-package" title="Link to this heading"></a></h1>
|
| 125 |
<section id="submodules">
|
|
@@ -204,7 +204,7 @@
|
|
| 204 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 205 |
<dl class="py method">
|
| 206 |
<dt class="sig sig-object py" id="air_quality_forecast.data_pipeline.DataLoader.save_to_csv">
|
| 207 |
-
<span class="sig-name descname"><span class="pre">save_to_csv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/data_pipeline.html#DataLoader.save_to_csv"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.data_pipeline.DataLoader.save_to_csv" title="Link to this definition"></a></dt>
|
| 208 |
<dd><p>Save the data to a CSV file.</p>
|
| 209 |
<dl class="field-list simple">
|
| 210 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -336,7 +336,7 @@
|
|
| 336 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 337 |
<dl class="py method">
|
| 338 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._evaluate_model">
|
| 339 |
-
<span class="sig-name descname"><span class="pre">_evaluate_model</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._evaluate_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._evaluate_model" title="Link to this definition"></a></dt>
|
| 340 |
<dd><p>Evaluate the best model on the test data and log metrics.</p>
|
| 341 |
<dl class="field-list simple">
|
| 342 |
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
|
@@ -357,7 +357,7 @@
|
|
| 357 |
|
| 358 |
<dl class="py method">
|
| 359 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._perform_search">
|
| 360 |
-
<span class="sig-name descname"><span class="pre">_perform_search</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._perform_search"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._perform_search" title="Link to this definition"></a></dt>
|
| 361 |
<dd><p>Perform Bayesian optimization for hyperparameters.</p>
|
| 362 |
<p>This method initializes and performs a BayesSearchCV search for the best
|
| 363 |
hyperparameters of the regressor. The search is performed on the training
|
|
@@ -373,7 +373,7 @@ MLflow.</p>
|
|
| 373 |
|
| 374 |
<dl class="py method">
|
| 375 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._set_data">
|
| 376 |
-
<span class="sig-name descname"><span class="pre">_set_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._set_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._set_data" title="Link to this definition"></a></dt>
|
| 377 |
<dd><p>Set the training and test data as class attributes.</p>
|
| 378 |
<dl class="field-list simple">
|
| 379 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -389,7 +389,7 @@ MLflow.</p>
|
|
| 389 |
|
| 390 |
<dl class="py method">
|
| 391 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._setup_mlflow">
|
| 392 |
-
<span class="sig-name descname"><span class="pre">_setup_mlflow</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._setup_mlflow"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._setup_mlflow" title="Link to this definition"></a></dt>
|
| 393 |
<dd><p>Set up MLflow configuration.</p>
|
| 394 |
<p>This method launches the MLflow server, sets the MLflow experiment name and
|
| 395 |
tracking URI, enables system metrics logging, and turns on autologging of
|
|
@@ -398,7 +398,7 @@ metrics and parameters.</p>
|
|
| 398 |
|
| 399 |
<dl class="py method">
|
| 400 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server">
|
| 401 |
-
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">launch_mlflow_server</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer.launch_mlflow_server"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server" title="Link to this definition"></a></dt>
|
| 402 |
<dd><p>Launch MLflow server at <a class="reference external" href="http://127.0.0.1:5000">http://127.0.0.1:5000</a>, if not already running.</p>
|
| 403 |
<p>If the port is already in use, it will print a message saying so.
|
| 404 |
If there is an error launching the server, it will print the error.</p>
|
|
@@ -423,7 +423,7 @@ If there is an error launching the server, it will print the error.</p>
|
|
| 423 |
|
| 424 |
<dl class="py method">
|
| 425 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer.run">
|
| 426 |
-
<span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer.run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer.run" title="Link to this definition"></a></dt>
|
| 427 |
<dd><p>Run the Bayesian optimization workflow.</p>
|
| 428 |
<dl class="field-list simple">
|
| 429 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -468,7 +468,7 @@ of possible values as values.</p>
|
|
| 468 |
|
| 469 |
<dl class="py function">
|
| 470 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.run_bayesian_optimization">
|
| 471 |
-
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.model_development.</span></span><span class="sig-name descname"><span class="pre">run_bayesian_optimization</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">regressor</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">BaseEstimator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#run_bayesian_optimization"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.run_bayesian_optimization" title="Link to this definition"></a></dt>
|
| 472 |
<dd><p>Run Bayesian optimization to search for the best hyperparameters for a given regressor.</p>
|
| 473 |
<dl class="field-list simple">
|
| 474 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -499,7 +499,7 @@ using Bayesian optimization.</p>
|
|
| 499 |
|
| 500 |
<dl class="py function">
|
| 501 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.train_one_model">
|
| 502 |
-
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.model_development.</span></span><span class="sig-name descname"><span class="pre">train_one_model</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#train_one_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.train_one_model" title="Link to this definition"></a></dt>
|
| 503 |
<dd></dd></dl>
|
| 504 |
|
| 505 |
</section>
|
|
@@ -532,7 +532,7 @@ without having to run all other algorithms.</p>
|
|
| 532 |
|
| 533 |
<dl class="py function">
|
| 534 |
<dt class="sig sig-object py" id="air_quality_forecast.parser_ui.train_model">
|
| 535 |
-
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.parser_ui.</span></span><span class="sig-name descname"><span class="pre">train_model</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/parser_ui.html#train_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.parser_ui.train_model" title="Link to this definition"></a></dt>
|
| 536 |
<dd><p>Train a model using Bayesian optimization.</p>
|
| 537 |
</dd></dl>
|
| 538 |
|
|
@@ -545,7 +545,7 @@ without having to run all other algorithms.</p>
|
|
| 545 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 546 |
<dl class="py method">
|
| 547 |
<dt class="sig sig-object py" id="air_quality_forecast.prediction.PredictorModels._load_models">
|
| 548 |
-
<span class="sig-name descname"><span class="pre">_load_models</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/prediction.html#PredictorModels._load_models"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.prediction.PredictorModels._load_models" title="Link to this definition"></a></dt>
|
| 549 |
<dd><p>Loads the pre-trained models from the saved_models directory.</p>
|
| 550 |
<p>The models are loaded in the following order:</p>
|
| 551 |
<ol class="arabic simple">
|
|
@@ -656,7 +656,7 @@ without having to run all other algorithms.</p>
|
|
| 656 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 657 |
<dl class="py method">
|
| 658 |
<dt class="sig sig-object py" id="air_quality_forecast.utils.InputValidator.validate_file_exists">
|
| 659 |
-
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">validate_file_exists</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variable_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/utils.html#InputValidator.validate_file_exists"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.utils.InputValidator.validate_file_exists" title="Link to this definition"></a></dt>
|
| 660 |
<dd><p>Validate that the file path exists.</p>
|
| 661 |
<dl class="field-list simple">
|
| 662 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -673,7 +673,7 @@ without having to run all other algorithms.</p>
|
|
| 673 |
|
| 674 |
<dl class="py method">
|
| 675 |
<dt class="sig sig-object py" id="air_quality_forecast.utils.InputValidator.validate_type">
|
| 676 |
-
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">validate_type</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expected_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variable_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/air_quality_forecast/utils.html#InputValidator.validate_type"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.utils.InputValidator.validate_type" title="Link to this definition"></a></dt>
|
| 677 |
<dd><p>Validate the type of the given variable.</p>
|
| 678 |
<dl class="field-list simple">
|
| 679 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -714,7 +714,7 @@ without having to run all other algorithms.</p>
|
|
| 714 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 715 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 716 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 717 |
-
|
| 718 |
|
| 719 |
</footer>
|
| 720 |
</div>
|
|
@@ -725,7 +725,7 @@ without having to run all other algorithms.</p>
|
|
| 725 |
jQuery(function () {
|
| 726 |
SphinxRtdTheme.Navigation.enable(true);
|
| 727 |
});
|
| 728 |
-
</script>
|
| 729 |
|
| 730 |
</body>
|
| 731 |
-
</html>
|
|
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
+
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src package" href="streamlit_src.html" />
|
| 23 |
+
<link rel="prev" title="air-quality-forecast" href="modules.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
+
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
|
|
| 119 |
</div>
|
| 120 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 121 |
<div itemprop="articleBody">
|
| 122 |
+
|
| 123 |
<section id="air-quality-forecast-package">
|
| 124 |
<h1>air_quality_forecast package<a class="headerlink" href="#air-quality-forecast-package" title="Link to this heading"></a></h1>
|
| 125 |
<section id="submodules">
|
|
|
|
| 204 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 205 |
<dl class="py method">
|
| 206 |
<dt class="sig sig-object py" id="air_quality_forecast.data_pipeline.DataLoader.save_to_csv">
|
| 207 |
+
<span class="sig-name descname"><span class="pre">save_to_csv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/data_pipeline.html#DataLoader.save_to_csv"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.data_pipeline.DataLoader.save_to_csv" title="Link to this definition"></a></dt>
|
| 208 |
<dd><p>Save the data to a CSV file.</p>
|
| 209 |
<dl class="field-list simple">
|
| 210 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 336 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 337 |
<dl class="py method">
|
| 338 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._evaluate_model">
|
| 339 |
+
<span class="sig-name descname"><span class="pre">_evaluate_model</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._evaluate_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._evaluate_model" title="Link to this definition"></a></dt>
|
| 340 |
<dd><p>Evaluate the best model on the test data and log metrics.</p>
|
| 341 |
<dl class="field-list simple">
|
| 342 |
<dt class="field-odd">Raises<span class="colon">:</span></dt>
|
|
|
|
| 357 |
|
| 358 |
<dl class="py method">
|
| 359 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._perform_search">
|
| 360 |
+
<span class="sig-name descname"><span class="pre">_perform_search</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._perform_search"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._perform_search" title="Link to this definition"></a></dt>
|
| 361 |
<dd><p>Perform Bayesian optimization for hyperparameters.</p>
|
| 362 |
<p>This method initializes and performs a BayesSearchCV search for the best
|
| 363 |
hyperparameters of the regressor. The search is performed on the training
|
|
|
|
| 373 |
|
| 374 |
<dl class="py method">
|
| 375 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._set_data">
|
| 376 |
+
<span class="sig-name descname"><span class="pre">_set_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._set_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._set_data" title="Link to this definition"></a></dt>
|
| 377 |
<dd><p>Set the training and test data as class attributes.</p>
|
| 378 |
<dl class="field-list simple">
|
| 379 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 389 |
|
| 390 |
<dl class="py method">
|
| 391 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer._setup_mlflow">
|
| 392 |
+
<span class="sig-name descname"><span class="pre">_setup_mlflow</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer._setup_mlflow"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer._setup_mlflow" title="Link to this definition"></a></dt>
|
| 393 |
<dd><p>Set up MLflow configuration.</p>
|
| 394 |
<p>This method launches the MLflow server, sets the MLflow experiment name and
|
| 395 |
tracking URI, enables system metrics logging, and turns on autologging of
|
|
|
|
| 398 |
|
| 399 |
<dl class="py method">
|
| 400 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server">
|
| 401 |
+
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">launch_mlflow_server</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer.launch_mlflow_server"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server" title="Link to this definition"></a></dt>
|
| 402 |
<dd><p>Launch MLflow server at <a class="reference external" href="http://127.0.0.1:5000">http://127.0.0.1:5000</a>, if not already running.</p>
|
| 403 |
<p>If the port is already in use, it will print a message saying so.
|
| 404 |
If there is an error launching the server, it will print the error.</p>
|
|
|
|
| 423 |
|
| 424 |
<dl class="py method">
|
| 425 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.RegressorTrainer.run">
|
| 426 |
+
<span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#RegressorTrainer.run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.RegressorTrainer.run" title="Link to this definition"></a></dt>
|
| 427 |
<dd><p>Run the Bayesian optimization workflow.</p>
|
| 428 |
<dl class="field-list simple">
|
| 429 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 468 |
|
| 469 |
<dl class="py function">
|
| 470 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.run_bayesian_optimization">
|
| 471 |
+
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.model_development.</span></span><span class="sig-name descname"><span class="pre">run_bayesian_optimization</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">regressor</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">BaseEstimator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#run_bayesian_optimization"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.run_bayesian_optimization" title="Link to this definition"></a></dt>
|
| 472 |
<dd><p>Run Bayesian optimization to search for the best hyperparameters for a given regressor.</p>
|
| 473 |
<dl class="field-list simple">
|
| 474 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 499 |
|
| 500 |
<dl class="py function">
|
| 501 |
<dt class="sig sig-object py" id="air_quality_forecast.model_development.train_one_model">
|
| 502 |
+
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.model_development.</span></span><span class="sig-name descname"><span class="pre">train_one_model</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/model_development.html#train_one_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.model_development.train_one_model" title="Link to this definition"></a></dt>
|
| 503 |
<dd></dd></dl>
|
| 504 |
|
| 505 |
</section>
|
|
|
|
| 532 |
|
| 533 |
<dl class="py function">
|
| 534 |
<dt class="sig sig-object py" id="air_quality_forecast.parser_ui.train_model">
|
| 535 |
+
<span class="sig-prename descclassname"><span class="pre">air_quality_forecast.parser_ui.</span></span><span class="sig-name descname"><span class="pre">train_model</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_train</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y_test</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">experiment_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">param_space</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Dict</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Any</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_iter</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/parser_ui.html#train_model"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.parser_ui.train_model" title="Link to this definition"></a></dt>
|
| 536 |
<dd><p>Train a model using Bayesian optimization.</p>
|
| 537 |
</dd></dl>
|
| 538 |
|
|
|
|
| 545 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 546 |
<dl class="py method">
|
| 547 |
<dt class="sig sig-object py" id="air_quality_forecast.prediction.PredictorModels._load_models">
|
| 548 |
+
<span class="sig-name descname"><span class="pre">_load_models</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/prediction.html#PredictorModels._load_models"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.prediction.PredictorModels._load_models" title="Link to this definition"></a></dt>
|
| 549 |
<dd><p>Loads the pre-trained models from the saved_models directory.</p>
|
| 550 |
<p>The models are loaded in the following order:</p>
|
| 551 |
<ol class="arabic simple">
|
|
|
|
| 656 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 657 |
<dl class="py method">
|
| 658 |
<dt class="sig sig-object py" id="air_quality_forecast.utils.InputValidator.validate_file_exists">
|
| 659 |
+
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">validate_file_exists</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variable_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/utils.html#InputValidator.validate_file_exists"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.utils.InputValidator.validate_file_exists" title="Link to this definition"></a></dt>
|
| 660 |
<dd><p>Validate that the file path exists.</p>
|
| 661 |
<dl class="field-list simple">
|
| 662 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 673 |
|
| 674 |
<dl class="py method">
|
| 675 |
<dt class="sig sig-object py" id="air_quality_forecast.utils.InputValidator.validate_type">
|
| 676 |
+
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">validate_type</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expected_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variable_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/air_quality_forecast/utils.html#InputValidator.validate_type"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#air_quality_forecast.utils.InputValidator.validate_type" title="Link to this definition"></a></dt>
|
| 677 |
<dd><p>Validate the type of the given variable.</p>
|
| 678 |
<dl class="field-list simple">
|
| 679 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 714 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 715 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 716 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 717 |
+
|
| 718 |
|
| 719 |
</footer>
|
| 720 |
</div>
|
|
|
|
| 725 |
jQuery(function () {
|
| 726 |
SphinxRtdTheme.Navigation.enable(true);
|
| 727 |
});
|
| 728 |
+
</script>
|
| 729 |
|
| 730 |
</body>
|
| 731 |
+
</html>
|
docs/_build/html/genindex.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
-
|
| 13 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -17,17 +17,17 @@
|
|
| 17 |
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="#" />
|
| 20 |
-
<link rel="search" title="Search" href="search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
-
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
<a href="index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
@@ -66,7 +66,7 @@
|
|
| 66 |
</div>
|
| 67 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 68 |
<div itemprop="articleBody">
|
| 69 |
-
|
| 70 |
|
| 71 |
<h1 id="index">Index</h1>
|
| 72 |
|
|
@@ -91,12 +91,14 @@
|
|
| 91 |
| <a href="#U"><strong>U</strong></a>
|
| 92 |
| <a href="#V"><strong>V</strong></a>
|
| 93 |
| <a href="#X"><strong>X</strong></a>
|
| 94 |
-
|
| 95 |
</div>
|
| 96 |
<h2 id="_">_</h2>
|
| 97 |
<table style="width: 100%" class="indextable genindextable"><tr>
|
| 98 |
<td style="width: 33%; vertical-align: top;"><ul>
|
| 99 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH">__ADMIN_PASSWORD_HASH (streamlit_src.controllers.home_controller.HomeController attribute)</a>
|
|
|
|
|
|
|
| 100 |
</li>
|
| 101 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._check_data_out_of_distribution">_check_data_out_of_distribution() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
| 102 |
</li>
|
|
@@ -130,10 +132,10 @@
|
|
| 130 |
</li>
|
| 131 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.user_controller.UserController._is_current_data_available">_is_current_data_available() (streamlit_src.controllers.user_controller.UserController method)</a>
|
| 132 |
</li>
|
| 133 |
-
</ul></td>
|
| 134 |
-
<td style="width: 33%; vertical-align: top;"><ul>
|
| 135 |
<li><a href="air_quality_forecast.html#air_quality_forecast.prediction.PredictorModels._load_models">_load_models() (air_quality_forecast.prediction.PredictorModels method)</a>
|
| 136 |
</li>
|
|
|
|
|
|
|
| 137 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions">_make_custom_predictions() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
| 138 |
</li>
|
| 139 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._make_prediction">_make_prediction() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
|
@@ -169,6 +171,10 @@
|
|
| 169 |
</li>
|
| 170 |
</ul></li>
|
| 171 |
<li><a href="air_quality_forecast.html#air_quality_forecast.api_caller.APICaller._two_days_ago">_two_days_ago() (air_quality_forecast.api_caller.APICaller method)</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
</li>
|
| 173 |
</ul></td>
|
| 174 |
</tr></table>
|
|
@@ -438,6 +444,8 @@
|
|
| 438 |
</li>
|
| 439 |
</ul></td>
|
| 440 |
<td style="width: 33%; vertical-align: top;"><ul>
|
|
|
|
|
|
|
| 441 |
<li><a href="air_quality_forecast.html#air_quality_forecast.parser_ui.normalize_data">normalize_data() (in module air_quality_forecast.parser_ui)</a>
|
| 442 |
</li>
|
| 443 |
</ul></td>
|
|
@@ -458,7 +466,7 @@
|
|
| 458 |
</li>
|
| 459 |
<li><a href="streamlit_src.views.html#streamlit_src.views.user_view.UserView.print_sources">print_sources() (streamlit_src.views.user_view.UserView method)</a>
|
| 460 |
</li>
|
| 461 |
-
<li><a href="streamlit_src.views.html#
|
| 462 |
</li>
|
| 463 |
</ul></td>
|
| 464 |
</tr></table>
|
|
@@ -502,7 +510,7 @@
|
|
| 502 |
</li>
|
| 503 |
<li><a href="air_quality_forecast.html#air_quality_forecast.data_pipeline.FeatureProcessor.select_features">select_features() (air_quality_forecast.data_pipeline.FeatureProcessor method)</a>
|
| 504 |
</li>
|
| 505 |
-
<li><a href="streamlit_src.views.html#
|
| 506 |
</li>
|
| 507 |
<li><a href="streamlit_src.views.html#streamlit_src.views.admin_view.AdminView.show_admin_pages">show_admin_pages() (streamlit_src.views.admin_view.AdminView method)</a>
|
| 508 |
</li>
|
|
@@ -514,7 +522,7 @@
|
|
| 514 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.user_controller.UserController.show_dashboard">(streamlit_src.controllers.user_controller.UserController method)</a>
|
| 515 |
</li>
|
| 516 |
</ul></li>
|
| 517 |
-
<li><a href="streamlit_src.views.html#
|
| 518 |
</li>
|
| 519 |
<li><a href="air_quality_forecast.html#air_quality_forecast.data_pipeline.FeatureProcessor.sort_data_by_date">sort_data_by_date() (air_quality_forecast.data_pipeline.FeatureProcessor method)</a>
|
| 520 |
</li>
|
|
@@ -682,7 +690,7 @@
|
|
| 682 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 683 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 684 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 685 |
-
|
| 686 |
|
| 687 |
</footer>
|
| 688 |
</div>
|
|
@@ -693,7 +701,7 @@
|
|
| 693 |
jQuery(function () {
|
| 694 |
SphinxRtdTheme.Navigation.enable(true);
|
| 695 |
});
|
| 696 |
-
</script>
|
| 697 |
|
| 698 |
</body>
|
| 699 |
-
</html>
|
|
|
|
| 9 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 11 |
|
| 12 |
+
|
| 13 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 14 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 15 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 17 |
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
| 18 |
<script src="_static/js/theme.js"></script>
|
| 19 |
<link rel="index" title="Index" href="#" />
|
| 20 |
+
<link rel="search" title="Search" href="search.html" />
|
| 21 |
</head>
|
| 22 |
|
| 23 |
+
<body class="wy-body-for-nav">
|
| 24 |
<div class="wy-grid-for-nav">
|
| 25 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 26 |
<div class="wy-side-scroll">
|
| 27 |
<div class="wy-side-nav-search" >
|
| 28 |
|
| 29 |
+
|
| 30 |
+
|
| 31 |
<a href="index.html" class="icon icon-home">
|
| 32 |
Air Quality Forecast
|
| 33 |
</a>
|
|
|
|
| 66 |
</div>
|
| 67 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 68 |
<div itemprop="articleBody">
|
| 69 |
+
|
| 70 |
|
| 71 |
<h1 id="index">Index</h1>
|
| 72 |
|
|
|
|
| 91 |
| <a href="#U"><strong>U</strong></a>
|
| 92 |
| <a href="#V"><strong>V</strong></a>
|
| 93 |
| <a href="#X"><strong>X</strong></a>
|
| 94 |
+
|
| 95 |
</div>
|
| 96 |
<h2 id="_">_</h2>
|
| 97 |
<table style="width: 100%" class="indextable genindextable"><tr>
|
| 98 |
<td style="width: 33%; vertical-align: top;"><ul>
|
| 99 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH">__ADMIN_PASSWORD_HASH (streamlit_src.controllers.home_controller.HomeController attribute)</a>
|
| 100 |
+
</li>
|
| 101 |
+
<li><a href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.__init__">__init__() (streamlit_src.views.home_view.HomeView method)</a>
|
| 102 |
</li>
|
| 103 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._check_data_out_of_distribution">_check_data_out_of_distribution() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
| 104 |
</li>
|
|
|
|
| 132 |
</li>
|
| 133 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.user_controller.UserController._is_current_data_available">_is_current_data_available() (streamlit_src.controllers.user_controller.UserController method)</a>
|
| 134 |
</li>
|
|
|
|
|
|
|
| 135 |
<li><a href="air_quality_forecast.html#air_quality_forecast.prediction.PredictorModels._load_models">_load_models() (air_quality_forecast.prediction.PredictorModels method)</a>
|
| 136 |
</li>
|
| 137 |
+
</ul></td>
|
| 138 |
+
<td style="width: 33%; vertical-align: top;"><ul>
|
| 139 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions">_make_custom_predictions() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
| 140 |
</li>
|
| 141 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.admin_controller.AdminController._make_prediction">_make_prediction() (streamlit_src.controllers.admin_controller.AdminController method)</a>
|
|
|
|
| 171 |
</li>
|
| 172 |
</ul></li>
|
| 173 |
<li><a href="air_quality_forecast.html#air_quality_forecast.api_caller.APICaller._two_days_ago">_two_days_ago() (air_quality_forecast.api_caller.APICaller method)</a>
|
| 174 |
+
</li>
|
| 175 |
+
<li><a href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel._WHO_NO2_LEVEL">_WHO_NO2_LEVEL (streamlit_src.models.air_quality_model.AirQualityModel attribute)</a>
|
| 176 |
+
</li>
|
| 177 |
+
<li><a href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel._WHO_O3_LEVEL">_WHO_O3_LEVEL (streamlit_src.models.air_quality_model.AirQualityModel attribute)</a>
|
| 178 |
</li>
|
| 179 |
</ul></td>
|
| 180 |
</tr></table>
|
|
|
|
| 444 |
</li>
|
| 445 |
</ul></td>
|
| 446 |
<td style="width: 33%; vertical-align: top;"><ul>
|
| 447 |
+
<li><a href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None">None (streamlit_src.views.home_view.HomeView attribute)</a>
|
| 448 |
+
</li>
|
| 449 |
<li><a href="air_quality_forecast.html#air_quality_forecast.parser_ui.normalize_data">normalize_data() (in module air_quality_forecast.parser_ui)</a>
|
| 450 |
</li>
|
| 451 |
</ul></td>
|
|
|
|
| 466 |
</li>
|
| 467 |
<li><a href="streamlit_src.views.html#streamlit_src.views.user_view.UserView.print_sources">print_sources() (streamlit_src.views.user_view.UserView method)</a>
|
| 468 |
</li>
|
| 469 |
+
<li><a href="streamlit_src.views.html#id0">prompt_admin_password() (streamlit_src.views.home_view.HomeView method)</a>, <a href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.prompt_admin_password">[1]</a>
|
| 470 |
</li>
|
| 471 |
</ul></td>
|
| 472 |
</tr></table>
|
|
|
|
| 510 |
</li>
|
| 511 |
<li><a href="air_quality_forecast.html#air_quality_forecast.data_pipeline.FeatureProcessor.select_features">select_features() (air_quality_forecast.data_pipeline.FeatureProcessor method)</a>
|
| 512 |
</li>
|
| 513 |
+
<li><a href="streamlit_src.views.html#id1">set_layout() (streamlit_src.views.home_view.HomeView method)</a>, <a href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.set_layout">[1]</a>
|
| 514 |
</li>
|
| 515 |
<li><a href="streamlit_src.views.html#streamlit_src.views.admin_view.AdminView.show_admin_pages">show_admin_pages() (streamlit_src.views.admin_view.AdminView method)</a>
|
| 516 |
</li>
|
|
|
|
| 522 |
<li><a href="streamlit_src.controllers.html#streamlit_src.controllers.user_controller.UserController.show_dashboard">(streamlit_src.controllers.user_controller.UserController method)</a>
|
| 523 |
</li>
|
| 524 |
</ul></li>
|
| 525 |
+
<li><a href="streamlit_src.views.html#id2">show_dashboard_switch() (streamlit_src.views.home_view.HomeView method)</a>, <a href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.show_dashboard_switch">[1]</a>
|
| 526 |
</li>
|
| 527 |
<li><a href="air_quality_forecast.html#air_quality_forecast.data_pipeline.FeatureProcessor.sort_data_by_date">sort_data_by_date() (air_quality_forecast.data_pipeline.FeatureProcessor method)</a>
|
| 528 |
</li>
|
|
|
|
| 690 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 691 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 692 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 693 |
+
|
| 694 |
|
| 695 |
</footer>
|
| 696 |
</div>
|
|
|
|
| 701 |
jQuery(function () {
|
| 702 |
SphinxRtdTheme.Navigation.enable(true);
|
| 703 |
});
|
| 704 |
+
</script>
|
| 705 |
|
| 706 |
</body>
|
| 707 |
+
</html>
|
docs/_build/html/objects.inv
CHANGED
|
Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ
|
|
|
docs/_build/html/searchindex.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
Search.setIndex({"alltitles": {"Air Quality Forecast documentation": [[1, null]], "Codebase": [[1, "codebase"]], "Contents:": [[1, null]], "Deployment": [[1, "deployment"]], "Directory Breakdown": [[1, "directory-breakdown"]], "Module contents": [[0, "module-air_quality_forecast"], [3, "module-streamlit_src"], [4, "module-streamlit_src.controllers"], [5, "module-streamlit_src.models"], [6, "module-streamlit_src.views"]], "Problem Statement": [[1, "problem-statement"]], "Project Structure": [[1, "project-structure"]], "Retraining Protocol": [[1, "retraining-protocol"]], "Submodules": [[0, "submodules"], [3, "submodules"], [4, "submodules"], [5, "submodules"], [6, "submodules"]], "Subpackages": [[3, "subpackages"]], "Workflow": [[1, "workflow"]], "air-quality-forecast": [[2, null]], "air_quality_forecast package": [[0, null]], "air_quality_forecast.api_caller module": [[0, "module-air_quality_forecast.api_caller"]], "air_quality_forecast.data_pipeline module": [[0, "module-air_quality_forecast.data_pipeline"]], "air_quality_forecast.get_prediction_data module": [[0, "module-air_quality_forecast.get_prediction_data"]], "air_quality_forecast.main module": [[0, "module-air_quality_forecast.main"]], "air_quality_forecast.model_development module": [[0, "module-air_quality_forecast.model_development"]], "air_quality_forecast.parser_ui module": [[0, "module-air_quality_forecast.parser_ui"]], "air_quality_forecast.prediction module": [[0, "module-air_quality_forecast.prediction"]], "air_quality_forecast.utils module": [[0, "module-air_quality_forecast.utils"]], "streamlit_src package": [[3, null]], "streamlit_src.app module": [[3, "module-streamlit_src.app"]], "streamlit_src.controllers package": [[4, null]], "streamlit_src.controllers.admin_controller module": [[4, "module-streamlit_src.controllers.admin_controller"]], "streamlit_src.controllers.home_controller module": [[4, "module-streamlit_src.controllers.home_controller"]], "streamlit_src.controllers.user_controller module": [[4, "module-streamlit_src.controllers.user_controller"]], "streamlit_src.models package": [[5, null]], "streamlit_src.models.air_quality_model module": [[5, "module-streamlit_src.models.air_quality_model"]], "streamlit_src.views package": [[6, null]], "streamlit_src.views.admin_view module": [[6, "module-streamlit_src.views.admin_view"]], "streamlit_src.views.home_view module": [[6, "module-streamlit_src.views.home_view"]], "streamlit_src.views.user_view module": [[6, "module-streamlit_src.views.user_view"]]}, "docnames": ["air_quality_forecast", "index", "modules", "streamlit_src", "streamlit_src.controllers", "streamlit_src.models", "streamlit_src.views"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["air_quality_forecast.rst", "index.rst", "modules.rst", "streamlit_src.rst", "streamlit_src.controllers.rst", "streamlit_src.models.rst", "streamlit_src.views.rst"], "indexentries": {"__admin_password_hash (streamlit_src.controllers.home_controller.homecontroller attribute)": [[4, "streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH", false]], "_check_data_out_of_distribution() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._check_data_out_of_distribution", false]], "_compare_to_who() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._compare_to_who", false]], "_compute_distribution_statistics() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._compute_distribution_statistics", false]], "_create_gauge_plot() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._create_gauge_plot", false]], "_current_time() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._current_time", false]], "_data_is_valid() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._data_is_valid", false]], "_display_compare_who() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_compare_who", false]], "_display_plots() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_plots", false]], "_display_sources() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_sources", false]], "_evaluate_model() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._evaluate_model", false]], "_feature_importance() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._feature_importance", false]], "_get_color() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._get_color", false]], "_get_luchtmeet_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._get_luchtmeet_data", false]], "_get_next_three_days_dates() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._get_next_three_days_dates", false]], "_hash_password() (streamlit_src.controllers.home_controller.homecontroller method)": [[4, "streamlit_src.controllers.home_controller.HomeController._hash_password", false]], "_is_current_data_available() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._is_current_data_available", false]], "_load_models() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels._load_models", false]], "_make_custom_predictions() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions", false]], "_make_prediction() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._make_prediction", false]], "_model_metrics() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._model_metrics", false]], "_optimize_and_evaluate() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._optimize_and_evaluate", false]], "_perform_search() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._perform_search", false]], "_prepare_awareness_content() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_awareness_content", false]], "_prepare_data_for_view() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_data_for_view", false]], "_prepare_gauge_plots() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_gauge_plots", false]], "_prepare_line_plot() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_line_plot", false]], "_quiz() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._quiz", false]], "_raise_awareness() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._raise_awareness", false]], "_run() (streamlit_src.controllers.home_controller.homecontroller method)": [[4, "streamlit_src.controllers.home_controller.HomeController._run", false]], "_set_data() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._set_data", false]], "_setup_mlflow() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._setup_mlflow", false]], "_show_current_data() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._show_current_data", false]], "_show_current_data() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._show_current_data", false]], "_two_days_ago() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._two_days_ago", false]], "admincontroller (class in streamlit_src.controllers.admin_controller)": [[4, "streamlit_src.controllers.admin_controller.AdminController", false]], "adminview (class in streamlit_src.views.admin_view)": [[6, "streamlit_src.views.admin_view.AdminView", false]], "air_quality_forecast": [[0, "module-air_quality_forecast", false]], "air_quality_forecast.api_caller": [[0, "module-air_quality_forecast.api_caller", false]], "air_quality_forecast.data_pipeline": [[0, "module-air_quality_forecast.data_pipeline", false]], "air_quality_forecast.get_prediction_data": [[0, "module-air_quality_forecast.get_prediction_data", false]], "air_quality_forecast.main": [[0, "module-air_quality_forecast.main", false]], "air_quality_forecast.model_development": [[0, "module-air_quality_forecast.model_development", false]], "air_quality_forecast.parser_ui": [[0, "module-air_quality_forecast.parser_ui", false]], "air_quality_forecast.prediction": [[0, "module-air_quality_forecast.prediction", false]], "air_quality_forecast.utils": [[0, "module-air_quality_forecast.utils", false]], "airqualitymodel (class in streamlit_src.models.air_quality_model)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel", false]], "apicaller (class in air_quality_forecast.api_caller)": [[0, "air_quality_forecast.api_caller.APICaller", false]], "apply_time_shift() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.apply_time_shift", false]], "calculate_metrics() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics", false]], "change_to_numeric() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.change_to_numeric", false]], "compare_to_who() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.compare_to_who", false]], "confirm_checks() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.confirm_checks", false]], "convert_param_space() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.convert_param_space", false]], "create_parser() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.create_parser", false]], "data_not_available() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.data_not_available", false]], "dataloader (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.DataLoader", false]], "decision_tree_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.decision_tree_predictions", false]], "display_datatable() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.display_datatable", false]], "display_feature_importance() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.display_feature_importance", false]], "display_predictions_gaugeplot() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.display_predictions_gaugeplot", false]], "display_predictions_lineplot() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.display_predictions_lineplot", false]], "download_button() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.download_button", false]], "error() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.error", false]], "featureprocessor (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor", false]], "featureselector (class in air_quality_forecast.utils)": [[0, "air_quality_forecast.utils.FeatureSelector", false]], "get_all_data_last_three_days() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days", false]], "get_last_three_days() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days", false]], "get_luchtmeet_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.get_luchtmeet_data", false]], "get_today_data() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_today_data", false]], "get_vc_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.get_vc_data", false]], "homecontroller (class in streamlit_src.controllers.home_controller)": [[4, "streamlit_src.controllers.home_controller.HomeController", false]], "homeview (class in streamlit_src.views.home_view)": [[6, "streamlit_src.views.home_view.HomeView", false]], "inputvalidator (class in air_quality_forecast.utils)": [[0, "air_quality_forecast.utils.InputValidator", false]], "lag_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.lag_data", false]], "launch_mlflow_server() (air_quality_forecast.model_development.regressortrainer static method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server", false]], "load_data() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.load_data", false]], "main() (in module air_quality_forecast.get_prediction_data)": [[0, "air_quality_forecast.get_prediction_data.main", false]], "main() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.main", false]], "merge_raw_data() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.merge_raw_data", false]], "module": [[0, "module-air_quality_forecast", false], [0, "module-air_quality_forecast.api_caller", false], [0, "module-air_quality_forecast.data_pipeline", false], [0, "module-air_quality_forecast.get_prediction_data", false], [0, "module-air_quality_forecast.main", false], [0, "module-air_quality_forecast.model_development", false], [0, "module-air_quality_forecast.parser_ui", false], [0, "module-air_quality_forecast.prediction", false], [0, "module-air_quality_forecast.utils", false], [3, "module-streamlit_src", false], [3, "module-streamlit_src.app", false], [4, "module-streamlit_src.controllers", false], [4, "module-streamlit_src.controllers.admin_controller", false], [4, "module-streamlit_src.controllers.home_controller", false], [4, "module-streamlit_src.controllers.user_controller", false], [5, "module-streamlit_src.models", false], [5, "module-streamlit_src.models.air_quality_model", false], [6, "module-streamlit_src.views", false], [6, "module-streamlit_src.views.admin_view", false], [6, "module-streamlit_src.views.home_view", false], [6, "module-streamlit_src.views.user_view", false]], "next_three_day_predictions() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions", false]], "normalize_data() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.normalize_data", false]], "port_in_use() (air_quality_forecast.model_development.regressortrainer static method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.port_in_use", false]], "predictormodels (class in air_quality_forecast.prediction)": [[0, "air_quality_forecast.prediction.PredictorModels", false]], "preprocess_data() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.preprocess_data", false]], "preprocessingpipeline (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline", false]], "print_sources() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.print_sources", false]], "prompt_admin_password() (streamlit_src.views.home_view.homeview method)": [[6, "streamlit_src.views.home_view.HomeView.prompt_admin_password", false]], "quiz() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.quiz", false]], "raise_awareness() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.raise_awareness", false]], "random_forest_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.random_forest_predictions", false]], "regressortrainer (class in air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.RegressorTrainer", false]], "rename_initial_columns() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.rename_initial_columns", false]], "run() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.run", false]], "run_bayesian_optimization() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.run_bayesian_optimization", false]], "run_pipeline() (air_quality_forecast.data_pipeline.preprocessingpipeline method)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline.run_pipeline", false]], "save_to_csv() (air_quality_forecast.data_pipeline.dataloader method)": [[0, "air_quality_forecast.data_pipeline.DataLoader.save_to_csv", false]], "select_cols_by_correlation() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.select_cols_by_correlation", false]], "select_features() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.select_features", false]], "set_layout() (streamlit_src.views.home_view.homeview method)": [[6, "streamlit_src.views.home_view.HomeView.set_layout", false]], "show_admin_pages() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.show_admin_pages", false]], "show_current_data() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.show_current_data", false]], "show_dashboard() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController.show_dashboard", false]], "show_dashboard() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController.show_dashboard", false]], "show_dashboard_switch() (streamlit_src.views.home_view.homeview method)": [[6, "streamlit_src.views.home_view.HomeView.show_dashboard_switch", false]], "sort_data_by_date() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.sort_data_by_date", false]], "streamlit_src": [[3, "module-streamlit_src", false]], "streamlit_src.app": [[3, "module-streamlit_src.app", false]], "streamlit_src.controllers": [[4, "module-streamlit_src.controllers", false]], "streamlit_src.controllers.admin_controller": [[4, "module-streamlit_src.controllers.admin_controller", false]], "streamlit_src.controllers.home_controller": [[4, "module-streamlit_src.controllers.home_controller", false]], "streamlit_src.controllers.user_controller": [[4, "module-streamlit_src.controllers.user_controller", false]], "streamlit_src.models": [[5, "module-streamlit_src.models", false]], "streamlit_src.models.air_quality_model": [[5, "module-streamlit_src.models.air_quality_model", false]], "streamlit_src.views": [[6, "module-streamlit_src.views", false]], "streamlit_src.views.admin_view": [[6, "module-streamlit_src.views.admin_view", false]], "streamlit_src.views.home_view": [[6, "module-streamlit_src.views.home_view", false]], "streamlit_src.views.user_view": [[6, "module-streamlit_src.views.user_view", false]], "success() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.success", false]], "train_all_models() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.train_all_models", false]], "train_model() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.train_model", false]], "train_one_model() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.train_one_model", false]], "train_test_split() (air_quality_forecast.data_pipeline.preprocessingpipeline method)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline.train_test_split", false]], "two_columns_layout() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.two_columns_layout", false]], "uninformative_columns() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.uninformative_columns", false]], "upload_dataset() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.upload_dataset", false]], "upload_instructions() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.upload_instructions", false]], "usercontroller (class in streamlit_src.controllers.user_controller)": [[4, "streamlit_src.controllers.user_controller.UserController", false]], "userview (class in streamlit_src.views.user_view)": [[6, "streamlit_src.views.user_view.UserView", false]], "validate_file_exists() (air_quality_forecast.utils.inputvalidator static method)": [[0, "air_quality_forecast.utils.InputValidator.validate_file_exists", false]], "validate_type() (air_quality_forecast.utils.inputvalidator static method)": [[0, "air_quality_forecast.utils.InputValidator.validate_type", false]], "view_option_selection() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.view_option_selection", false]], "xgb_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.xgb_predictions", false]]}, "objects": {"": [[0, 0, 0, "-", "air_quality_forecast"], [3, 0, 0, "-", "streamlit_src"]], "air_quality_forecast": [[0, 0, 0, "-", "api_caller"], [0, 0, 0, "-", "data_pipeline"], [0, 0, 0, "-", "get_prediction_data"], [0, 0, 0, "-", "main"], [0, 0, 0, "-", "model_development"], [0, 0, 0, "-", "parser_ui"], [0, 0, 0, "-", "prediction"], [0, 0, 0, "-", "utils"]], "air_quality_forecast.api_caller": [[0, 1, 1, "", "APICaller"]], "air_quality_forecast.api_caller.APICaller": [[0, 2, 1, "", "_current_time"], [0, 2, 1, "", "_get_luchtmeet_data"], [0, 2, 1, "", "_two_days_ago"], [0, 2, 1, "", "get_luchtmeet_data"], [0, 2, 1, "", "get_vc_data"], [0, 2, 1, "", "lag_data"]], "air_quality_forecast.data_pipeline": [[0, 1, 1, "", "DataLoader"], [0, 1, 1, "", "FeatureProcessor"], [0, 1, 1, "", "PreprocessingPipeline"]], "air_quality_forecast.data_pipeline.DataLoader": [[0, 2, 1, "", "save_to_csv"]], "air_quality_forecast.data_pipeline.FeatureProcessor": [[0, 2, 1, "", "apply_time_shift"], [0, 2, 1, "", "merge_raw_data"], [0, 2, 1, "", "preprocess_data"], [0, 2, 1, "", "select_features"], [0, 2, 1, "", "sort_data_by_date"]], "air_quality_forecast.data_pipeline.PreprocessingPipeline": [[0, 2, 1, "", "run_pipeline"], [0, 2, 1, "", "train_test_split"]], "air_quality_forecast.get_prediction_data": [[0, 3, 1, "", "main"]], "air_quality_forecast.model_development": [[0, 1, 1, "", "RegressorTrainer"], [0, 3, 1, "", "convert_param_space"], [0, 3, 1, "", "run_bayesian_optimization"], [0, 3, 1, "", "train_all_models"], [0, 3, 1, "", "train_one_model"]], "air_quality_forecast.model_development.RegressorTrainer": [[0, 2, 1, "", "_evaluate_model"], [0, 2, 1, "", "_optimize_and_evaluate"], [0, 2, 1, "", "_perform_search"], [0, 2, 1, "", "_set_data"], [0, 2, 1, "", "_setup_mlflow"], [0, 2, 1, "", "launch_mlflow_server"], [0, 2, 1, "", "port_in_use"], [0, 2, 1, "", "run"]], "air_quality_forecast.parser_ui": [[0, 3, 1, "", "create_parser"], [0, 3, 1, "", "load_data"], [0, 3, 1, "", "main"], [0, 3, 1, "", "normalize_data"], [0, 3, 1, "", "train_model"]], "air_quality_forecast.prediction": [[0, 1, 1, "", "PredictorModels"]], "air_quality_forecast.prediction.PredictorModels": [[0, 2, 1, "", "_load_models"], [0, 2, 1, "", "decision_tree_predictions"], [0, 2, 1, "", "random_forest_predictions"], [0, 2, 1, "", "xgb_predictions"]], "air_quality_forecast.utils": [[0, 1, 1, "", "FeatureSelector"], [0, 1, 1, "", "InputValidator"]], "air_quality_forecast.utils.FeatureSelector": [[0, 2, 1, "", "change_to_numeric"], [0, 2, 1, "", "rename_initial_columns"], [0, 2, 1, "", "select_cols_by_correlation"], [0, 2, 1, "", "uninformative_columns"]], "air_quality_forecast.utils.InputValidator": [[0, 2, 1, "", "validate_file_exists"], [0, 2, 1, "", "validate_type"]], "streamlit_src": [[3, 0, 0, "-", "app"], [4, 0, 0, "-", "controllers"], [5, 0, 0, "-", "models"], [6, 0, 0, "-", "views"]], "streamlit_src.controllers": [[4, 0, 0, "-", "admin_controller"], [4, 0, 0, "-", "home_controller"], [4, 0, 0, "-", "user_controller"]], "streamlit_src.controllers.admin_controller": [[4, 1, 1, "", "AdminController"]], "streamlit_src.controllers.admin_controller.AdminController": [[4, 2, 1, "", "_check_data_out_of_distribution"], [4, 2, 1, "", "_compute_distribution_statistics"], [4, 2, 1, "", "_data_is_valid"], [4, 2, 1, "", "_feature_importance"], [4, 2, 1, "", "_make_custom_predictions"], [4, 2, 1, "", "_make_prediction"], [4, 2, 1, "", "_model_metrics"], [4, 2, 1, "", "_show_current_data"], [4, 2, 1, "", "show_dashboard"]], "streamlit_src.controllers.home_controller": [[4, 1, 1, "", "HomeController"]], "streamlit_src.controllers.home_controller.HomeController": [[4, 4, 1, "", "__ADMIN_PASSWORD_HASH"], [4, 2, 1, "", "_hash_password"], [4, 2, 1, "", "_run"]], "streamlit_src.controllers.user_controller": [[4, 1, 1, "", "UserController"]], "streamlit_src.controllers.user_controller.UserController": [[4, 2, 1, "", "_compare_to_who"], [4, 2, 1, "", "_create_gauge_plot"], [4, 2, 1, "", "_display_compare_who"], [4, 2, 1, "", "_display_plots"], [4, 2, 1, "", "_display_sources"], [4, 2, 1, "", "_get_color"], [4, 2, 1, "", "_get_next_three_days_dates"], [4, 2, 1, "", "_is_current_data_available"], [4, 2, 1, "", "_prepare_awareness_content"], [4, 2, 1, "", "_prepare_data_for_view"], [4, 2, 1, "", "_prepare_gauge_plots"], [4, 2, 1, "", "_prepare_line_plot"], [4, 2, 1, "", "_quiz"], [4, 2, 1, "", "_raise_awareness"], [4, 2, 1, "", "_show_current_data"], [4, 2, 1, "", "show_dashboard"]], "streamlit_src.models": [[5, 0, 0, "-", "air_quality_model"]], "streamlit_src.models.air_quality_model": [[5, 1, 1, "", "AirQualityModel"]], "streamlit_src.models.air_quality_model.AirQualityModel": [[5, 2, 1, "", "calculate_metrics"], [5, 2, 1, "", "get_all_data_last_three_days"], [5, 2, 1, "", "get_last_three_days"], [5, 2, 1, "", "get_today_data"], [5, 2, 1, "", "next_three_day_predictions"]], "streamlit_src.views": [[6, 0, 0, "-", "admin_view"], [6, 0, 0, "-", "home_view"], [6, 0, 0, "-", "user_view"]], "streamlit_src.views.admin_view": [[6, 1, 1, "", "AdminView"]], "streamlit_src.views.admin_view.AdminView": [[6, 2, 1, "", "confirm_checks"], [6, 2, 1, "", "display_datatable"], [6, 2, 1, "", "display_feature_importance"], [6, 2, 1, "", "download_button"], [6, 2, 1, "", "show_admin_pages"], [6, 2, 1, "", "upload_dataset"], [6, 2, 1, "", "upload_instructions"]], "streamlit_src.views.home_view": [[6, 1, 1, "", "HomeView"]], "streamlit_src.views.home_view.HomeView": [[6, 2, 1, "", "prompt_admin_password"], [6, 2, 1, "", "set_layout"], [6, 2, 1, "", "show_dashboard_switch"]], "streamlit_src.views.user_view": [[6, 1, 1, "", "UserView"]], "streamlit_src.views.user_view.UserView": [[6, 2, 1, "", "compare_to_who"], [6, 2, 1, "", "data_not_available"], [6, 2, 1, "", "display_predictions_gaugeplot"], [6, 2, 1, "", "display_predictions_lineplot"], [6, 2, 1, "", "error"], [6, 2, 1, "", "print_sources"], [6, 2, 1, "", "quiz"], [6, 2, 1, "", "raise_awareness"], [6, 2, 1, "", "show_current_data"], [6, 2, 1, "", "success"], [6, 2, 1, "", "two_columns_layout"], [6, 2, 1, "", "view_option_selection"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute"}, "terms": {"0": 0, "00": [4, 6], "04": 6, "1": 0, "127": 0, "14": 4, "15": [4, 6], "2": 0, "240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9": 4, "256": 4, "3": [0, 4, 5], "5": 0, "50": 0, "5000": 0, "A": [0, 4, 5, 6], "By": 1, "If": 0, "In": 1, "It": [0, 1], "The": [0, 1, 4, 5, 6], "To": 1, "__admin_password_hash": [3, 4], "_check_data_out_of_distribut": [3, 4], "_compare_to_who": [3, 4], "_compute_distribution_statist": [3, 4], "_create_gauge_plot": [3, 4], "_current_tim": [0, 2], "_data_is_valid": [3, 4], "_display_compare_who": [3, 4], "_display_plot": [3, 4], "_display_sourc": [3, 4], "_evaluate_model": [0, 2], "_feature_import": [3, 4], "_get_color": [3, 4], "_get_luchtmeet_data": [0, 2], "_get_next_three_days_d": [3, 4], "_hash_password": [3, 4], "_is_current_data_avail": [3, 4], "_load_model": [0, 2], "_make_custom_predict": [3, 4], "_make_predict": [3, 4], "_model_metr": [3, 4], "_optimize_and_evalu": [0, 2], "_perform_search": [0, 2], "_prepare_awareness_cont": [3, 4], "_prepare_data_for_view": [3, 4], "_prepare_gauge_plot": [3, 4], "_prepare_line_plot": [3, 4], "_quiz": [3, 4], "_raise_awar": [3, 4], "_run": [3, 4], "_set_data": [0, 2], "_setup_mlflow": [0, 2], "_show_current_data": [3, 4], "_two_days_ago": [0, 2], "about": 6, "abov": 6, "access": 1, "accur": [1, 6], "across": 1, "admin": [1, 4, 6], "admin_control": [2, 3], "admin_view": [1, 2, 3], "admincontrol": [3, 4], "adminview": [3, 6], "aesthet": 6, "after": [1, 4], "air": [0, 4, 5, 6], "air_quality_forecast": [1, 2], "air_quality_model": [2, 3], "airqualitymodel": [3, 5], "algorithm": [0, 1], "all": [0, 1, 6], "along": 6, "alreadi": 0, "altern": 1, "an": [0, 1, 4, 6], "ani": [0, 1], "answer": [4, 6], "api": [0, 1, 4], "api_cal": [1, 2], "apical": [0, 2], "app": [1, 2], "appli": 0, "applic": [1, 6], "apply_time_shift": [0, 2], "appropri": 1, "ar": [0, 1, 6], "aren": 6, "argument": 0, "argumentpars": 0, "ask": 6, "attribut": 0, "autolog": 0, "automat": 6, "avail": [4, 6], "averag": 0, "awar": [4, 6], "awareness_expand": 6, "backend": 1, "base": [0, 1, 4, 5, 6], "baseestim": 0, "bayesian": 0, "bayessearchcv": 0, "becaus": 4, "been": 0, "befor": [0, 4], "best": 0, "better": 6, "between": 6, "bool": [0, 4, 6], "boolean": [4, 6], "both": 1, "bring": 1, "built": 1, "button": 6, "calcul": 4, "calculate_metr": [3, 5], "call": [0, 6], "callabl": 6, "can": [0, 1], "cd": 1, "certain": 1, "chang": [0, 1], "change_to_numer": [0, 2], "check": [0, 4, 6], "checkbox": 6, "choos": 1, "ci": 1, "class": [0, 4, 5, 6], "code": [1, 4], "collect": 1, "color": 4, "column": [0, 6], "command": [0, 1], "compar": [4, 6], "compare_to_who": [3, 6], "comparison": 4, "compon": 0, "comput": 4, "concentr": [4, 6], "config": [0, 1], "configur": 0, "confirm": 6, "confirm_check": [3, 6], "consist": 1, "contain": [1, 4, 6], "content": 2, "control": [1, 2, 3], "convert": 0, "convert_param_spac": [0, 2], "core": 1, "correct": [4, 6], "correl": 0, "correspond": [0, 4, 6], "creat": [4, 6], "create_pars": [0, 2], "criteria": 0, "cross": 0, "csv": [0, 5], "current": [0, 4, 6], "custom": [1, 4], "cv_split": 0, "dai": [0, 4, 5, 6], "daili": 0, "dashboard": 1, "data": [0, 1, 4, 5, 6], "data_not_avail": [3, 6], "data_pipelin": [1, 2], "datafram": [0, 4, 6], "dataload": [0, 2], "dataset": [0, 1, 4, 6], "date": [0, 4, 6], "dd": 0, "decis": [0, 1], "decision_tre": 0, "decision_tree_predict": [0, 2], "decisiontreeregressor": 0, "defin": 1, "deploi": 1, "design": 1, "determin": 4, "develop": 1, "deviat": 4, "dict": [0, 4, 6], "dictionari": [0, 6], "differ": 1, "directori": 0, "displai": [1, 4, 6], "display_datat": [3, 6], "display_feature_import": [3, 6], "display_predictions_gaugeplot": [3, 6], "display_predictions_lineplot": [3, 6], "distribut": 4, "divid": 6, "doe": 0, "download": 6, "download_button": [3, 6], "dure": 1, "e": 0, "each": 0, "easier": 1, "element": 6, "enabl": 0, "engin": 1, "enough": 6, "entir": 0, "entri": [0, 1], "environment": 1, "error": [0, 3, 6], "evalu": 0, "everi": 4, "exce": 4, "execut": 1, "exist": 0, "expand": [4, 6], "expect": 0, "expected_typ": 0, "experi": 0, "experiment_nam": 0, "extern": 1, "fact": [4, 6], "fals": [0, 4, 6], "featur": [0, 4, 6], "feature_import": 6, "featureprocessor": [0, 2], "featureselector": [0, 2], "fetch": [0, 1, 4], "fig": 6, "figur": [4, 6], "file": [0, 1, 5, 6], "file_nam": 6, "filenotfounderror": 0, "final": 0, "first": [0, 4], "float": [0, 4, 6], "follow": [0, 1], "forest": [0, 1], "format": [0, 1, 4, 6], "formula": 0, "friendli": 1, "from": [0, 1, 4, 5], "frontend": 1, "function": [0, 1, 6], "futur": [0, 1], "g": 0, "gaug": [4, 6], "gauge_plot": 6, "gener": 1, "get": 4, "get_all_data_last_three_dai": [3, 5], "get_last_three_dai": [3, 5], "get_luchtmeet_data": [0, 2], "get_prediction_data": [1, 2], "get_today_data": [3, 5], "get_vc_data": [0, 2], "given": [0, 4], "go": [4, 6], "graph": 6, "griftpark_data": 0, "guidelin": [4, 6], "ha": [0, 1], "handl": [1, 4, 6], "hash": 4, "have": 0, "health": [4, 6], "health_messag": 6, "hex": 4, "hh": 0, "histor": 1, "home_control": [2, 3], "home_view": [1, 2, 3], "homecontrol": [3, 4], "homepag": 1, "homeview": [3, 6], "http": 0, "hyperparamet": [0, 1], "hyperparameter_search_spac": [0, 1], "i": [0, 1, 4, 5, 6], "import": [4, 6], "importance_valu": 6, "includ": 4, "incom": 1, "index": [1, 4], "indic": [4, 6], "infer": 1, "inform": [0, 1], "inherit": 4, "initi": 0, "input": [0, 1, 4], "input_data": 4, "inputvalid": [0, 2], "instruct": 6, "int": 0, "integr": 1, "interact": 1, "interfac": [1, 4, 6], "issu": 6, "iter": 0, "json": [0, 1], "just": 0, "kei": 0, "label": [0, 6], "lag": 0, "lag_data": [0, 2], "last": 0, "launch": [0, 1], "launch_mlflow_serv": [0, 2], "learn": 1, "left": 6, "left_funct": 6, "level": [1, 4, 6], "line": [0, 4, 6], "list": [0, 4, 6], "load": [0, 1], "load_data": [0, 2], "local": 1, "locat": 5, "log": 0, "logic": 1, "luchtmeet": 0, "machin": 1, "made": 1, "main": [1, 2, 4], "make": [0, 1, 4], "manag": 1, "maximum": 0, "mean": [0, 4], "measur": 6, "merg": 0, "merge_raw_data": [0, 2], "merged_data_df": 6, "messag": [0, 4, 6], "method": 0, "metric": [0, 4], "minut": 4, "miss": 0, "mlflow": 0, "mm": 0, "model": [0, 1, 2, 3, 4], "model_develop": [1, 2], "modul": [1, 2], "most": 0, "mvc": 1, "n_iter": [0, 1], "name": [0, 4, 6], "ndarrai": 0, "new": [0, 4], "next": [4, 6], "next_three_day_predict": [3, 5], "nice": 0, "no2": [0, 4, 6], "none": [0, 4, 6], "normal": 0, "normalize_data": [0, 2], "normalizer_typ": 0, "note": 1, "now": 0, "np": 0, "number": 0, "numer": 0, "o3": [0, 4, 6], "obei": 1, "object": [0, 1, 4, 5, 6], "obtain": 5, "offer": 1, "oldest": 0, "one": 1, "onli": 1, "oper": 1, "optim": 0, "option": 6, "order": 0, "organ": 1, "other": [0, 1], "otherwis": [0, 4, 6], "out": [0, 4], "output": 1, "over": 0, "packag": [1, 2], "page": [1, 4, 6], "panda": [0, 4, 5, 6], "param_spac": 0, "paramet": [0, 4, 6], "pars": [0, 1], "parser": 1, "parser_ui": [1, 2], "password": 4, "past": [0, 5], "past_data_path": 5, "path": [0, 1], "pattern": 1, "pd": [0, 4, 5, 6], "per": 1, "perform": [0, 1, 4], "period": 4, "pipelin": [0, 1], "pkl": 0, "placehold": 1, "plot": [0, 4, 6], "plot_typ": 6, "plotli": [4, 6], "pm25": 0, "point": [0, 1], "pollut": [4, 6], "port": 0, "port_in_us": [0, 2], "possibl": 0, "pre": 0, "predict": [1, 2, 4, 6], "prediction_path": 1, "predictormodel": [0, 2], "prepar": 4, "preprocess": [0, 1], "preprocess_data": [0, 2], "preprocessingpipelin": [0, 2], "print": [0, 6], "print_sourc": [3, 6], "process": [0, 1], "processed_data_path": 0, "produc": 6, "prompt_admin_password": [3, 6], "provid": [0, 1, 6], "py": 1, "python": 1, "qualiti": [0, 4, 5, 6], "queri": [0, 4], "question": [4, 6], "quit": 0, "quiz": [3, 6], "rais": [0, 6], "raise_awar": [3, 6], "random": [0, 1, 4, 6], "random_fact": 6, "random_forest": 0, "random_forest_predict": [0, 2], "randomforestregressor": 0, "rang": 0, "ratio": 6, "raw": 0, "raw_data_path": 0, "real": 1, "recent": 0, "recommend": 6, "regressor": 0, "regressortrain": [0, 2], "regular": 1, "relat": 1, "relev": 0, "remov": 0, "renam": 0, "rename_initial_column": [0, 2], "repres": [0, 4], "requir": [0, 1, 6], "respons": 0, "result": [1, 6], "retriev": [1, 4], "return": [0, 4, 5, 6], "right": 6, "right_funct": 6, "row": 0, "run": [0, 1, 2], "run_bayesian_optim": [0, 2], "run_pipelin": [0, 2], "sai": 0, "same": 0, "save": 0, "save_to_csv": [0, 2], "saved_model": 0, "scheme": 0, "score": 4, "script": 1, "search": [0, 1], "second": 4, "select": [0, 6], "select_cols_by_correl": [0, 2], "select_featur": [0, 2], "separ": 1, "seri": 5, "server": 0, "set": 0, "set_layout": [3, 6], "sha": 4, "shift": 0, "short": 4, "show": [4, 6], "show_admin_pag": [3, 6], "show_current_data": [3, 6], "show_dashboard": [3, 4], "show_dashboard_switch": [3, 6], "shown": 6, "singl": 0, "sklearn": 0, "skopt": 0, "so": 0, "solut": 1, "sort": 0, "sort_data_by_d": [0, 2], "sourc": [0, 1, 4, 5, 6], "space": [0, 1], "specif": [0, 1], "specifi": 1, "split": 0, "squar": 0, "ss": 0, "stage": 1, "standard": 4, "start": 0, "static": 0, "station": 0, "station_numb": 0, "step": 1, "str": [0, 4, 6], "streamlit": 1, "streamlit_src": [1, 2], "string": 6, "submodul": [1, 2], "subpackag": [1, 2], "success": [3, 6], "suitabl": 1, "system": [0, 1], "t": 6, "t_max": 0, "tabl": 6, "take": 0, "techniqu": 1, "test": 0, "test_siz": 0, "text": 6, "them": 6, "thi": [0, 1, 4, 6], "those": 0, "three": [0, 4, 6], "threshold": 4, "through": 1, "time": [0, 1, 4, 6], "timeseriessplit": 0, "titl": [4, 6], "todai": 5, "togeth": 1, "track": 0, "train": [0, 1, 4], "train_all_model": [0, 2], "train_model": [0, 2], "train_one_model": [0, 2], "train_test_split": [0, 2], "transform": 1, "tree": [0, 1], "true": [0, 4, 6], "tupl": [0, 4, 6], "turn": 0, "two": [0, 1, 4, 6], "two_columns_layout": [3, 6], "type": [0, 4, 5, 6], "typeerror": 0, "ui": 1, "uninformative_column": [0, 2], "up": 0, "updat": 6, "upload": [4, 6], "upload_dataset": [3, 6], "upload_instruct": [3, 6], "uri": 0, "url": 6, "us": [0, 1, 4, 6], "usabl": 0, "user": [1, 4, 6], "user_control": [2, 3], "user_view": [1, 2, 3], "usercontrol": [3, 4], "userview": [3, 6], "util": [1, 2], "utrecht": 0, "utrecht_data": 0, "valid": [0, 1, 4], "validate_file_exist": [0, 2], "validate_typ": [0, 2], "valu": [0, 4, 6], "valueerror": 0, "variabl": 0, "variable_nam": 0, "variou": 1, "via": 1, "view": [1, 2, 3, 4], "view_option_select": [3, 6], "visual": 0, "wa": [4, 6], "want": 0, "warn": 6, "weather": 0, "web": 1, "when": 6, "where": 0, "whether": [0, 4, 6], "which": [1, 4], "whitespac": 0, "who": [4, 6], "who_limit": 4, "within": [1, 6], "without": 0, "workflow": 0, "wrap": 0, "x": 0, "x_test": 0, "x_test_path": [0, 1], "x_train": 0, "x_train_path": [0, 1], "xgb": 0, "xgb_predict": [0, 2], "xgboost": [0, 4], "xgbregressor": 0, "y": 0, "y_pred": 0, "y_test": 0, "y_test_path": [0, 1], "y_train": 0, "y_train_path": [0, 1], "yaml": [0, 1], "you": [0, 1], "yyyi": 0, "z": 4}, "titles": ["air_quality_forecast package", "Air Quality Forecast documentation", "air-quality-forecast", "streamlit_src package", "streamlit_src.controllers package", "streamlit_src.models package", "streamlit_src.views package"], "titleterms": {"admin_control": 4, "admin_view": 6, "air": [1, 2], "air_quality_forecast": 0, "air_quality_model": 5, "api_cal": 0, "app": 3, "breakdown": 1, "codebas": 1, "content": [0, 1, 3, 4, 5, 6], "control": 4, "data_pipelin": 0, "deploy": 1, "directori": 1, "document": 1, "forecast": [1, 2], "get_prediction_data": 0, "home_control": 4, "home_view": 6, "main": 0, "model": 5, "model_develop": 0, "modul": [0, 3, 4, 5, 6], "packag": [0, 3, 4, 5, 6], "parser_ui": 0, "predict": 0, "problem": 1, "project": 1, "protocol": 1, "qualiti": [1, 2], "retrain": 1, "statement": 1, "streamlit_src": [3, 4, 5, 6], "structur": 1, "submodul": [0, 3, 4, 5, 6], "subpackag": 3, "user_control": 4, "user_view": 6, "util": 0, "view": 6, "workflow": 1}})
|
|
|
|
| 1 |
+
Search.setIndex({"alltitles": {"Air Quality Forecast documentation": [[1, null]], "Codebase": [[1, "codebase"]], "Contents:": [[1, null]], "Deployment": [[1, "deployment"]], "Directory Breakdown": [[1, "directory-breakdown"]], "Module contents": [[0, "module-air_quality_forecast"], [3, "module-streamlit_src"], [4, "module-streamlit_src.controllers"], [5, "module-streamlit_src.models"], [6, "module-streamlit_src.views"]], "Problem Statement": [[1, "problem-statement"]], "Project Structure": [[1, "project-structure"]], "Retraining Protocol": [[1, "retraining-protocol"]], "Submodules": [[0, "submodules"], [3, "submodules"], [4, "submodules"], [5, "submodules"], [6, "submodules"]], "Subpackages": [[3, "subpackages"]], "Workflow": [[1, "workflow"]], "air-quality-forecast": [[2, null]], "air_quality_forecast package": [[0, null]], "air_quality_forecast.api_caller module": [[0, "module-air_quality_forecast.api_caller"]], "air_quality_forecast.data_pipeline module": [[0, "module-air_quality_forecast.data_pipeline"]], "air_quality_forecast.get_prediction_data module": [[0, "module-air_quality_forecast.get_prediction_data"]], "air_quality_forecast.main module": [[0, "module-air_quality_forecast.main"]], "air_quality_forecast.model_development module": [[0, "module-air_quality_forecast.model_development"]], "air_quality_forecast.parser_ui module": [[0, "module-air_quality_forecast.parser_ui"]], "air_quality_forecast.prediction module": [[0, "module-air_quality_forecast.prediction"]], "air_quality_forecast.utils module": [[0, "module-air_quality_forecast.utils"]], "streamlit_src package": [[3, null]], "streamlit_src.app module": [[3, "module-streamlit_src.app"]], "streamlit_src.controllers package": [[4, null]], "streamlit_src.controllers.admin_controller module": [[4, "module-streamlit_src.controllers.admin_controller"]], "streamlit_src.controllers.home_controller module": [[4, "module-streamlit_src.controllers.home_controller"]], "streamlit_src.controllers.user_controller module": [[4, "module-streamlit_src.controllers.user_controller"]], "streamlit_src.models package": [[5, null]], "streamlit_src.models.air_quality_model module": [[5, "module-streamlit_src.models.air_quality_model"]], "streamlit_src.views package": [[6, null]], "streamlit_src.views.admin_view module": [[6, "module-streamlit_src.views.admin_view"]], "streamlit_src.views.home_view module": [[6, "module-streamlit_src.views.home_view"]], "streamlit_src.views.user_view module": [[6, "module-streamlit_src.views.user_view"]]}, "docnames": ["air_quality_forecast", "index", "modules", "streamlit_src", "streamlit_src.controllers", "streamlit_src.models", "streamlit_src.views"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1}, "filenames": ["air_quality_forecast.rst", "index.rst", "modules.rst", "streamlit_src.rst", "streamlit_src.controllers.rst", "streamlit_src.models.rst", "streamlit_src.views.rst"], "indexentries": {"__admin_password_hash (streamlit_src.controllers.home_controller.homecontroller attribute)": [[4, "streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH", false]], "__init__() (streamlit_src.views.home_view.homeview method)": [[6, "streamlit_src.views.home_view.HomeView.__init__", false]], "_check_data_out_of_distribution() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._check_data_out_of_distribution", false]], "_compare_to_who() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._compare_to_who", false]], "_compute_distribution_statistics() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._compute_distribution_statistics", false]], "_create_gauge_plot() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._create_gauge_plot", false]], "_current_time() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._current_time", false]], "_data_is_valid() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._data_is_valid", false]], "_display_compare_who() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_compare_who", false]], "_display_plots() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_plots", false]], "_display_sources() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._display_sources", false]], "_evaluate_model() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._evaluate_model", false]], "_feature_importance() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._feature_importance", false]], "_get_color() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._get_color", false]], "_get_luchtmeet_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._get_luchtmeet_data", false]], "_get_next_three_days_dates() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._get_next_three_days_dates", false]], "_hash_password() (streamlit_src.controllers.home_controller.homecontroller method)": [[4, "streamlit_src.controllers.home_controller.HomeController._hash_password", false]], "_is_current_data_available() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._is_current_data_available", false]], "_load_models() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels._load_models", false]], "_make_custom_predictions() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions", false]], "_make_prediction() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._make_prediction", false]], "_model_metrics() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._model_metrics", false]], "_optimize_and_evaluate() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._optimize_and_evaluate", false]], "_perform_search() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._perform_search", false]], "_prepare_awareness_content() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_awareness_content", false]], "_prepare_data_for_view() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_data_for_view", false]], "_prepare_gauge_plots() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_gauge_plots", false]], "_prepare_line_plot() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._prepare_line_plot", false]], "_quiz() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._quiz", false]], "_raise_awareness() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._raise_awareness", false]], "_run() (streamlit_src.controllers.home_controller.homecontroller method)": [[4, "streamlit_src.controllers.home_controller.HomeController._run", false]], "_set_data() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._set_data", false]], "_setup_mlflow() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer._setup_mlflow", false]], "_show_current_data() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController._show_current_data", false]], "_show_current_data() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController._show_current_data", false]], "_two_days_ago() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller._two_days_ago", false]], "_who_no2_level (streamlit_src.models.air_quality_model.airqualitymodel attribute)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel._WHO_NO2_LEVEL", false]], "_who_o3_level (streamlit_src.models.air_quality_model.airqualitymodel attribute)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel._WHO_O3_LEVEL", false]], "admincontroller (class in streamlit_src.controllers.admin_controller)": [[4, "streamlit_src.controllers.admin_controller.AdminController", false]], "adminview (class in streamlit_src.views.admin_view)": [[6, "streamlit_src.views.admin_view.AdminView", false]], "air_quality_forecast": [[0, "module-air_quality_forecast", false]], "air_quality_forecast.api_caller": [[0, "module-air_quality_forecast.api_caller", false]], "air_quality_forecast.data_pipeline": [[0, "module-air_quality_forecast.data_pipeline", false]], "air_quality_forecast.get_prediction_data": [[0, "module-air_quality_forecast.get_prediction_data", false]], "air_quality_forecast.main": [[0, "module-air_quality_forecast.main", false]], "air_quality_forecast.model_development": [[0, "module-air_quality_forecast.model_development", false]], "air_quality_forecast.parser_ui": [[0, "module-air_quality_forecast.parser_ui", false]], "air_quality_forecast.prediction": [[0, "module-air_quality_forecast.prediction", false]], "air_quality_forecast.utils": [[0, "module-air_quality_forecast.utils", false]], "airqualitymodel (class in streamlit_src.models.air_quality_model)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel", false]], "apicaller (class in air_quality_forecast.api_caller)": [[0, "air_quality_forecast.api_caller.APICaller", false]], "apply_time_shift() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.apply_time_shift", false]], "calculate_metrics() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics", false]], "change_to_numeric() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.change_to_numeric", false]], "compare_to_who() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.compare_to_who", false]], "confirm_checks() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.confirm_checks", false]], "convert_param_space() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.convert_param_space", false]], "create_parser() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.create_parser", false]], "data_not_available() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.data_not_available", false]], "dataloader (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.DataLoader", false]], "decision_tree_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.decision_tree_predictions", false]], "display_datatable() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.display_datatable", false]], "display_feature_importance() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.display_feature_importance", false]], "display_predictions_gaugeplot() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.display_predictions_gaugeplot", false]], "display_predictions_lineplot() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.display_predictions_lineplot", false]], "download_button() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.download_button", false]], "error() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.error", false]], "featureprocessor (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor", false]], "featureselector (class in air_quality_forecast.utils)": [[0, "air_quality_forecast.utils.FeatureSelector", false]], "get_all_data_last_three_days() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days", false]], "get_last_three_days() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days", false]], "get_luchtmeet_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.get_luchtmeet_data", false]], "get_today_data() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.get_today_data", false]], "get_vc_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.get_vc_data", false]], "homecontroller (class in streamlit_src.controllers.home_controller)": [[4, "streamlit_src.controllers.home_controller.HomeController", false]], "homeview (class in streamlit_src.views.home_view)": [[6, "streamlit_src.views.home_view.HomeView", false]], "inputvalidator (class in air_quality_forecast.utils)": [[0, "air_quality_forecast.utils.InputValidator", false]], "lag_data() (air_quality_forecast.api_caller.apicaller method)": [[0, "air_quality_forecast.api_caller.APICaller.lag_data", false]], "launch_mlflow_server() (air_quality_forecast.model_development.regressortrainer static method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.launch_mlflow_server", false]], "load_data() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.load_data", false]], "main() (in module air_quality_forecast.get_prediction_data)": [[0, "air_quality_forecast.get_prediction_data.main", false]], "main() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.main", false]], "merge_raw_data() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.merge_raw_data", false]], "module": [[0, "module-air_quality_forecast", false], [0, "module-air_quality_forecast.api_caller", false], [0, "module-air_quality_forecast.data_pipeline", false], [0, "module-air_quality_forecast.get_prediction_data", false], [0, "module-air_quality_forecast.main", false], [0, "module-air_quality_forecast.model_development", false], [0, "module-air_quality_forecast.parser_ui", false], [0, "module-air_quality_forecast.prediction", false], [0, "module-air_quality_forecast.utils", false], [3, "module-streamlit_src", false], [3, "module-streamlit_src.app", false], [4, "module-streamlit_src.controllers", false], [4, "module-streamlit_src.controllers.admin_controller", false], [4, "module-streamlit_src.controllers.home_controller", false], [4, "module-streamlit_src.controllers.user_controller", false], [5, "module-streamlit_src.models", false], [5, "module-streamlit_src.models.air_quality_model", false], [6, "module-streamlit_src.views", false], [6, "module-streamlit_src.views.admin_view", false], [6, "module-streamlit_src.views.home_view", false], [6, "module-streamlit_src.views.user_view", false]], "next_three_day_predictions() (streamlit_src.models.air_quality_model.airqualitymodel method)": [[5, "streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions", false]], "none (streamlit_src.views.home_view.homeview attribute)": [[6, "streamlit_src.views.home_view.HomeView.None", false]], "normalize_data() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.normalize_data", false]], "port_in_use() (air_quality_forecast.model_development.regressortrainer static method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.port_in_use", false]], "predictormodels (class in air_quality_forecast.prediction)": [[0, "air_quality_forecast.prediction.PredictorModels", false]], "preprocess_data() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.preprocess_data", false]], "preprocessingpipeline (class in air_quality_forecast.data_pipeline)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline", false]], "print_sources() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.print_sources", false]], "prompt_admin_password() (streamlit_src.views.home_view.homeview method)": [[6, "id0", false], [6, "streamlit_src.views.home_view.HomeView.prompt_admin_password", false]], "quiz() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.quiz", false]], "raise_awareness() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.raise_awareness", false]], "random_forest_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.random_forest_predictions", false]], "regressortrainer (class in air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.RegressorTrainer", false]], "rename_initial_columns() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.rename_initial_columns", false]], "run() (air_quality_forecast.model_development.regressortrainer method)": [[0, "air_quality_forecast.model_development.RegressorTrainer.run", false]], "run_bayesian_optimization() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.run_bayesian_optimization", false]], "run_pipeline() (air_quality_forecast.data_pipeline.preprocessingpipeline method)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline.run_pipeline", false]], "save_to_csv() (air_quality_forecast.data_pipeline.dataloader method)": [[0, "air_quality_forecast.data_pipeline.DataLoader.save_to_csv", false]], "select_cols_by_correlation() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.select_cols_by_correlation", false]], "select_features() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.select_features", false]], "set_layout() (streamlit_src.views.home_view.homeview method)": [[6, "id1", false], [6, "streamlit_src.views.home_view.HomeView.set_layout", false]], "show_admin_pages() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.show_admin_pages", false]], "show_current_data() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.show_current_data", false]], "show_dashboard() (streamlit_src.controllers.admin_controller.admincontroller method)": [[4, "streamlit_src.controllers.admin_controller.AdminController.show_dashboard", false]], "show_dashboard() (streamlit_src.controllers.user_controller.usercontroller method)": [[4, "streamlit_src.controllers.user_controller.UserController.show_dashboard", false]], "show_dashboard_switch() (streamlit_src.views.home_view.homeview method)": [[6, "id2", false], [6, "streamlit_src.views.home_view.HomeView.show_dashboard_switch", false]], "sort_data_by_date() (air_quality_forecast.data_pipeline.featureprocessor method)": [[0, "air_quality_forecast.data_pipeline.FeatureProcessor.sort_data_by_date", false]], "streamlit_src": [[3, "module-streamlit_src", false]], "streamlit_src.app": [[3, "module-streamlit_src.app", false]], "streamlit_src.controllers": [[4, "module-streamlit_src.controllers", false]], "streamlit_src.controllers.admin_controller": [[4, "module-streamlit_src.controllers.admin_controller", false]], "streamlit_src.controllers.home_controller": [[4, "module-streamlit_src.controllers.home_controller", false]], "streamlit_src.controllers.user_controller": [[4, "module-streamlit_src.controllers.user_controller", false]], "streamlit_src.models": [[5, "module-streamlit_src.models", false]], "streamlit_src.models.air_quality_model": [[5, "module-streamlit_src.models.air_quality_model", false]], "streamlit_src.views": [[6, "module-streamlit_src.views", false]], "streamlit_src.views.admin_view": [[6, "module-streamlit_src.views.admin_view", false]], "streamlit_src.views.home_view": [[6, "module-streamlit_src.views.home_view", false]], "streamlit_src.views.user_view": [[6, "module-streamlit_src.views.user_view", false]], "success() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.success", false]], "train_all_models() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.train_all_models", false]], "train_model() (in module air_quality_forecast.parser_ui)": [[0, "air_quality_forecast.parser_ui.train_model", false]], "train_one_model() (in module air_quality_forecast.model_development)": [[0, "air_quality_forecast.model_development.train_one_model", false]], "train_test_split() (air_quality_forecast.data_pipeline.preprocessingpipeline method)": [[0, "air_quality_forecast.data_pipeline.PreprocessingPipeline.train_test_split", false]], "two_columns_layout() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.two_columns_layout", false]], "uninformative_columns() (air_quality_forecast.utils.featureselector method)": [[0, "air_quality_forecast.utils.FeatureSelector.uninformative_columns", false]], "upload_dataset() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.upload_dataset", false]], "upload_instructions() (streamlit_src.views.admin_view.adminview method)": [[6, "streamlit_src.views.admin_view.AdminView.upload_instructions", false]], "usercontroller (class in streamlit_src.controllers.user_controller)": [[4, "streamlit_src.controllers.user_controller.UserController", false]], "userview (class in streamlit_src.views.user_view)": [[6, "streamlit_src.views.user_view.UserView", false]], "validate_file_exists() (air_quality_forecast.utils.inputvalidator static method)": [[0, "air_quality_forecast.utils.InputValidator.validate_file_exists", false]], "validate_type() (air_quality_forecast.utils.inputvalidator static method)": [[0, "air_quality_forecast.utils.InputValidator.validate_type", false]], "view_option_selection() (streamlit_src.views.user_view.userview method)": [[6, "streamlit_src.views.user_view.UserView.view_option_selection", false]], "xgb_predictions() (air_quality_forecast.prediction.predictormodels method)": [[0, "air_quality_forecast.prediction.PredictorModels.xgb_predictions", false]]}, "objects": {"": [[0, 0, 0, "-", "air_quality_forecast"], [3, 0, 0, "-", "streamlit_src"]], "air_quality_forecast": [[0, 0, 0, "-", "api_caller"], [0, 0, 0, "-", "data_pipeline"], [0, 0, 0, "-", "get_prediction_data"], [0, 0, 0, "-", "main"], [0, 0, 0, "-", "model_development"], [0, 0, 0, "-", "parser_ui"], [0, 0, 0, "-", "prediction"], [0, 0, 0, "-", "utils"]], "air_quality_forecast.api_caller": [[0, 1, 1, "", "APICaller"]], "air_quality_forecast.api_caller.APICaller": [[0, 2, 1, "", "_current_time"], [0, 2, 1, "", "_get_luchtmeet_data"], [0, 2, 1, "", "_two_days_ago"], [0, 2, 1, "", "get_luchtmeet_data"], [0, 2, 1, "", "get_vc_data"], [0, 2, 1, "", "lag_data"]], "air_quality_forecast.data_pipeline": [[0, 1, 1, "", "DataLoader"], [0, 1, 1, "", "FeatureProcessor"], [0, 1, 1, "", "PreprocessingPipeline"]], "air_quality_forecast.data_pipeline.DataLoader": [[0, 2, 1, "", "save_to_csv"]], "air_quality_forecast.data_pipeline.FeatureProcessor": [[0, 2, 1, "", "apply_time_shift"], [0, 2, 1, "", "merge_raw_data"], [0, 2, 1, "", "preprocess_data"], [0, 2, 1, "", "select_features"], [0, 2, 1, "", "sort_data_by_date"]], "air_quality_forecast.data_pipeline.PreprocessingPipeline": [[0, 2, 1, "", "run_pipeline"], [0, 2, 1, "", "train_test_split"]], "air_quality_forecast.get_prediction_data": [[0, 3, 1, "", "main"]], "air_quality_forecast.model_development": [[0, 1, 1, "", "RegressorTrainer"], [0, 3, 1, "", "convert_param_space"], [0, 3, 1, "", "run_bayesian_optimization"], [0, 3, 1, "", "train_all_models"], [0, 3, 1, "", "train_one_model"]], "air_quality_forecast.model_development.RegressorTrainer": [[0, 2, 1, "", "_evaluate_model"], [0, 2, 1, "", "_optimize_and_evaluate"], [0, 2, 1, "", "_perform_search"], [0, 2, 1, "", "_set_data"], [0, 2, 1, "", "_setup_mlflow"], [0, 2, 1, "", "launch_mlflow_server"], [0, 2, 1, "", "port_in_use"], [0, 2, 1, "", "run"]], "air_quality_forecast.parser_ui": [[0, 3, 1, "", "create_parser"], [0, 3, 1, "", "load_data"], [0, 3, 1, "", "main"], [0, 3, 1, "", "normalize_data"], [0, 3, 1, "", "train_model"]], "air_quality_forecast.prediction": [[0, 1, 1, "", "PredictorModels"]], "air_quality_forecast.prediction.PredictorModels": [[0, 2, 1, "", "_load_models"], [0, 2, 1, "", "decision_tree_predictions"], [0, 2, 1, "", "random_forest_predictions"], [0, 2, 1, "", "xgb_predictions"]], "air_quality_forecast.utils": [[0, 1, 1, "", "FeatureSelector"], [0, 1, 1, "", "InputValidator"]], "air_quality_forecast.utils.FeatureSelector": [[0, 2, 1, "", "change_to_numeric"], [0, 2, 1, "", "rename_initial_columns"], [0, 2, 1, "", "select_cols_by_correlation"], [0, 2, 1, "", "uninformative_columns"]], "air_quality_forecast.utils.InputValidator": [[0, 2, 1, "", "validate_file_exists"], [0, 2, 1, "", "validate_type"]], "streamlit_src": [[3, 0, 0, "-", "app"], [4, 0, 0, "-", "controllers"], [5, 0, 0, "-", "models"], [6, 0, 0, "-", "views"]], "streamlit_src.controllers": [[4, 0, 0, "-", "admin_controller"], [4, 0, 0, "-", "home_controller"], [4, 0, 0, "-", "user_controller"]], "streamlit_src.controllers.admin_controller": [[4, 1, 1, "", "AdminController"]], "streamlit_src.controllers.admin_controller.AdminController": [[4, 2, 1, "", "_check_data_out_of_distribution"], [4, 2, 1, "", "_compute_distribution_statistics"], [4, 2, 1, "", "_data_is_valid"], [4, 2, 1, "", "_feature_importance"], [4, 2, 1, "", "_make_custom_predictions"], [4, 2, 1, "", "_make_prediction"], [4, 2, 1, "", "_model_metrics"], [4, 2, 1, "", "_show_current_data"], [4, 2, 1, "", "show_dashboard"]], "streamlit_src.controllers.home_controller": [[4, 1, 1, "", "HomeController"]], "streamlit_src.controllers.home_controller.HomeController": [[4, 4, 1, "", "__ADMIN_PASSWORD_HASH"], [4, 2, 1, "", "_hash_password"], [4, 2, 1, "", "_run"]], "streamlit_src.controllers.user_controller": [[4, 1, 1, "", "UserController"]], "streamlit_src.controllers.user_controller.UserController": [[4, 2, 1, "", "_compare_to_who"], [4, 2, 1, "", "_create_gauge_plot"], [4, 2, 1, "", "_display_compare_who"], [4, 2, 1, "", "_display_plots"], [4, 2, 1, "", "_display_sources"], [4, 2, 1, "", "_get_color"], [4, 2, 1, "", "_get_next_three_days_dates"], [4, 2, 1, "", "_is_current_data_available"], [4, 2, 1, "", "_prepare_awareness_content"], [4, 2, 1, "", "_prepare_data_for_view"], [4, 2, 1, "", "_prepare_gauge_plots"], [4, 2, 1, "", "_prepare_line_plot"], [4, 2, 1, "", "_quiz"], [4, 2, 1, "", "_raise_awareness"], [4, 2, 1, "", "_show_current_data"], [4, 2, 1, "", "show_dashboard"]], "streamlit_src.models": [[5, 0, 0, "-", "air_quality_model"]], "streamlit_src.models.air_quality_model": [[5, 1, 1, "", "AirQualityModel"]], "streamlit_src.models.air_quality_model.AirQualityModel": [[5, 4, 1, "", "_WHO_NO2_LEVEL"], [5, 4, 1, "", "_WHO_O3_LEVEL"], [5, 2, 1, "", "calculate_metrics"], [5, 2, 1, "", "get_all_data_last_three_days"], [5, 2, 1, "", "get_last_three_days"], [5, 2, 1, "", "get_today_data"], [5, 2, 1, "", "next_three_day_predictions"]], "streamlit_src.views": [[6, 0, 0, "-", "admin_view"], [6, 0, 0, "-", "home_view"], [6, 0, 0, "-", "user_view"]], "streamlit_src.views.admin_view": [[6, 1, 1, "", "AdminView"]], "streamlit_src.views.admin_view.AdminView": [[6, 2, 1, "", "confirm_checks"], [6, 2, 1, "", "display_datatable"], [6, 2, 1, "", "display_feature_importance"], [6, 2, 1, "", "download_button"], [6, 2, 1, "", "show_admin_pages"], [6, 2, 1, "", "upload_dataset"], [6, 2, 1, "", "upload_instructions"]], "streamlit_src.views.home_view": [[6, 1, 1, "", "HomeView"]], "streamlit_src.views.home_view.HomeView": [[6, 4, 1, "", "None"], [6, 2, 1, "", "__init__"], [6, 2, 1, "id0", "prompt_admin_password"], [6, 2, 1, "id1", "set_layout"], [6, 2, 1, "id2", "show_dashboard_switch"]], "streamlit_src.views.user_view": [[6, 1, 1, "", "UserView"]], "streamlit_src.views.user_view.UserView": [[6, 2, 1, "", "compare_to_who"], [6, 2, 1, "", "data_not_available"], [6, 2, 1, "", "display_predictions_gaugeplot"], [6, 2, 1, "", "display_predictions_lineplot"], [6, 2, 1, "", "error"], [6, 2, 1, "", "print_sources"], [6, 2, 1, "", "quiz"], [6, 2, 1, "", "raise_awareness"], [6, 2, 1, "", "show_current_data"], [6, 2, 1, "", "success"], [6, 2, 1, "", "two_columns_layout"], [6, 2, 1, "", "view_option_selection"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute"}, "terms": {"": 4, "0": 0, "00": [4, 6], "04": [4, 6], "1": 0, "127": 0, "15": [4, 6], "2": 0, "240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9": 4, "256": 4, "3": [0, 4, 5], "5": 0, "50": 0, "5000": 0, "A": [0, 4, 5, 6], "By": 1, "If": [0, 4], "In": 1, "It": [0, 1, 4, 6], "The": [0, 1, 4, 5, 6], "To": 1, "__admin_password_hash": [3, 4], "__init__": [3, 6], "_check_data_out_of_distribut": [3, 4], "_compare_to_who": [3, 4], "_compute_distribution_statist": [3, 4], "_create_gauge_plot": [3, 4], "_current_tim": [0, 2], "_data_is_valid": [3, 4], "_display_compare_who": [3, 4], "_display_plot": [3, 4], "_display_sourc": [3, 4], "_evaluate_model": [0, 2], "_feature_import": [3, 4], "_get_color": [3, 4], "_get_luchtmeet_data": [0, 2], "_get_next_three_days_d": [3, 4], "_hash_password": [3, 4], "_is_current_data_avail": [3, 4], "_load_model": [0, 2], "_make_custom_predict": [3, 4], "_make_predict": [3, 4], "_model_metr": [3, 4], "_optimize_and_evalu": [0, 2], "_perform_search": [0, 2], "_prepare_awareness_cont": [3, 4], "_prepare_data_for_view": [3, 4], "_prepare_gauge_plot": [3, 4], "_prepare_line_plot": [3, 4], "_quiz": [3, 4], "_raise_awar": [3, 4], "_run": [3, 4], "_set_data": [0, 2], "_setup_mlflow": [0, 2], "_show_current_data": [3, 4], "_two_days_ago": [0, 2], "_who_no2_level": [3, 5], "_who_o3_level": [3, 5], "about": 6, "abov": 6, "access": 1, "accur": [1, 6], "across": 1, "admin": [1, 4, 6], "admin_control": [2, 3], "admin_view": [1, 2, 3], "admincontrol": [3, 4], "adminview": [3, 6], "aesthet": 6, "after": [1, 4], "air": [0, 4, 5, 6], "air_quality_forecast": [1, 2], "air_quality_model": [2, 3], "airqualitymodel": [3, 5], "algorithm": [0, 1], "all": [0, 1, 5, 6], "along": 6, "alreadi": 0, "altern": 1, "an": [0, 1, 4, 6], "ani": [0, 1], "answer": [4, 6], "api": [0, 1, 4], "api_cal": [1, 2], "apical": [0, 2], "app": [1, 2], "appli": 0, "applic": [1, 4, 6], "apply_time_shift": [0, 2], "appropri": 1, "ar": [0, 1, 6], "aren": 6, "argument": 0, "argumentpars": 0, "ask": 6, "attribut": 0, "autolog": 0, "automat": 6, "avail": [4, 6], "averag": 0, "awar": [4, 6], "awareness_expand": 6, "backend": 1, "base": [0, 1, 4, 5, 6], "baseestim": 0, "bayesian": 0, "bayessearchcv": 0, "becaus": 4, "been": 0, "befor": [0, 4], "best": 0, "better": 6, "between": [4, 6], "bool": [0, 4, 6], "boolean": [4, 6], "both": 1, "bring": 1, "built": 1, "button": 6, "calcul": [4, 5], "calculate_metr": [3, 5], "call": [0, 6], "callabl": 6, "can": [0, 1], "cd": 1, "certain": 1, "chang": [0, 1], "change_to_numer": [0, 2], "check": [0, 4, 6], "checkbox": 6, "choic": 4, "choos": [1, 4], "ci": 1, "class": [0, 4, 5, 6], "code": [1, 4], "collect": 1, "color": 4, "column": [0, 6], "command": [0, 1], "compar": [4, 6], "compare_to_who": [3, 6], "comparison": 4, "compon": 0, "comput": 4, "concentr": [4, 6], "config": [0, 1], "configur": [0, 6], "confirm": 6, "confirm_check": [3, 6], "consist": 1, "contain": [1, 4, 6], "content": 2, "control": [1, 2, 3], "convert": 0, "convert_param_spac": [0, 2], "core": 1, "correct": [4, 6], "correl": 0, "correspond": [0, 4, 6], "creat": [4, 6], "create_pars": [0, 2], "criteria": 0, "cross": 0, "csv": [0, 5], "cubic": 5, "current": [0, 4, 6], "custom": [1, 4], "cv_split": 0, "dai": [0, 4, 5, 6], "daili": 0, "dashboard": [1, 4, 6], "data": [0, 1, 4, 5, 6], "data_not_avail": [3, 6], "data_pipelin": [1, 2], "datafram": [0, 4, 5, 6], "dataload": [0, 2], "dataset": [0, 1, 4, 6], "date": [0, 4, 6], "dd": 0, "decis": [0, 1], "decision_tre": 0, "decision_tree_predict": [0, 2], "decisiontreeregressor": 0, "defin": 1, "deploi": 1, "design": 1, "determin": 4, "develop": 1, "deviat": 4, "dict": [0, 4, 6], "dictionari": [0, 6], "differ": [1, 6], "directori": 0, "displai": [1, 4, 6], "display_datat": [3, 6], "display_feature_import": [3, 6], "display_predictions_gaugeplot": [3, 6], "display_predictions_lineplot": [3, 6], "distribut": 4, "divid": 6, "doe": 0, "download": 6, "download_button": [3, 6], "dropdown": 6, "dure": 1, "e": 0, "each": 0, "easier": 1, "element": 6, "enabl": 0, "engin": 1, "enough": 6, "enter": [4, 6], "entir": 0, "entri": [0, 1, 4], "environment": 1, "error": [0, 3, 5, 6], "evalu": 0, "everi": 4, "exce": 4, "execut": 1, "exist": 0, "expand": [4, 6], "expect": 0, "expected_typ": 0, "experi": 0, "experiment_nam": 0, "extern": 1, "fact": [4, 6], "fals": [0, 4, 6], "featur": [0, 4, 6], "feature_import": 6, "featureprocessor": [0, 2], "featureselector": [0, 2], "fetch": [0, 1, 4], "field": 6, "fig": 6, "figur": [4, 6], "file": [0, 1, 5, 6], "file_nam": 6, "filenotfounderror": 0, "final": 0, "first": [0, 4], "float": [0, 4, 6], "follow": [0, 1], "forest": [0, 1], "format": [0, 1, 4, 6], "formula": 0, "friendli": 1, "from": [0, 1, 4, 5, 6], "frontend": 1, "function": [0, 1, 6], "futur": [0, 1], "g": 0, "gaug": [4, 6], "gauge_plot": 6, "gener": 1, "get": 4, "get_all_data_last_three_dai": [3, 5], "get_last_three_dai": [3, 5], "get_luchtmeet_data": [0, 2], "get_prediction_data": [1, 2], "get_today_data": [3, 5], "get_vc_data": [0, 2], "given": [0, 4], "go": [4, 6], "graph": 6, "griftpark_data": 0, "guidelin": [4, 6], "ha": [0, 1], "handl": [1, 4, 6], "hash": 4, "have": 0, "health": [4, 6], "health_messag": 6, "hex": 4, "hh": 0, "histor": 1, "home": [4, 6], "home_control": [2, 3], "home_view": [1, 2, 3], "homecontrol": [3, 4], "homepag": 1, "homeview": [3, 6], "http": 0, "hyperparamet": [0, 1], "hyperparameter_search_spac": [0, 1], "i": [0, 1, 4, 5, 6], "import": [4, 6], "importance_valu": 6, "includ": [4, 6], "incom": 1, "index": [1, 4], "indic": [4, 6], "infer": 1, "inform": [0, 1], "inherit": 4, "initi": [0, 6], "input": [0, 1, 4, 6], "input_data": 4, "inputvalid": [0, 2], "instruct": 6, "int": [0, 5], "integr": 1, "interact": 1, "interfac": [1, 4, 6], "invalid": 4, "issu": 6, "iter": 0, "json": [0, 1], "just": 0, "kei": 0, "label": [0, 6], "lag": 0, "lag_data": [0, 2], "last": [0, 5], "launch": [0, 1], "launch_mlflow_serv": [0, 2], "layout": 6, "learn": 1, "left": 6, "left_funct": 6, "level": [1, 4, 5, 6], "line": [0, 4, 6], "list": [0, 4, 6], "load": [0, 1, 5], "load_data": [0, 2], "local": 1, "locat": 5, "log": [0, 4], "logic": [1, 4, 6], "luchtmeet": 0, "machin": 1, "made": 1, "main": [1, 2, 4], "make": [0, 1, 4, 5], "manag": [1, 6], "maximum": 0, "mean": [0, 4, 5], "measur": 6, "merg": 0, "merge_raw_data": [0, 2], "merged_data_df": 6, "messag": [0, 4, 6], "meter": 5, "method": [0, 4, 6], "metric": [0, 4], "microgram": 5, "minut": 4, "miss": 0, "mlflow": 0, "mm": 0, "model": [0, 1, 2, 3, 4], "model_develop": [1, 2], "modul": [1, 2], "most": 0, "mvc": 1, "n_iter": [0, 1], "name": [0, 4, 6], "navig": 6, "ndarrai": 0, "new": [0, 4], "next": [4, 5, 6], "next_three_day_predict": [3, 5], "nice": 0, "no2": [0, 4, 5, 6], "none": [0, 3, 4, 6], "normal": 0, "normalize_data": [0, 2], "normalizer_typ": 0, "note": 1, "now": 0, "np": 0, "number": 0, "numer": 0, "o3": [0, 4, 5, 6], "obei": 1, "object": [0, 1, 4, 5, 6], "obtain": 5, "offer": 1, "oldest": 0, "one": 1, "onli": 1, "oper": 1, "optim": 0, "option": 6, "order": 0, "organ": 1, "other": [0, 1], "otherwis": [0, 4, 6], "out": [0, 4], "output": 1, "over": 0, "packag": [1, 2], "page": [1, 4, 6], "panda": [0, 4, 5, 6], "param_spac": 0, "paramet": [0, 4, 6], "pars": [0, 1], "parser": 1, "parser_ui": [1, 2], "password": [4, 6], "past": [0, 5], "past_data_path": 5, "path": [0, 1], "pattern": 1, "pd": [0, 4, 5, 6], "per": [1, 5], "perform": [0, 1, 4], "period": 4, "pickl": 5, "pipelin": [0, 1], "pkl": 0, "placehold": [1, 6], "plot": [0, 4, 6], "plot_typ": 6, "plotli": [4, 6], "pm25": 0, "point": [0, 1, 4], "pollut": [4, 6], "port": 0, "port_in_us": [0, 2], "possibl": 0, "pre": 0, "predict": [1, 2, 4, 5, 6], "prediction_path": [1, 5], "predictormodel": [0, 2], "prepar": 4, "preprocess": [0, 1], "preprocess_data": [0, 2], "preprocessingpipelin": [0, 2], "print": [0, 6], "print_sourc": [3, 6], "process": [0, 1], "processed_data_path": 0, "produc": 6, "prompt": [4, 6], "prompt_admin_password": [3, 6], "provid": [0, 1, 6], "py": 1, "python": 1, "qualiti": [0, 4, 5, 6], "queri": [0, 4], "question": [4, 6], "quit": 0, "quiz": [3, 6], "rais": [0, 6], "raise_awar": [3, 6], "random": [0, 1, 4, 6], "random_fact": 6, "random_forest": 0, "random_forest_predict": [0, 2], "randomforestregressor": 0, "rang": 0, "ratio": 6, "raw": 0, "raw_data_path": 0, "real": 1, "recent": 0, "recommend": 6, "regressor": 0, "regressortrain": [0, 2], "regular": 1, "relat": 1, "relev": 0, "remov": 0, "renam": 0, "rename_initial_column": [0, 2], "render": 4, "repres": [0, 4], "requir": [0, 1, 6], "respons": [0, 4, 6], "result": [1, 6], "retriev": [1, 4], "return": [0, 4, 5, 6], "right": 6, "right_funct": 6, "root": 5, "row": 0, "run": [0, 1, 2, 4], "run_bayesian_optim": [0, 2], "run_pipelin": [0, 2], "sai": [0, 6], "same": 0, "save": 0, "save_to_csv": [0, 2], "saved_model": 0, "scheme": 0, "score": 4, "script": 1, "search": [0, 1], "second": 4, "select": [0, 6], "select_cols_by_correl": [0, 2], "select_featur": [0, 2], "separ": 1, "seri": 5, "server": 0, "set": [0, 6], "set_layout": [3, 6], "sha": 4, "shift": 0, "short": 4, "show": [4, 6], "show_admin_pag": [3, 6], "show_current_data": [3, 6], "show_dashboard": [3, 4], "show_dashboard_switch": [3, 6], "shown": 6, "sidebar": 6, "singl": 0, "sklearn": 0, "skopt": 0, "so": 0, "solut": 1, "sort": 0, "sort_data_by_d": [0, 2], "sourc": [0, 1, 4, 5, 6], "space": [0, 1], "specif": [0, 1], "specifi": 1, "split": 0, "squar": [0, 5], "ss": 0, "stage": 1, "standard": 4, "start": 0, "static": 0, "station": 0, "station_numb": 0, "step": 1, "store": 4, "str": [0, 4, 6], "streamlit": [1, 4, 6], "streamlit_src": [1, 2], "string": 6, "submodul": [1, 2], "subpackag": [1, 2], "success": [3, 6], "suitabl": 1, "switch": 4, "system": [0, 1], "t": 6, "t_max": 0, "tabl": 6, "take": 0, "techniqu": 1, "test": 0, "test_siz": 0, "text": [4, 6], "them": 6, "thi": [0, 1, 4, 6], "those": 0, "three": [0, 4, 5, 6], "threshold": 4, "through": 1, "time": [0, 1, 4, 6], "timeseriessplit": 0, "titl": [4, 6], "todai": 5, "togeth": 1, "track": 0, "train": [0, 1, 4], "train_all_model": [0, 2], "train_model": [0, 2], "train_one_model": [0, 2], "train_test_split": [0, 2], "transform": 1, "tree": [0, 1], "true": [0, 4, 6], "tupl": [0, 4, 6], "turn": 0, "two": [0, 1, 4, 6], "two_columns_layout": [3, 6], "type": [0, 4, 5, 6], "typeerror": 0, "ui": 1, "uninformative_column": [0, 2], "up": [0, 6], "updat": 6, "upload": [4, 6], "upload_dataset": [3, 6], "upload_instruct": [3, 6], "uri": 0, "url": 6, "us": [0, 1, 4, 6], "usabl": 0, "user": [1, 4, 6], "user_control": [2, 3], "user_view": [1, 2, 3], "usercontrol": [3, 4], "userview": [3, 6], "util": [1, 2], "utrecht": 0, "utrecht_data": 0, "valid": [0, 1, 4], "validate_file_exist": [0, 2], "validate_typ": [0, 2], "valu": [0, 4, 6], "valueerror": 0, "variabl": 0, "variable_nam": 0, "variou": 1, "via": 1, "view": [1, 2, 3, 4], "view_option_select": [3, 6], "visual": 0, "wa": [4, 6], "want": 0, "warn": 6, "weather": 0, "web": 1, "when": 6, "where": 0, "whether": [0, 4, 6], "which": [1, 4], "whitespac": 0, "who": [4, 5, 6], "who_limit": 4, "within": [1, 6], "without": 0, "workflow": 0, "wrap": 0, "x": 0, "x_test": 0, "x_test_path": [0, 1], "x_train": 0, "x_train_path": [0, 1], "xgb": 0, "xgb_predict": [0, 2], "xgboost": [0, 4], "xgbregressor": 0, "y": 0, "y_pred": 0, "y_test": 0, "y_test_path": [0, 1], "y_train": 0, "y_train_path": [0, 1], "yaml": [0, 1], "you": [0, 1], "yyyi": 0, "z": 4}, "titles": ["air_quality_forecast package", "Air Quality Forecast documentation", "air-quality-forecast", "streamlit_src package", "streamlit_src.controllers package", "streamlit_src.models package", "streamlit_src.views package"], "titleterms": {"admin_control": 4, "admin_view": 6, "air": [1, 2], "air_quality_forecast": 0, "air_quality_model": 5, "api_cal": 0, "app": 3, "breakdown": 1, "codebas": 1, "content": [0, 1, 3, 4, 5, 6], "control": 4, "data_pipelin": 0, "deploy": 1, "directori": 1, "document": 1, "forecast": [1, 2], "get_prediction_data": 0, "home_control": 4, "home_view": 6, "main": 0, "model": 5, "model_develop": 0, "modul": [0, 3, 4, 5, 6], "packag": [0, 3, 4, 5, 6], "parser_ui": 0, "predict": 0, "problem": 1, "project": 1, "protocol": 1, "qualiti": [1, 2], "retrain": 1, "statement": 1, "streamlit_src": [3, 4, 5, 6], "structur": 1, "submodul": [0, 3, 4, 5, 6], "subpackag": 3, "user_control": 4, "user_view": 6, "util": 0, "view": 6, "workflow": 1}})
|
docs/_build/html/streamlit_src.controllers.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
-
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -20,17 +20,17 @@
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.views package" href="streamlit_src.views.html" />
|
| 23 |
-
<link rel="prev" title="streamlit_src package" href="streamlit_src.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
-
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
@@ -87,7 +87,7 @@
|
|
| 87 |
</div>
|
| 88 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 89 |
<div itemprop="articleBody">
|
| 90 |
-
|
| 91 |
<section id="streamlit-src-controllers-package">
|
| 92 |
<h1>streamlit_src.controllers package<a class="headerlink" href="#streamlit-src-controllers-package" title="Link to this heading"></a></h1>
|
| 93 |
<section id="submodules">
|
|
@@ -169,7 +169,7 @@ Displays which features exceed the threshold.</p>
|
|
| 169 |
|
| 170 |
<dl class="py method">
|
| 171 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions">
|
| 172 |
-
<span class="sig-name descname"><span class="pre">_make_custom_predictions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._make_custom_predictions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions" title="Link to this definition"></a></dt>
|
| 173 |
<dd><p>Makes a custom prediction for the admin interface.</p>
|
| 174 |
</dd></dl>
|
| 175 |
|
|
@@ -192,19 +192,19 @@ Displays which features exceed the threshold.</p>
|
|
| 192 |
|
| 193 |
<dl class="py method">
|
| 194 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._model_metrics">
|
| 195 |
-
<span class="sig-name descname"><span class="pre">_model_metrics</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._model_metrics"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._model_metrics" title="Link to this definition"></a></dt>
|
| 196 |
<dd><p>Computes the metrics for the admin interface.</p>
|
| 197 |
</dd></dl>
|
| 198 |
|
| 199 |
<dl class="py method">
|
| 200 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._show_current_data">
|
| 201 |
-
<span class="sig-name descname"><span class="pre">_show_current_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._show_current_data" title="Link to this definition"></a></dt>
|
| 202 |
<dd><p>Shows the current data on the main page of the user interface.</p>
|
| 203 |
</dd></dl>
|
| 204 |
|
| 205 |
<dl class="py method">
|
| 206 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController.show_dashboard">
|
| 207 |
-
<span class="sig-name descname"><span class="pre">show_dashboard</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController.show_dashboard"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController.show_dashboard" title="Link to this definition"></a></dt>
|
| 208 |
<dd><p>Shows the main page of the admin interface.</p>
|
| 209 |
</dd></dl>
|
| 210 |
|
|
@@ -217,6 +217,11 @@ Displays which features exceed the threshold.</p>
|
|
| 217 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController">
|
| 218 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.controllers.home_controller.</span></span><span class="sig-name descname"><span class="pre">HomeController</span></span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController" title="Link to this definition"></a></dt>
|
| 219 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
<dl class="py attribute">
|
| 221 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH">
|
| 222 |
<span class="sig-name descname"><span class="pre">__ADMIN_PASSWORD_HASH</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9'</span></em><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH" title="Link to this definition"></a></dt>
|
|
@@ -224,14 +229,22 @@ Displays which features exceed the threshold.</p>
|
|
| 224 |
|
| 225 |
<dl class="py method">
|
| 226 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController._hash_password">
|
| 227 |
-
<span class="sig-name descname"><span class="pre">_hash_password</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController._hash_password"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController._hash_password" title="Link to this definition"></a></dt>
|
| 228 |
<dd><p>Hash the input password using SHA-256.</p>
|
| 229 |
</dd></dl>
|
| 230 |
|
| 231 |
<dl class="py method">
|
| 232 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController._run">
|
| 233 |
-
<span class="sig-name descname"><span class="pre">_run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController._run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController._run" title="Link to this definition"></a></dt>
|
| 234 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
</dd></dl>
|
| 237 |
|
|
@@ -280,19 +293,19 @@ Displays which features exceed the threshold.</p>
|
|
| 280 |
|
| 281 |
<dl class="py method">
|
| 282 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_compare_who">
|
| 283 |
-
<span class="sig-name descname"><span class="pre">_display_compare_who</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_compare_who"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_compare_who" title="Link to this definition"></a></dt>
|
| 284 |
<dd><p>Displays the WHO comparison on the main page of the user interface.</p>
|
| 285 |
</dd></dl>
|
| 286 |
|
| 287 |
<dl class="py method">
|
| 288 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_plots">
|
| 289 |
-
<span class="sig-name descname"><span class="pre">_display_plots</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_plots"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_plots" title="Link to this definition"></a></dt>
|
| 290 |
<dd><p>Displays the plots on the main page of the user interface.</p>
|
| 291 |
</dd></dl>
|
| 292 |
|
| 293 |
<dl class="py method">
|
| 294 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_sources">
|
| 295 |
-
<span class="sig-name descname"><span class="pre">_display_sources</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_sources"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_sources" title="Link to this definition"></a></dt>
|
| 296 |
<dd><p>Displays the sources on the main page of the user interface.</p>
|
| 297 |
</dd></dl>
|
| 298 |
|
|
@@ -334,7 +347,7 @@ Displays which features exceed the threshold.</p>
|
|
| 334 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._is_current_data_available">
|
| 335 |
<span class="sig-name descname"><span class="pre">_is_current_data_available</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._is_current_data_available"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._is_current_data_available" title="Link to this definition"></a></dt>
|
| 336 |
<dd><p>Checks if the current data is available.</p>
|
| 337 |
-
<p>The current data is not available from
|
| 338 |
This is because the API is queried every 15 minutes, and the
|
| 339 |
data is not available for a short period of time before and after
|
| 340 |
the new data is fetched.</p>
|
|
@@ -403,7 +416,7 @@ the new data is fetched.</p>
|
|
| 403 |
|
| 404 |
<dl class="py method">
|
| 405 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._quiz">
|
| 406 |
-
<span class="sig-name descname"><span class="pre">_quiz</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._quiz"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._quiz" title="Link to this definition"></a></dt>
|
| 407 |
<dd><p>Show a _quiz question and return the answer and whether the answer was correct.</p>
|
| 408 |
<dl class="field-list simple">
|
| 409 |
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
|
@@ -417,19 +430,19 @@ the new data is fetched.</p>
|
|
| 417 |
|
| 418 |
<dl class="py method">
|
| 419 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._raise_awareness">
|
| 420 |
-
<span class="sig-name descname"><span class="pre">_raise_awareness</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._raise_awareness"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._raise_awareness" title="Link to this definition"></a></dt>
|
| 421 |
<dd><p>Shows the awareness content on the main page of the user interface.</p>
|
| 422 |
</dd></dl>
|
| 423 |
|
| 424 |
<dl class="py method">
|
| 425 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._show_current_data">
|
| 426 |
-
<span class="sig-name descname"><span class="pre">_show_current_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._show_current_data" title="Link to this definition"></a></dt>
|
| 427 |
<dd><p>Shows the current data on the main page of the user interface.</p>
|
| 428 |
</dd></dl>
|
| 429 |
|
| 430 |
<dl class="py method">
|
| 431 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController.show_dashboard">
|
| 432 |
-
<span class="sig-name descname"><span class="pre">show_dashboard</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController.show_dashboard"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController.show_dashboard" title="Link to this definition"></a></dt>
|
| 433 |
<dd><p>Shows the main page of the user interface.</p>
|
| 434 |
</dd></dl>
|
| 435 |
|
|
@@ -458,7 +471,7 @@ the new data is fetched.</p>
|
|
| 458 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 459 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 460 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 461 |
-
|
| 462 |
|
| 463 |
</footer>
|
| 464 |
</div>
|
|
@@ -469,7 +482,7 @@ the new data is fetched.</p>
|
|
| 469 |
jQuery(function () {
|
| 470 |
SphinxRtdTheme.Navigation.enable(true);
|
| 471 |
});
|
| 472 |
-
</script>
|
| 473 |
|
| 474 |
</body>
|
| 475 |
-
</html>
|
|
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
+
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.views package" href="streamlit_src.views.html" />
|
| 23 |
+
<link rel="prev" title="streamlit_src package" href="streamlit_src.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
+
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
|
|
| 87 |
</div>
|
| 88 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 89 |
<div itemprop="articleBody">
|
| 90 |
+
|
| 91 |
<section id="streamlit-src-controllers-package">
|
| 92 |
<h1>streamlit_src.controllers package<a class="headerlink" href="#streamlit-src-controllers-package" title="Link to this heading"></a></h1>
|
| 93 |
<section id="submodules">
|
|
|
|
| 169 |
|
| 170 |
<dl class="py method">
|
| 171 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions">
|
| 172 |
+
<span class="sig-name descname"><span class="pre">_make_custom_predictions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._make_custom_predictions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._make_custom_predictions" title="Link to this definition"></a></dt>
|
| 173 |
<dd><p>Makes a custom prediction for the admin interface.</p>
|
| 174 |
</dd></dl>
|
| 175 |
|
|
|
|
| 192 |
|
| 193 |
<dl class="py method">
|
| 194 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._model_metrics">
|
| 195 |
+
<span class="sig-name descname"><span class="pre">_model_metrics</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._model_metrics"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._model_metrics" title="Link to this definition"></a></dt>
|
| 196 |
<dd><p>Computes the metrics for the admin interface.</p>
|
| 197 |
</dd></dl>
|
| 198 |
|
| 199 |
<dl class="py method">
|
| 200 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController._show_current_data">
|
| 201 |
+
<span class="sig-name descname"><span class="pre">_show_current_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController._show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController._show_current_data" title="Link to this definition"></a></dt>
|
| 202 |
<dd><p>Shows the current data on the main page of the user interface.</p>
|
| 203 |
</dd></dl>
|
| 204 |
|
| 205 |
<dl class="py method">
|
| 206 |
<dt class="sig sig-object py" id="streamlit_src.controllers.admin_controller.AdminController.show_dashboard">
|
| 207 |
+
<span class="sig-name descname"><span class="pre">show_dashboard</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/admin_controller.html#AdminController.show_dashboard"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.admin_controller.AdminController.show_dashboard" title="Link to this definition"></a></dt>
|
| 208 |
<dd><p>Shows the main page of the admin interface.</p>
|
| 209 |
</dd></dl>
|
| 210 |
|
|
|
|
| 217 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController">
|
| 218 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.controllers.home_controller.</span></span><span class="sig-name descname"><span class="pre">HomeController</span></span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController" title="Link to this definition"></a></dt>
|
| 219 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 220 |
+
<p>Handles the logic for the home page, including switching between user and admin views.</p>
|
| 221 |
+
<p>The home page is the main entry point for the Streamlit application.
|
| 222 |
+
It contains a text input for the admin password, which is hashed and compared to the stored hash.
|
| 223 |
+
If the password is correct, the user is logged in as an admin and the admin view is displayed.
|
| 224 |
+
Otherwise, the user view is displayed.</p>
|
| 225 |
<dl class="py attribute">
|
| 226 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH">
|
| 227 |
<span class="sig-name descname"><span class="pre">__ADMIN_PASSWORD_HASH</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">'240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9'</span></em><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController.__ADMIN_PASSWORD_HASH" title="Link to this definition"></a></dt>
|
|
|
|
| 229 |
|
| 230 |
<dl class="py method">
|
| 231 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController._hash_password">
|
| 232 |
+
<span class="sig-name descname"><span class="pre">_hash_password</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">password</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController._hash_password"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController._hash_password" title="Link to this definition"></a></dt>
|
| 233 |
<dd><p>Hash the input password using SHA-256.</p>
|
| 234 |
</dd></dl>
|
| 235 |
|
| 236 |
<dl class="py method">
|
| 237 |
<dt class="sig sig-object py" id="streamlit_src.controllers.home_controller.HomeController._run">
|
| 238 |
+
<span class="sig-name descname"><span class="pre">_run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/home_controller.html#HomeController._run"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.home_controller.HomeController._run" title="Link to this definition"></a></dt>
|
| 239 |
+
<dd><p>Runs the application logic for the home page.</p>
|
| 240 |
+
<p>This method is responsible for rendering the home page and
|
| 241 |
+
handling the user’s choice of whether to view the user dashboard
|
| 242 |
+
or admin dashboard. If the user chooses to view the admin dashboard,
|
| 243 |
+
the user is prompted to enter the admin password. If the password
|
| 244 |
+
is valid, the user is logged in as an admin and the admin dashboard
|
| 245 |
+
is displayed. If the password is invalid, the user is logged out and
|
| 246 |
+
the user dashboard is displayed.</p>
|
| 247 |
+
</dd></dl>
|
| 248 |
|
| 249 |
</dd></dl>
|
| 250 |
|
|
|
|
| 293 |
|
| 294 |
<dl class="py method">
|
| 295 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_compare_who">
|
| 296 |
+
<span class="sig-name descname"><span class="pre">_display_compare_who</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_compare_who"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_compare_who" title="Link to this definition"></a></dt>
|
| 297 |
<dd><p>Displays the WHO comparison on the main page of the user interface.</p>
|
| 298 |
</dd></dl>
|
| 299 |
|
| 300 |
<dl class="py method">
|
| 301 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_plots">
|
| 302 |
+
<span class="sig-name descname"><span class="pre">_display_plots</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_plots"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_plots" title="Link to this definition"></a></dt>
|
| 303 |
<dd><p>Displays the plots on the main page of the user interface.</p>
|
| 304 |
</dd></dl>
|
| 305 |
|
| 306 |
<dl class="py method">
|
| 307 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._display_sources">
|
| 308 |
+
<span class="sig-name descname"><span class="pre">_display_sources</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._display_sources"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._display_sources" title="Link to this definition"></a></dt>
|
| 309 |
<dd><p>Displays the sources on the main page of the user interface.</p>
|
| 310 |
</dd></dl>
|
| 311 |
|
|
|
|
| 347 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._is_current_data_available">
|
| 348 |
<span class="sig-name descname"><span class="pre">_is_current_data_available</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._is_current_data_available"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._is_current_data_available" title="Link to this definition"></a></dt>
|
| 349 |
<dd><p>Checks if the current data is available.</p>
|
| 350 |
+
<p>The current data is not available from 00:00 to 04:15.
|
| 351 |
This is because the API is queried every 15 minutes, and the
|
| 352 |
data is not available for a short period of time before and after
|
| 353 |
the new data is fetched.</p>
|
|
|
|
| 416 |
|
| 417 |
<dl class="py method">
|
| 418 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._quiz">
|
| 419 |
+
<span class="sig-name descname"><span class="pre">_quiz</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._quiz"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._quiz" title="Link to this definition"></a></dt>
|
| 420 |
<dd><p>Show a _quiz question and return the answer and whether the answer was correct.</p>
|
| 421 |
<dl class="field-list simple">
|
| 422 |
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
|
|
|
| 430 |
|
| 431 |
<dl class="py method">
|
| 432 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._raise_awareness">
|
| 433 |
+
<span class="sig-name descname"><span class="pre">_raise_awareness</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._raise_awareness"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._raise_awareness" title="Link to this definition"></a></dt>
|
| 434 |
<dd><p>Shows the awareness content on the main page of the user interface.</p>
|
| 435 |
</dd></dl>
|
| 436 |
|
| 437 |
<dl class="py method">
|
| 438 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController._show_current_data">
|
| 439 |
+
<span class="sig-name descname"><span class="pre">_show_current_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController._show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController._show_current_data" title="Link to this definition"></a></dt>
|
| 440 |
<dd><p>Shows the current data on the main page of the user interface.</p>
|
| 441 |
</dd></dl>
|
| 442 |
|
| 443 |
<dl class="py method">
|
| 444 |
<dt class="sig sig-object py" id="streamlit_src.controllers.user_controller.UserController.show_dashboard">
|
| 445 |
+
<span class="sig-name descname"><span class="pre">show_dashboard</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/controllers/user_controller.html#UserController.show_dashboard"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.controllers.user_controller.UserController.show_dashboard" title="Link to this definition"></a></dt>
|
| 446 |
<dd><p>Shows the main page of the user interface.</p>
|
| 447 |
</dd></dl>
|
| 448 |
|
|
|
|
| 471 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 472 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 473 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 474 |
+
|
| 475 |
|
| 476 |
</footer>
|
| 477 |
</div>
|
|
|
|
| 482 |
jQuery(function () {
|
| 483 |
SphinxRtdTheme.Navigation.enable(true);
|
| 484 |
});
|
| 485 |
+
</script>
|
| 486 |
|
| 487 |
</body>
|
| 488 |
+
</html>
|
docs/_build/html/streamlit_src.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
-
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -20,17 +20,17 @@
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.controllers package" href="streamlit_src.controllers.html" />
|
| 23 |
-
<link rel="prev" title="air_quality_forecast package" href="air_quality_forecast.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
-
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
@@ -86,7 +86,7 @@
|
|
| 86 |
</div>
|
| 87 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 88 |
<div itemprop="articleBody">
|
| 89 |
-
|
| 90 |
<section id="streamlit-src-package">
|
| 91 |
<h1>streamlit_src package<a class="headerlink" href="#streamlit-src-package" title="Link to this heading"></a></h1>
|
| 92 |
<section id="subpackages">
|
|
@@ -161,9 +161,14 @@
|
|
| 161 |
</li>
|
| 162 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.views.html#module-streamlit_src.views.home_view">streamlit_src.views.home_view module</a><ul>
|
| 163 |
<li class="toctree-l3"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView"><code class="docutils literal notranslate"><span class="pre">HomeView</span></code></a><ul>
|
| 164 |
-
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.
|
|
|
|
| 165 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.set_layout"><code class="docutils literal notranslate"><span class="pre">HomeView.set_layout()</span></code></a></li>
|
| 166 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.show_dashboard_switch"><code class="docutils literal notranslate"><span class="pre">HomeView.show_dashboard_switch()</span></code></a></li>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
</ul>
|
| 168 |
</li>
|
| 169 |
</ul>
|
|
@@ -193,6 +198,8 @@
|
|
| 193 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.models.html#submodules">Submodules</a></li>
|
| 194 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.models.html#module-streamlit_src.models.air_quality_model">streamlit_src.models.air_quality_model module</a><ul>
|
| 195 |
<li class="toctree-l3"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel"><code class="docutils literal notranslate"><span class="pre">AirQualityModel</span></code></a><ul>
|
|
|
|
|
|
|
| 196 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.calculate_metrics()</span></code></a></li>
|
| 197 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.get_all_data_last_three_days()</span></code></a></li>
|
| 198 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.get_last_three_days()</span></code></a></li>
|
|
@@ -236,7 +243,7 @@
|
|
| 236 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 237 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 238 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 239 |
-
|
| 240 |
|
| 241 |
</footer>
|
| 242 |
</div>
|
|
@@ -247,7 +254,7 @@
|
|
| 247 |
jQuery(function () {
|
| 248 |
SphinxRtdTheme.Navigation.enable(true);
|
| 249 |
});
|
| 250 |
-
</script>
|
| 251 |
|
| 252 |
</body>
|
| 253 |
-
</html>
|
|
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
+
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.controllers package" href="streamlit_src.controllers.html" />
|
| 23 |
+
<link rel="prev" title="air_quality_forecast package" href="air_quality_forecast.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
+
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
|
|
| 86 |
</div>
|
| 87 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 88 |
<div itemprop="articleBody">
|
| 89 |
+
|
| 90 |
<section id="streamlit-src-package">
|
| 91 |
<h1>streamlit_src package<a class="headerlink" href="#streamlit-src-package" title="Link to this heading"></a></h1>
|
| 92 |
<section id="subpackages">
|
|
|
|
| 161 |
</li>
|
| 162 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.views.html#module-streamlit_src.views.home_view">streamlit_src.views.home_view module</a><ul>
|
| 163 |
<li class="toctree-l3"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView"><code class="docutils literal notranslate"><span class="pre">HomeView</span></code></a><ul>
|
| 164 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.None"><code class="docutils literal notranslate"><span class="pre">HomeView.None</span></code></a></li>
|
| 165 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.__init__"><code class="docutils literal notranslate"><span class="pre">HomeView.__init__()</span></code></a></li>
|
| 166 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.set_layout"><code class="docutils literal notranslate"><span class="pre">HomeView.set_layout()</span></code></a></li>
|
| 167 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.show_dashboard_switch"><code class="docutils literal notranslate"><span class="pre">HomeView.show_dashboard_switch()</span></code></a></li>
|
| 168 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#streamlit_src.views.home_view.HomeView.prompt_admin_password"><code class="docutils literal notranslate"><span class="pre">HomeView.prompt_admin_password()</span></code></a></li>
|
| 169 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#id0"><code class="docutils literal notranslate"><span class="pre">HomeView.prompt_admin_password()</span></code></a></li>
|
| 170 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#id1"><code class="docutils literal notranslate"><span class="pre">HomeView.set_layout()</span></code></a></li>
|
| 171 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.views.html#id2"><code class="docutils literal notranslate"><span class="pre">HomeView.show_dashboard_switch()</span></code></a></li>
|
| 172 |
</ul>
|
| 173 |
</li>
|
| 174 |
</ul>
|
|
|
|
| 198 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.models.html#submodules">Submodules</a></li>
|
| 199 |
<li class="toctree-l2"><a class="reference internal" href="streamlit_src.models.html#module-streamlit_src.models.air_quality_model">streamlit_src.models.air_quality_model module</a><ul>
|
| 200 |
<li class="toctree-l3"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel"><code class="docutils literal notranslate"><span class="pre">AirQualityModel</span></code></a><ul>
|
| 201 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel._WHO_NO2_LEVEL"><code class="docutils literal notranslate"><span class="pre">AirQualityModel._WHO_NO2_LEVEL</span></code></a></li>
|
| 202 |
+
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel._WHO_O3_LEVEL"><code class="docutils literal notranslate"><span class="pre">AirQualityModel._WHO_O3_LEVEL</span></code></a></li>
|
| 203 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.calculate_metrics()</span></code></a></li>
|
| 204 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.get_all_data_last_three_days()</span></code></a></li>
|
| 205 |
<li class="toctree-l4"><a class="reference internal" href="streamlit_src.models.html#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days"><code class="docutils literal notranslate"><span class="pre">AirQualityModel.get_last_three_days()</span></code></a></li>
|
|
|
|
| 243 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 244 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 245 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 246 |
+
|
| 247 |
|
| 248 |
</footer>
|
| 249 |
</div>
|
|
|
|
| 254 |
jQuery(function () {
|
| 255 |
SphinxRtdTheme.Navigation.enable(true);
|
| 256 |
});
|
| 257 |
+
</script>
|
| 258 |
|
| 259 |
</body>
|
| 260 |
+
</html>
|
docs/_build/html/streamlit_src.models.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
-
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -19,17 +19,17 @@
|
|
| 19 |
<script src="_static/js/theme.js"></script>
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
-
<link rel="prev" title="streamlit_src.views package" href="streamlit_src.views.html" />
|
| 23 |
</head>
|
| 24 |
|
| 25 |
-
<body class="wy-body-for-nav">
|
| 26 |
<div class="wy-grid-for-nav">
|
| 27 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 28 |
<div class="wy-side-scroll">
|
| 29 |
<div class="wy-side-nav-search" >
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
<a href="index.html" class="icon icon-home">
|
| 34 |
Air Quality Forecast
|
| 35 |
</a>
|
|
@@ -86,7 +86,7 @@
|
|
| 86 |
</div>
|
| 87 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 88 |
<div itemprop="articleBody">
|
| 89 |
-
|
| 90 |
<section id="streamlit-src-models-package">
|
| 91 |
<h1>streamlit_src.models package<a class="headerlink" href="#streamlit-src-models-package" title="Link to this heading"></a></h1>
|
| 92 |
<section id="submodules">
|
|
@@ -98,24 +98,78 @@
|
|
| 98 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel">
|
| 99 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.models.air_quality_model.</span></span><span class="sig-name descname"><span class="pre">AirQualityModel</span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel" title="Link to this definition"></a></dt>
|
| 100 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
<dl class="py method">
|
| 102 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics">
|
| 103 |
-
<span class="sig-name descname"><span class="pre">calculate_metrics</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.calculate_metrics"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics" title="Link to this definition"></a></dt>
|
| 104 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
<dl class="py method">
|
| 107 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days">
|
| 108 |
-
<span class="sig-name descname"><span class="pre">get_all_data_last_three_days</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_all_data_last_three_days"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days" title="Link to this definition"></a></dt>
|
| 109 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
<dl class="py method">
|
| 112 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days">
|
| 113 |
-
<span class="sig-name descname"><span class="pre">get_last_three_days</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_last_three_days"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days" title="Link to this definition"></a></dt>
|
| 114 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
<dl class="py method">
|
| 117 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_today_data">
|
| 118 |
-
<span class="sig-name descname"><span class="pre">get_today_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_today_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_today_data" title="Link to this definition"></a></dt>
|
| 119 |
<dd><p>Returns the air quality data for today from the past 3 days data.</p>
|
| 120 |
<p>The data is obtained from a CSV file located at PAST_DATA_PATH.</p>
|
| 121 |
<dl class="field-list simple">
|
|
@@ -130,8 +184,9 @@
|
|
| 130 |
|
| 131 |
<dl class="py method">
|
| 132 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions">
|
| 133 |
-
<span class="sig-name descname"><span class="pre">next_three_day_predictions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.next_three_day_predictions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions" title="Link to this definition"></a></dt>
|
| 134 |
-
<dd><
|
|
|
|
| 135 |
|
| 136 |
</dd></dl>
|
| 137 |
|
|
@@ -157,7 +212,7 @@
|
|
| 157 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 158 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 159 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 160 |
-
|
| 161 |
|
| 162 |
</footer>
|
| 163 |
</div>
|
|
@@ -168,7 +223,7 @@
|
|
| 168 |
jQuery(function () {
|
| 169 |
SphinxRtdTheme.Navigation.enable(true);
|
| 170 |
});
|
| 171 |
-
</script>
|
| 172 |
|
| 173 |
</body>
|
| 174 |
-
</html>
|
|
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
+
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 19 |
<script src="_static/js/theme.js"></script>
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
+
<link rel="prev" title="streamlit_src.views package" href="streamlit_src.views.html" />
|
| 23 |
</head>
|
| 24 |
|
| 25 |
+
<body class="wy-body-for-nav">
|
| 26 |
<div class="wy-grid-for-nav">
|
| 27 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 28 |
<div class="wy-side-scroll">
|
| 29 |
<div class="wy-side-nav-search" >
|
| 30 |
|
| 31 |
+
|
| 32 |
+
|
| 33 |
<a href="index.html" class="icon icon-home">
|
| 34 |
Air Quality Forecast
|
| 35 |
</a>
|
|
|
|
| 86 |
</div>
|
| 87 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 88 |
<div itemprop="articleBody">
|
| 89 |
+
|
| 90 |
<section id="streamlit-src-models-package">
|
| 91 |
<h1>streamlit_src.models package<a class="headerlink" href="#streamlit-src-models-package" title="Link to this heading"></a></h1>
|
| 92 |
<section id="submodules">
|
|
|
|
| 98 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel">
|
| 99 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.models.air_quality_model.</span></span><span class="sig-name descname"><span class="pre">AirQualityModel</span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel" title="Link to this definition"></a></dt>
|
| 100 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 101 |
+
<p>A class that loads the air quality model and makes predictions.</p>
|
| 102 |
+
<p>The model is loaded from a pickle file located at PREDICTION_PATH.</p>
|
| 103 |
+
<dl class="py attribute">
|
| 104 |
+
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel._WHO_NO2_LEVEL">
|
| 105 |
+
<span class="sig-name descname"><span class="pre">_WHO_NO2_LEVEL</span></span><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel._WHO_NO2_LEVEL" title="Link to this definition"></a></dt>
|
| 106 |
+
<dd><p>The WHO air quality level for NO2 in micrograms per cubic meter.</p>
|
| 107 |
+
<dl class="field-list simple">
|
| 108 |
+
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
| 109 |
+
<dd class="field-odd"><p>int</p>
|
| 110 |
+
</dd>
|
| 111 |
+
</dl>
|
| 112 |
+
</dd></dl>
|
| 113 |
+
|
| 114 |
+
<dl class="py attribute">
|
| 115 |
+
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel._WHO_O3_LEVEL">
|
| 116 |
+
<span class="sig-name descname"><span class="pre">_WHO_O3_LEVEL</span></span><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel._WHO_O3_LEVEL" title="Link to this definition"></a></dt>
|
| 117 |
+
<dd><p>The WHO air quality level for O3 in micrograms per cubic meter.</p>
|
| 118 |
+
<dl class="field-list simple">
|
| 119 |
+
<dt class="field-odd">Type<span class="colon">:</span></dt>
|
| 120 |
+
<dd class="field-odd"><p>int</p>
|
| 121 |
+
</dd>
|
| 122 |
+
</dl>
|
| 123 |
+
</dd></dl>
|
| 124 |
+
|
| 125 |
<dl class="py method">
|
| 126 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics">
|
| 127 |
+
<span class="sig-name descname"><span class="pre">calculate_metrics</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.calculate_metrics"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.calculate_metrics" title="Link to this definition"></a></dt>
|
| 128 |
+
<dd><p>Calculates the root mean squared error for the predictions of the last three days.</p>
|
| 129 |
+
<p>The data is obtained from a CSV file located at PREDICTION_PATH.</p>
|
| 130 |
+
<dl class="field-list simple">
|
| 131 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 132 |
+
<dd class="field-odd"><p>A pandas DataFrame with the root mean squared error for the predictions of the last three days.</p>
|
| 133 |
+
</dd>
|
| 134 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 135 |
+
<dd class="field-even"><p>pd.DataFrame</p>
|
| 136 |
+
</dd>
|
| 137 |
+
</dl>
|
| 138 |
+
</dd></dl>
|
| 139 |
|
| 140 |
<dl class="py method">
|
| 141 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days">
|
| 142 |
+
<span class="sig-name descname"><span class="pre">get_all_data_last_three_days</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_all_data_last_three_days"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_all_data_last_three_days" title="Link to this definition"></a></dt>
|
| 143 |
+
<dd><p>Returns all the air quality data for the last three days from the past 3 days data.</p>
|
| 144 |
+
<p>The data is obtained from a CSV file located at PAST_DATA_PATH.</p>
|
| 145 |
+
<dl class="field-list simple">
|
| 146 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 147 |
+
<dd class="field-odd"><p>A pandas DataFrame with the air quality data for the last three days.</p>
|
| 148 |
+
</dd>
|
| 149 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 150 |
+
<dd class="field-even"><p>pd.DataFrame</p>
|
| 151 |
+
</dd>
|
| 152 |
+
</dl>
|
| 153 |
+
</dd></dl>
|
| 154 |
|
| 155 |
<dl class="py method">
|
| 156 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days">
|
| 157 |
+
<span class="sig-name descname"><span class="pre">get_last_three_days</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_last_three_days"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_last_three_days" title="Link to this definition"></a></dt>
|
| 158 |
+
<dd><p>Returns all the air quality data for the last three days from the past 3 days data.</p>
|
| 159 |
+
<p>The data is obtained from a CSV file located at PAST_DATA_PATH.</p>
|
| 160 |
+
<dl class="field-list simple">
|
| 161 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 162 |
+
<dd class="field-odd"><p>A pandas DataFrame with the air quality data for the last three days.</p>
|
| 163 |
+
</dd>
|
| 164 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 165 |
+
<dd class="field-even"><p>pd.DataFrame</p>
|
| 166 |
+
</dd>
|
| 167 |
+
</dl>
|
| 168 |
+
</dd></dl>
|
| 169 |
|
| 170 |
<dl class="py method">
|
| 171 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.get_today_data">
|
| 172 |
+
<span class="sig-name descname"><span class="pre">get_today_data</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">Series</span></span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.get_today_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.get_today_data" title="Link to this definition"></a></dt>
|
| 173 |
<dd><p>Returns the air quality data for today from the past 3 days data.</p>
|
| 174 |
<p>The data is obtained from a CSV file located at PAST_DATA_PATH.</p>
|
| 175 |
<dl class="field-list simple">
|
|
|
|
| 184 |
|
| 185 |
<dl class="py method">
|
| 186 |
<dt class="sig sig-object py" id="streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions">
|
| 187 |
+
<span class="sig-name descname"><span class="pre">next_three_day_predictions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">DataFrame</span></span></span><a class="reference internal" href="_modules/streamlit_src/models/air_quality_model.html#AirQualityModel.next_three_day_predictions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.models.air_quality_model.AirQualityModel.next_three_day_predictions" title="Link to this definition"></a></dt>
|
| 188 |
+
<dd><p>Returns the predictions for the next three days.</p>
|
| 189 |
+
</dd></dl>
|
| 190 |
|
| 191 |
</dd></dl>
|
| 192 |
|
|
|
|
| 212 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 213 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 214 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 215 |
+
|
| 216 |
|
| 217 |
</footer>
|
| 218 |
</div>
|
|
|
|
| 223 |
jQuery(function () {
|
| 224 |
SphinxRtdTheme.Navigation.enable(true);
|
| 225 |
});
|
| 226 |
+
</script>
|
| 227 |
|
| 228 |
</body>
|
| 229 |
+
</html>
|
docs/_build/html/streamlit_src.views.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
-
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
@@ -20,17 +20,17 @@
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.models package" href="streamlit_src.models.html" />
|
| 23 |
-
<link rel="prev" title="streamlit_src.controllers package" href="streamlit_src.controllers.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
-
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
@@ -87,7 +87,7 @@
|
|
| 87 |
</div>
|
| 88 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 89 |
<div itemprop="articleBody">
|
| 90 |
-
|
| 91 |
<section id="streamlit-src-views-package">
|
| 92 |
<h1>streamlit_src.views package<a class="headerlink" href="#streamlit-src-views-package" title="Link to this heading"></a></h1>
|
| 93 |
<section id="submodules">
|
|
@@ -116,7 +116,7 @@
|
|
| 116 |
|
| 117 |
<dl class="py method">
|
| 118 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.display_datatable">
|
| 119 |
-
<span class="sig-name descname"><span class="pre">display_datatable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.display_datatable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.display_datatable" title="Link to this definition"></a></dt>
|
| 120 |
<dd><p>Displays a table of the data.</p>
|
| 121 |
<dl class="field-list simple">
|
| 122 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -130,7 +130,7 @@
|
|
| 130 |
|
| 131 |
<dl class="py method">
|
| 132 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.display_feature_importance">
|
| 133 |
-
<span class="sig-name descname"><span class="pre">display_feature_importance</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">feature_importances</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.display_feature_importance"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.display_feature_importance" title="Link to this definition"></a></dt>
|
| 134 |
<dd><p>Displays the feature importance graph using Plotly for better aesthetics.</p>
|
| 135 |
<dl class="field-list simple">
|
| 136 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -144,7 +144,7 @@
|
|
| 144 |
|
| 145 |
<dl class="py method">
|
| 146 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.download_button">
|
| 147 |
-
<span class="sig-name descname"><span class="pre">download_button</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.download_button"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.download_button" title="Link to this definition"></a></dt>
|
| 148 |
<dd><p>Creates a download button for the user to download the data.</p>
|
| 149 |
<dl class="field-list simple">
|
| 150 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -159,8 +159,17 @@
|
|
| 159 |
|
| 160 |
<dl class="py method">
|
| 161 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.show_admin_pages">
|
| 162 |
-
<span class="sig-name descname"><span class="pre">show_admin_pages</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.show_admin_pages"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.show_admin_pages" title="Link to this definition"></a></dt>
|
| 163 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
<dl class="py method">
|
| 166 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.upload_dataset">
|
|
@@ -175,7 +184,7 @@
|
|
| 175 |
|
| 176 |
<dl class="py method">
|
| 177 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.upload_instructions">
|
| 178 |
-
<span class="sig-name descname"><span class="pre">upload_instructions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.upload_instructions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.upload_instructions" title="Link to this definition"></a></dt>
|
| 179 |
<dd><p>Displays instructions for uploading a dataset.</p>
|
| 180 |
</dd></dl>
|
| 181 |
|
|
@@ -188,20 +197,77 @@
|
|
| 188 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView">
|
| 189 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.views.home_view.</span></span><span class="sig-name descname"><span class="pre">HomeView</span></span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView" title="Link to this definition"></a></dt>
|
| 190 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 191 |
-
<
|
| 192 |
-
|
| 193 |
-
<
|
|
|
|
|
|
|
| 194 |
<dd></dd></dl>
|
| 195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
<dl class="py method">
|
| 197 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.set_layout">
|
| 198 |
<span class="sig-name descname"><span class="pre">set_layout</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.set_layout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.set_layout" title="Link to this definition"></a></dt>
|
| 199 |
-
<dd><
|
|
|
|
| 200 |
|
| 201 |
<dl class="py method">
|
| 202 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.show_dashboard_switch">
|
| 203 |
<span class="sig-name descname"><span class="pre">show_dashboard_switch</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.show_dashboard_switch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.show_dashboard_switch" title="Link to this definition"></a></dt>
|
| 204 |
-
<dd><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
</dd></dl>
|
| 207 |
|
|
@@ -215,7 +281,7 @@
|
|
| 215 |
<p>A class to handle all user interface elements.</p>
|
| 216 |
<dl class="py method">
|
| 217 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.compare_to_who">
|
| 218 |
-
<span class="sig-name descname"><span class="pre">compare_to_who</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">warnings</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.compare_to_who"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.compare_to_who" title="Link to this definition"></a></dt>
|
| 219 |
<dd><p>Compare the current pollutant concentrations with WHO guidelines and display the results.</p>
|
| 220 |
<dl class="field-list simple">
|
| 221 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -226,7 +292,7 @@
|
|
| 226 |
|
| 227 |
<dl class="py method">
|
| 228 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.data_not_available">
|
| 229 |
-
<span class="sig-name descname"><span class="pre">data_not_available</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.data_not_available"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.data_not_available" title="Link to this definition"></a></dt>
|
| 230 |
<dd><p>Show an error message indicating that data is not available.</p>
|
| 231 |
<p>This is shown when the current time is between 00:00 and 04:15, when the measurements aren’t accurate enough to produce a prediction.
|
| 232 |
The data will be automatically updated at 04:15 with the prediction for the next three days.</p>
|
|
@@ -234,7 +300,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 234 |
|
| 235 |
<dl class="py method">
|
| 236 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.display_predictions_gaugeplot">
|
| 237 |
-
<span class="sig-name descname"><span class="pre">display_predictions_gaugeplot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">gauge_plots</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.display_predictions_gaugeplot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.display_predictions_gaugeplot" title="Link to this definition"></a></dt>
|
| 238 |
<dd><p>Show a gauge plot of the predictions.</p>
|
| 239 |
<dl class="field-list simple">
|
| 240 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -245,7 +311,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 245 |
|
| 246 |
<dl class="py method">
|
| 247 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.display_predictions_lineplot">
|
| 248 |
-
<span class="sig-name descname"><span class="pre">display_predictions_lineplot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fig</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Figure</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.display_predictions_lineplot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.display_predictions_lineplot" title="Link to this definition"></a></dt>
|
| 249 |
<dd><p>Show a line plot of the predictions.</p>
|
| 250 |
<dl class="field-list simple">
|
| 251 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -256,7 +322,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 256 |
|
| 257 |
<dl class="py method">
|
| 258 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.error">
|
| 259 |
-
<span class="sig-name descname"><span class="pre">error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.error"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.error" title="Link to this definition"></a></dt>
|
| 260 |
<dd><p>Show an error message.</p>
|
| 261 |
<dl class="field-list simple">
|
| 262 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -267,7 +333,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 267 |
|
| 268 |
<dl class="py method">
|
| 269 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.print_sources">
|
| 270 |
-
<span class="sig-name descname"><span class="pre">print_sources</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sources</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.print_sources"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.print_sources" title="Link to this definition"></a></dt>
|
| 271 |
<dd><p>Print the sources used in the application.</p>
|
| 272 |
<dl class="field-list simple">
|
| 273 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -298,7 +364,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 298 |
|
| 299 |
<dl class="py method">
|
| 300 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.raise_awareness">
|
| 301 |
-
<span class="sig-name descname"><span class="pre">raise_awareness</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">random_fact</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">awareness_expanders</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">health_message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.raise_awareness"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.raise_awareness" title="Link to this definition"></a></dt>
|
| 302 |
<dd><p>Raise awareness about air quality issues and provide health recommendations.</p>
|
| 303 |
<dl class="field-list simple">
|
| 304 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -313,7 +379,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 313 |
|
| 314 |
<dl class="py method">
|
| 315 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.show_current_data">
|
| 316 |
-
<span class="sig-name descname"><span class="pre">show_current_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">merged_data_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.show_current_data" title="Link to this definition"></a></dt>
|
| 317 |
<dd><p>Show the current pollutant concentrations along with WHO guidelines.</p>
|
| 318 |
<dl class="field-list simple">
|
| 319 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -324,7 +390,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 324 |
|
| 325 |
<dl class="py method">
|
| 326 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.success">
|
| 327 |
-
<span class="sig-name descname"><span class="pre">success</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.success"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.success" title="Link to this definition"></a></dt>
|
| 328 |
<dd><p>Show a success message.</p>
|
| 329 |
<dl class="field-list simple">
|
| 330 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -335,7 +401,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 335 |
|
| 336 |
<dl class="py method">
|
| 337 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.two_columns_layout">
|
| 338 |
-
<span class="sig-name descname"><span class="pre">two_columns_layout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ratio</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">left_function</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">right_function</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.two_columns_layout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.two_columns_layout" title="Link to this definition"></a></dt>
|
| 339 |
<dd><p>Divide the page into two columns and call the left and right functions within them.</p>
|
| 340 |
<dl class="field-list simple">
|
| 341 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -390,7 +456,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 390 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 391 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 392 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 393 |
-
|
| 394 |
|
| 395 |
</footer>
|
| 396 |
</div>
|
|
@@ -401,7 +467,7 @@ The data will be automatically updated at 04:15 with the prediction for the next
|
|
| 401 |
jQuery(function () {
|
| 402 |
SphinxRtdTheme.Navigation.enable(true);
|
| 403 |
});
|
| 404 |
-
</script>
|
| 405 |
|
| 406 |
</body>
|
| 407 |
-
</html>
|
|
|
|
| 10 |
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
| 11 |
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
|
| 12 |
|
| 13 |
+
|
| 14 |
<script src="_static/jquery.js?v=5d32c60e"></script>
|
| 15 |
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
| 16 |
<script src="_static/documentation_options.js?v=5929fcd5"></script>
|
|
|
|
| 20 |
<link rel="index" title="Index" href="genindex.html" />
|
| 21 |
<link rel="search" title="Search" href="search.html" />
|
| 22 |
<link rel="next" title="streamlit_src.models package" href="streamlit_src.models.html" />
|
| 23 |
+
<link rel="prev" title="streamlit_src.controllers package" href="streamlit_src.controllers.html" />
|
| 24 |
</head>
|
| 25 |
|
| 26 |
+
<body class="wy-body-for-nav">
|
| 27 |
<div class="wy-grid-for-nav">
|
| 28 |
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
| 29 |
<div class="wy-side-scroll">
|
| 30 |
<div class="wy-side-nav-search" >
|
| 31 |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
<a href="index.html" class="icon icon-home">
|
| 35 |
Air Quality Forecast
|
| 36 |
</a>
|
|
|
|
| 87 |
</div>
|
| 88 |
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
| 89 |
<div itemprop="articleBody">
|
| 90 |
+
|
| 91 |
<section id="streamlit-src-views-package">
|
| 92 |
<h1>streamlit_src.views package<a class="headerlink" href="#streamlit-src-views-package" title="Link to this heading"></a></h1>
|
| 93 |
<section id="submodules">
|
|
|
|
| 116 |
|
| 117 |
<dl class="py method">
|
| 118 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.display_datatable">
|
| 119 |
+
<span class="sig-name descname"><span class="pre">display_datatable</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.display_datatable"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.display_datatable" title="Link to this definition"></a></dt>
|
| 120 |
<dd><p>Displays a table of the data.</p>
|
| 121 |
<dl class="field-list simple">
|
| 122 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 130 |
|
| 131 |
<dl class="py method">
|
| 132 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.display_feature_importance">
|
| 133 |
+
<span class="sig-name descname"><span class="pre">display_feature_importance</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">feature_importances</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.display_feature_importance"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.display_feature_importance" title="Link to this definition"></a></dt>
|
| 134 |
<dd><p>Displays the feature importance graph using Plotly for better aesthetics.</p>
|
| 135 |
<dl class="field-list simple">
|
| 136 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 144 |
|
| 145 |
<dl class="py method">
|
| 146 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.download_button">
|
| 147 |
+
<span class="sig-name descname"><span class="pre">download_button</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.download_button"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.download_button" title="Link to this definition"></a></dt>
|
| 148 |
<dd><p>Creates a download button for the user to download the data.</p>
|
| 149 |
<dl class="field-list simple">
|
| 150 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 159 |
|
| 160 |
<dl class="py method">
|
| 161 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.show_admin_pages">
|
| 162 |
+
<span class="sig-name descname"><span class="pre">show_admin_pages</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.show_admin_pages"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.show_admin_pages" title="Link to this definition"></a></dt>
|
| 163 |
+
<dd><p>Displays a dropdown for selecting different admin pages.</p>
|
| 164 |
+
<dl class="field-list simple">
|
| 165 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 166 |
+
<dd class="field-odd"><p>The selected page from the dropdown.</p>
|
| 167 |
+
</dd>
|
| 168 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 169 |
+
<dd class="field-even"><p>str</p>
|
| 170 |
+
</dd>
|
| 171 |
+
</dl>
|
| 172 |
+
</dd></dl>
|
| 173 |
|
| 174 |
<dl class="py method">
|
| 175 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.upload_dataset">
|
|
|
|
| 184 |
|
| 185 |
<dl class="py method">
|
| 186 |
<dt class="sig sig-object py" id="streamlit_src.views.admin_view.AdminView.upload_instructions">
|
| 187 |
+
<span class="sig-name descname"><span class="pre">upload_instructions</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/admin_view.html#AdminView.upload_instructions"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.admin_view.AdminView.upload_instructions" title="Link to this definition"></a></dt>
|
| 188 |
<dd><p>Displays instructions for uploading a dataset.</p>
|
| 189 |
</dd></dl>
|
| 190 |
|
|
|
|
| 197 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView">
|
| 198 |
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">streamlit_src.views.home_view.</span></span><span class="sig-name descname"><span class="pre">HomeView</span></span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView" title="Link to this definition"></a></dt>
|
| 199 |
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
| 200 |
+
<p>The HomeView class manages the layout and logic for the home page,
|
| 201 |
+
including the user and admin dashboard navigation.</p>
|
| 202 |
+
<dl class="py attribute">
|
| 203 |
+
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.None">
|
| 204 |
+
<span class="sig-name descname"><span class="pre">None</span></span><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.None" title="Link to this definition"></a></dt>
|
| 205 |
<dd></dd></dl>
|
| 206 |
|
| 207 |
+
<dl class="py method">
|
| 208 |
+
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.__init__">
|
| 209 |
+
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.__init__" title="Link to this definition"></a></dt>
|
| 210 |
+
<dd><p>Initializes the HomeView class by setting up the home layout.</p>
|
| 211 |
+
</dd></dl>
|
| 212 |
+
|
| 213 |
<dl class="py method">
|
| 214 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.set_layout">
|
| 215 |
<span class="sig-name descname"><span class="pre">set_layout</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.set_layout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.set_layout" title="Link to this definition"></a></dt>
|
| 216 |
+
<dd><p>Sets the layout of the home page.</p>
|
| 217 |
+
</dd></dl>
|
| 218 |
|
| 219 |
<dl class="py method">
|
| 220 |
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.show_dashboard_switch">
|
| 221 |
<span class="sig-name descname"><span class="pre">show_dashboard_switch</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.show_dashboard_switch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.show_dashboard_switch" title="Link to this definition"></a></dt>
|
| 222 |
+
<dd><p>Displays the user and admin dashboard navigation.</p>
|
| 223 |
+
</dd></dl>
|
| 224 |
+
|
| 225 |
+
<dl class="py method">
|
| 226 |
+
<dt class="sig sig-object py" id="streamlit_src.views.home_view.HomeView.prompt_admin_password">
|
| 227 |
+
<span class="sig-name descname"><span class="pre">prompt_admin_password</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.prompt_admin_password"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.home_view.HomeView.prompt_admin_password" title="Link to this definition"></a></dt>
|
| 228 |
+
<dd><p>Prompts the user for the admin password.</p>
|
| 229 |
+
</dd></dl>
|
| 230 |
+
|
| 231 |
+
<dl class="py method">
|
| 232 |
+
<dt class="sig sig-object py" id="id0">
|
| 233 |
+
<span class="sig-name descname"><span class="pre">prompt_admin_password</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.prompt_admin_password"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#id0" title="Link to this definition"></a></dt>
|
| 234 |
+
<dd><p>Prompts the user for the admin password.</p>
|
| 235 |
+
<p>This method is responsible for prompting the user for the admin password
|
| 236 |
+
when the user navigates to the admin dashboard. It displays a text input
|
| 237 |
+
field in the sidebar with a placeholder saying “Enter Admin Password:”.</p>
|
| 238 |
+
<dl class="field-list simple">
|
| 239 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 240 |
+
<dd class="field-odd"><p>The password entered by the user.</p>
|
| 241 |
+
</dd>
|
| 242 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 243 |
+
<dd class="field-even"><p>str</p>
|
| 244 |
+
</dd>
|
| 245 |
+
</dl>
|
| 246 |
+
</dd></dl>
|
| 247 |
+
|
| 248 |
+
<dl class="py method">
|
| 249 |
+
<dt class="sig sig-object py" id="id1">
|
| 250 |
+
<span class="sig-name descname"><span class="pre">set_layout</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.set_layout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#id1" title="Link to this definition"></a></dt>
|
| 251 |
+
<dd><p>Sets the layout of the home page.</p>
|
| 252 |
+
<p>This method is responsible for setting up the Streamlit page configuration
|
| 253 |
+
and creating the sidebar title.</p>
|
| 254 |
+
</dd></dl>
|
| 255 |
+
|
| 256 |
+
<dl class="py method">
|
| 257 |
+
<dt class="sig sig-object py" id="id2">
|
| 258 |
+
<span class="sig-name descname"><span class="pre">show_dashboard_switch</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="_modules/streamlit_src/views/home_view.html#HomeView.show_dashboard_switch"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#id2" title="Link to this definition"></a></dt>
|
| 259 |
+
<dd><p>Displays the user and admin dashboard navigation.</p>
|
| 260 |
+
<p>This method is responsible for displaying the user and admin dashboard navigation
|
| 261 |
+
in the sidebar. It returns the page selected by the user.</p>
|
| 262 |
+
<dl class="field-list simple">
|
| 263 |
+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
|
| 264 |
+
<dd class="field-odd"><p>The page selected by the user.</p>
|
| 265 |
+
</dd>
|
| 266 |
+
<dt class="field-even">Return type<span class="colon">:</span></dt>
|
| 267 |
+
<dd class="field-even"><p>str</p>
|
| 268 |
+
</dd>
|
| 269 |
+
</dl>
|
| 270 |
+
</dd></dl>
|
| 271 |
|
| 272 |
</dd></dl>
|
| 273 |
|
|
|
|
| 281 |
<p>A class to handle all user interface elements.</p>
|
| 282 |
<dl class="py method">
|
| 283 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.compare_to_who">
|
| 284 |
+
<span class="sig-name descname"><span class="pre">compare_to_who</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">warnings</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.compare_to_who"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.compare_to_who" title="Link to this definition"></a></dt>
|
| 285 |
<dd><p>Compare the current pollutant concentrations with WHO guidelines and display the results.</p>
|
| 286 |
<dl class="field-list simple">
|
| 287 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 292 |
|
| 293 |
<dl class="py method">
|
| 294 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.data_not_available">
|
| 295 |
+
<span class="sig-name descname"><span class="pre">data_not_available</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.data_not_available"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.data_not_available" title="Link to this definition"></a></dt>
|
| 296 |
<dd><p>Show an error message indicating that data is not available.</p>
|
| 297 |
<p>This is shown when the current time is between 00:00 and 04:15, when the measurements aren’t accurate enough to produce a prediction.
|
| 298 |
The data will be automatically updated at 04:15 with the prediction for the next three days.</p>
|
|
|
|
| 300 |
|
| 301 |
<dl class="py method">
|
| 302 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.display_predictions_gaugeplot">
|
| 303 |
+
<span class="sig-name descname"><span class="pre">display_predictions_gaugeplot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">gauge_plots</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.display_predictions_gaugeplot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.display_predictions_gaugeplot" title="Link to this definition"></a></dt>
|
| 304 |
<dd><p>Show a gauge plot of the predictions.</p>
|
| 305 |
<dl class="field-list simple">
|
| 306 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 311 |
|
| 312 |
<dl class="py method">
|
| 313 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.display_predictions_lineplot">
|
| 314 |
+
<span class="sig-name descname"><span class="pre">display_predictions_lineplot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fig</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Figure</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.display_predictions_lineplot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.display_predictions_lineplot" title="Link to this definition"></a></dt>
|
| 315 |
<dd><p>Show a line plot of the predictions.</p>
|
| 316 |
<dl class="field-list simple">
|
| 317 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 322 |
|
| 323 |
<dl class="py method">
|
| 324 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.error">
|
| 325 |
+
<span class="sig-name descname"><span class="pre">error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.error"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.error" title="Link to this definition"></a></dt>
|
| 326 |
<dd><p>Show an error message.</p>
|
| 327 |
<dl class="field-list simple">
|
| 328 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 333 |
|
| 334 |
<dl class="py method">
|
| 335 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.print_sources">
|
| 336 |
+
<span class="sig-name descname"><span class="pre">print_sources</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sources</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.print_sources"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.print_sources" title="Link to this definition"></a></dt>
|
| 337 |
<dd><p>Print the sources used in the application.</p>
|
| 338 |
<dl class="field-list simple">
|
| 339 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 364 |
|
| 365 |
<dl class="py method">
|
| 366 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.raise_awareness">
|
| 367 |
+
<span class="sig-name descname"><span class="pre">raise_awareness</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">random_fact</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">awareness_expanders</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">health_message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.raise_awareness"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.raise_awareness" title="Link to this definition"></a></dt>
|
| 368 |
<dd><p>Raise awareness about air quality issues and provide health recommendations.</p>
|
| 369 |
<dl class="field-list simple">
|
| 370 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 379 |
|
| 380 |
<dl class="py method">
|
| 381 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.show_current_data">
|
| 382 |
+
<span class="sig-name descname"><span class="pre">show_current_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">merged_data_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.show_current_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.show_current_data" title="Link to this definition"></a></dt>
|
| 383 |
<dd><p>Show the current pollutant concentrations along with WHO guidelines.</p>
|
| 384 |
<dl class="field-list simple">
|
| 385 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 390 |
|
| 391 |
<dl class="py method">
|
| 392 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.success">
|
| 393 |
+
<span class="sig-name descname"><span class="pre">success</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.success"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.success" title="Link to this definition"></a></dt>
|
| 394 |
<dd><p>Show a success message.</p>
|
| 395 |
<dl class="field-list simple">
|
| 396 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 401 |
|
| 402 |
<dl class="py method">
|
| 403 |
<dt class="sig sig-object py" id="streamlit_src.views.user_view.UserView.two_columns_layout">
|
| 404 |
+
<span class="sig-name descname"><span class="pre">two_columns_layout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ratio</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">left_function</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">right_function</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><a class="reference internal" href="#streamlit_src.views.home_view.HomeView.None" title="streamlit_src.views.home_view.HomeView.None"><span class="pre">None</span></a></span></span><a class="reference internal" href="_modules/streamlit_src/views/user_view.html#UserView.two_columns_layout"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#streamlit_src.views.user_view.UserView.two_columns_layout" title="Link to this definition"></a></dt>
|
| 405 |
<dd><p>Divide the page into two columns and call the left and right functions within them.</p>
|
| 406 |
<dl class="field-list simple">
|
| 407 |
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
|
|
| 456 |
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
| 457 |
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
| 458 |
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
| 459 |
+
|
| 460 |
|
| 461 |
</footer>
|
| 462 |
</div>
|
|
|
|
| 467 |
jQuery(function () {
|
| 468 |
SphinxRtdTheme.Navigation.enable(true);
|
| 469 |
});
|
| 470 |
+
</script>
|
| 471 |
|
| 472 |
</body>
|
| 473 |
+
</html>
|
streamlit_src/controllers/admin_controller.py
CHANGED
|
@@ -143,7 +143,12 @@ class AdminController(UserController):
|
|
| 143 |
"The data must be unnormalized.": False,
|
| 144 |
"PM25, PM10, O3, NO2 should be in micrograms per cubic meter (µg/m³).": False,
|
| 145 |
"Temperature should be in degrees Celcius": False,
|
| 146 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
"The dataset must contain a total of 33 columns in the specified order.": False,
|
| 148 |
"I accept that my data will be used for a prediction using a custom model.": False,
|
| 149 |
"I understand that my data will not be saved.": False,
|
|
|
|
| 143 |
"The data must be unnormalized.": False,
|
| 144 |
"PM25, PM10, O3, NO2 should be in micrograms per cubic meter (µg/m³).": False,
|
| 145 |
"Temperature should be in degrees Celcius": False,
|
| 146 |
+
"Humidity should be in percentages": False,
|
| 147 |
+
"Visibility should be in kilometers": False,
|
| 148 |
+
"Solar Radiation should be in watts per square meter (W/m²).": False,
|
| 149 |
+
"Precipitation should be in millimeters": False,
|
| 150 |
+
"Wind Speed should be in kilometers per hour (km/h).": False,
|
| 151 |
+
"Wind Direction should be in degrees": False,
|
| 152 |
"The dataset must contain a total of 33 columns in the specified order.": False,
|
| 153 |
"I accept that my data will be used for a prediction using a custom model.": False,
|
| 154 |
"I understand that my data will not be saved.": False,
|
streamlit_src/controllers/home_controller.py
CHANGED
|
@@ -7,21 +7,46 @@ import hashlib
|
|
| 7 |
|
| 8 |
|
| 9 |
class HomeController:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
__ADMIN_PASSWORD_HASH = (
|
| 11 |
"240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9"
|
| 12 |
)
|
| 13 |
|
| 14 |
-
def __init__(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
self.home_view = HomeView()
|
| 16 |
self.user_controller = UserController()
|
| 17 |
self.admin_controller = AdminController()
|
| 18 |
self._run()
|
| 19 |
|
| 20 |
-
def _hash_password(self, password):
|
| 21 |
"""Hash the input password using SHA-256."""
|
| 22 |
return hashlib.sha256(password.encode()).hexdigest()
|
| 23 |
|
| 24 |
-
def _run(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
if "is_admin_logged_in" not in st.session_state:
|
| 26 |
st.session_state.is_admin_logged_in = False
|
| 27 |
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
class HomeController:
|
| 10 |
+
"""
|
| 11 |
+
Handles the logic for the home page, including switching between user and admin views.
|
| 12 |
+
|
| 13 |
+
The home page is the main entry point for the Streamlit application.
|
| 14 |
+
It contains a text input for the admin password, which is hashed and compared to the stored hash.
|
| 15 |
+
If the password is correct, the user is logged in as an admin and the admin view is displayed.
|
| 16 |
+
Otherwise, the user view is displayed.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
# This needs to be hidden as an env variable but we couldn't manage with HuggingFace yet, severe security issue
|
| 20 |
__ADMIN_PASSWORD_HASH = (
|
| 21 |
"240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9"
|
| 22 |
)
|
| 23 |
|
| 24 |
+
def __init__(self) -> None:
|
| 25 |
+
"""
|
| 26 |
+
Initializes the HomeController class by setting up the home view, user controller,
|
| 27 |
+
and admin controller. Also triggers the _run method to start the application.
|
| 28 |
+
"""
|
| 29 |
self.home_view = HomeView()
|
| 30 |
self.user_controller = UserController()
|
| 31 |
self.admin_controller = AdminController()
|
| 32 |
self._run()
|
| 33 |
|
| 34 |
+
def _hash_password(self, password: str) -> str:
|
| 35 |
"""Hash the input password using SHA-256."""
|
| 36 |
return hashlib.sha256(password.encode()).hexdigest()
|
| 37 |
|
| 38 |
+
def _run(self) -> None:
|
| 39 |
+
"""
|
| 40 |
+
Runs the application logic for the home page.
|
| 41 |
+
|
| 42 |
+
This method is responsible for rendering the home page and
|
| 43 |
+
handling the user's choice of whether to view the user dashboard
|
| 44 |
+
or admin dashboard. If the user chooses to view the admin dashboard,
|
| 45 |
+
the user is prompted to enter the admin password. If the password
|
| 46 |
+
is valid, the user is logged in as an admin and the admin dashboard
|
| 47 |
+
is displayed. If the password is invalid, the user is logged out and
|
| 48 |
+
the user dashboard is displayed.
|
| 49 |
+
"""
|
| 50 |
if "is_admin_logged_in" not in st.session_state:
|
| 51 |
st.session_state.is_admin_logged_in = False
|
| 52 |
|
streamlit_src/models/air_quality_model.py
CHANGED
|
@@ -19,11 +19,24 @@ PAST_DATA_PATH = os.path.join(
|
|
| 19 |
|
| 20 |
|
| 21 |
class AirQualityModel:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
def __init__(self) -> None:
|
| 23 |
-
self.
|
| 24 |
-
self.
|
| 25 |
|
| 26 |
-
def get_today_data(self):
|
| 27 |
"""
|
| 28 |
Returns the air quality data for today from the past 3 days data.
|
| 29 |
|
|
@@ -38,14 +51,14 @@ class AirQualityModel:
|
|
| 38 |
today = last_three_days.iloc[0]
|
| 39 |
return today
|
| 40 |
|
| 41 |
-
def next_three_day_predictions(self):
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
data = pd.read_csv(PREDICTION_PATH)
|
| 44 |
|
| 45 |
-
# correct data is todays data row
|
| 46 |
data = data[data["date"] == pd.Timestamp.now().strftime("%Y-%m-%d")]
|
| 47 |
|
| 48 |
-
# Create a DataFrame with the relevant information for the next three days
|
| 49 |
next_three_days = pd.DataFrame(
|
| 50 |
{
|
| 51 |
"Day": ["Day 1", "Day 2", "Day 3"],
|
|
@@ -64,11 +77,31 @@ class AirQualityModel:
|
|
| 64 |
|
| 65 |
return next_three_days
|
| 66 |
|
| 67 |
-
def get_all_data_last_three_days(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
data = pd.read_csv(PAST_DATA_PATH)
|
| 69 |
return data
|
| 70 |
|
| 71 |
-
def get_last_three_days(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
# Extract NO2 and O3 values for the last three days
|
| 73 |
data = pd.read_csv(PAST_DATA_PATH)
|
| 74 |
last_three_days = pd.DataFrame(
|
|
@@ -88,7 +121,17 @@ class AirQualityModel:
|
|
| 88 |
)
|
| 89 |
return last_three_days
|
| 90 |
|
| 91 |
-
def calculate_metrics(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
model_predictions = pd.read_csv(PREDICTION_PATH)
|
| 93 |
|
| 94 |
yesterday = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
class AirQualityModel:
|
| 22 |
+
"""
|
| 23 |
+
A class that loads the air quality model and makes predictions.
|
| 24 |
+
|
| 25 |
+
The model is loaded from a pickle file located at PREDICTION_PATH.
|
| 26 |
+
|
| 27 |
+
Attributes
|
| 28 |
+
----------
|
| 29 |
+
_WHO_NO2_LEVEL : int
|
| 30 |
+
The WHO air quality level for NO2 in micrograms per cubic meter.
|
| 31 |
+
_WHO_O3_LEVEL : int
|
| 32 |
+
The WHO air quality level for O3 in micrograms per cubic meter.
|
| 33 |
+
"""
|
| 34 |
+
|
| 35 |
def __init__(self) -> None:
|
| 36 |
+
self._WHO_NO2_LEVEL = 25
|
| 37 |
+
self._WHO_O3_LEVEL = 100
|
| 38 |
|
| 39 |
+
def get_today_data(self) -> pd.Series:
|
| 40 |
"""
|
| 41 |
Returns the air quality data for today from the past 3 days data.
|
| 42 |
|
|
|
|
| 51 |
today = last_three_days.iloc[0]
|
| 52 |
return today
|
| 53 |
|
| 54 |
+
def next_three_day_predictions(self) -> pd.DataFrame:
|
| 55 |
+
"""
|
| 56 |
+
Returns the predictions for the next three days.
|
| 57 |
+
"""
|
| 58 |
data = pd.read_csv(PREDICTION_PATH)
|
| 59 |
|
|
|
|
| 60 |
data = data[data["date"] == pd.Timestamp.now().strftime("%Y-%m-%d")]
|
| 61 |
|
|
|
|
| 62 |
next_three_days = pd.DataFrame(
|
| 63 |
{
|
| 64 |
"Day": ["Day 1", "Day 2", "Day 3"],
|
|
|
|
| 77 |
|
| 78 |
return next_three_days
|
| 79 |
|
| 80 |
+
def get_all_data_last_three_days(self) -> pd.DataFrame:
|
| 81 |
+
"""
|
| 82 |
+
Returns all the air quality data for the last three days from the past 3 days data.
|
| 83 |
+
|
| 84 |
+
The data is obtained from a CSV file located at PAST_DATA_PATH.
|
| 85 |
+
|
| 86 |
+
Returns
|
| 87 |
+
-------
|
| 88 |
+
pd.DataFrame
|
| 89 |
+
A pandas DataFrame with the air quality data for the last three days.
|
| 90 |
+
"""
|
| 91 |
data = pd.read_csv(PAST_DATA_PATH)
|
| 92 |
return data
|
| 93 |
|
| 94 |
+
def get_last_three_days(self) -> pd.DataFrame:
|
| 95 |
+
"""
|
| 96 |
+
Returns all the air quality data for the last three days from the past 3 days data.
|
| 97 |
+
|
| 98 |
+
The data is obtained from a CSV file located at PAST_DATA_PATH.
|
| 99 |
+
|
| 100 |
+
Returns
|
| 101 |
+
-------
|
| 102 |
+
pd.DataFrame
|
| 103 |
+
A pandas DataFrame with the air quality data for the last three days.
|
| 104 |
+
"""
|
| 105 |
# Extract NO2 and O3 values for the last three days
|
| 106 |
data = pd.read_csv(PAST_DATA_PATH)
|
| 107 |
last_three_days = pd.DataFrame(
|
|
|
|
| 121 |
)
|
| 122 |
return last_three_days
|
| 123 |
|
| 124 |
+
def calculate_metrics(self) -> pd.DataFrame:
|
| 125 |
+
"""
|
| 126 |
+
Calculates the root mean squared error for the predictions of the last three days.
|
| 127 |
+
|
| 128 |
+
The data is obtained from a CSV file located at PREDICTION_PATH.
|
| 129 |
+
|
| 130 |
+
Returns
|
| 131 |
+
-------
|
| 132 |
+
pd.DataFrame
|
| 133 |
+
A pandas DataFrame with the root mean squared error for the predictions of the last three days.
|
| 134 |
+
"""
|
| 135 |
model_predictions = pd.read_csv(PREDICTION_PATH)
|
| 136 |
|
| 137 |
yesterday = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")
|
streamlit_src/views/admin_view.py
CHANGED
|
@@ -18,7 +18,13 @@ class AdminView(UserView):
|
|
| 18 |
"""
|
| 19 |
super().__init__()
|
| 20 |
|
| 21 |
-
def show_admin_pages(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
page = st.selectbox(
|
| 23 |
"Select a page:",
|
| 24 |
[
|
|
@@ -76,8 +82,8 @@ class AdminView(UserView):
|
|
| 76 |
)
|
| 77 |
st.markdown("""
|
| 78 |
- **Normalization**: The data must be **unnormalized**.
|
| 79 |
-
- **Units**: All measurements should
|
| 80 |
-
- **Data Structure**: The dataset must contain a total of **33 columns** with the following order:
|
| 81 |
- **Optional**: `date`
|
| 82 |
- `PM25` (today)
|
| 83 |
- `PM10` (today)
|
|
|
|
| 18 |
"""
|
| 19 |
super().__init__()
|
| 20 |
|
| 21 |
+
def show_admin_pages(self) -> str:
|
| 22 |
+
"""
|
| 23 |
+
Displays a dropdown for selecting different admin pages.
|
| 24 |
+
|
| 25 |
+
Returns:
|
| 26 |
+
str: The selected page from the dropdown.
|
| 27 |
+
"""
|
| 28 |
page = st.selectbox(
|
| 29 |
"Select a page:",
|
| 30 |
[
|
|
|
|
| 82 |
)
|
| 83 |
st.markdown("""
|
| 84 |
- **Normalization**: The data must be **unnormalized**.
|
| 85 |
+
- **Units**: All measurements should as specified below**.
|
| 86 |
+
- **Data Structure**: The dataset must contain a total of **33 columns** (34 with date) with the following order:
|
| 87 |
- **Optional**: `date`
|
| 88 |
- `PM25` (today)
|
| 89 |
- `PM10` (today)
|
streamlit_src/views/home_view.py
CHANGED
|
@@ -2,17 +2,62 @@ import streamlit as st
|
|
| 2 |
|
| 3 |
|
| 4 |
class HomeView:
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
self.set_layout()
|
| 7 |
|
| 8 |
-
def set_layout(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
st.set_page_config(page_title="Air Quality Monitoring Dashboard", layout="wide")
|
| 10 |
st.sidebar.title("Air Quality Monitoring")
|
| 11 |
|
| 12 |
-
def show_dashboard_switch(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
page = st.sidebar.radio("Go to", ["User Dashboard", "Admin Dashboard"])
|
| 14 |
return page
|
| 15 |
|
| 16 |
-
def prompt_admin_password(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
st.sidebar.markdown("### Admin Access Required")
|
| 18 |
return st.sidebar.text_input("Enter Admin Password:", type="password")
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
class HomeView:
|
| 5 |
+
"""
|
| 6 |
+
The HomeView class manages the layout and logic for the home page,
|
| 7 |
+
including the user and admin dashboard navigation.
|
| 8 |
+
|
| 9 |
+
Attributes:
|
| 10 |
+
None
|
| 11 |
+
|
| 12 |
+
Methods:
|
| 13 |
+
__init__: Initializes the HomeView class by setting up the home layout.
|
| 14 |
+
set_layout: Sets the layout of the home page.
|
| 15 |
+
show_dashboard_switch: Displays the user and admin dashboard navigation.
|
| 16 |
+
prompt_admin_password: Prompts the user for the admin password.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
def __init__(self) -> None:
|
| 20 |
+
"""
|
| 21 |
+
Initializes the HomeView class by setting up the home layout.
|
| 22 |
+
|
| 23 |
+
This method is responsible for setting up the Streamlit page configuration and
|
| 24 |
+
creating the sidebar title.
|
| 25 |
+
"""
|
| 26 |
self.set_layout()
|
| 27 |
|
| 28 |
+
def set_layout(self) -> None:
|
| 29 |
+
"""
|
| 30 |
+
Sets the layout of the home page.
|
| 31 |
+
|
| 32 |
+
This method is responsible for setting up the Streamlit page configuration
|
| 33 |
+
and creating the sidebar title.
|
| 34 |
+
"""
|
| 35 |
st.set_page_config(page_title="Air Quality Monitoring Dashboard", layout="wide")
|
| 36 |
st.sidebar.title("Air Quality Monitoring")
|
| 37 |
|
| 38 |
+
def show_dashboard_switch(self) -> str:
|
| 39 |
+
"""
|
| 40 |
+
Displays the user and admin dashboard navigation.
|
| 41 |
+
|
| 42 |
+
This method is responsible for displaying the user and admin dashboard navigation
|
| 43 |
+
in the sidebar. It returns the page selected by the user.
|
| 44 |
+
|
| 45 |
+
Returns:
|
| 46 |
+
str: The page selected by the user.
|
| 47 |
+
"""
|
| 48 |
page = st.sidebar.radio("Go to", ["User Dashboard", "Admin Dashboard"])
|
| 49 |
return page
|
| 50 |
|
| 51 |
+
def prompt_admin_password(self) -> str:
|
| 52 |
+
"""
|
| 53 |
+
Prompts the user for the admin password.
|
| 54 |
+
|
| 55 |
+
This method is responsible for prompting the user for the admin password
|
| 56 |
+
when the user navigates to the admin dashboard. It displays a text input
|
| 57 |
+
field in the sidebar with a placeholder saying "Enter Admin Password:".
|
| 58 |
+
|
| 59 |
+
Returns:
|
| 60 |
+
str: The password entered by the user.
|
| 61 |
+
"""
|
| 62 |
st.sidebar.markdown("### Admin Access Required")
|
| 63 |
return st.sidebar.text_input("Enter Admin Password:", type="password")
|