High-level API for creating forecasting dashboards.
Project description
Dash-Forecast allows you to easily build forecasting dashboards.
Why Dash-Forecast
Judgment and decision making research shows that visual tools are an easy and effective way to boost forecasting accuracy. Dash-Forecast is a high-level API for creating beautiful forecasting visualizations and statistical summaries.
Installation
$ pip install dash-fcast
Quickstart
In just a few lines of code, we'll create an app that gives you:
- An intuitive 'bounds and moments' forecast elicitation
- An editable data table representation of the forecast
- Probability density function and cumulative distribution function line plots of the forecast
- A bar plot of the data table
Create a file app.py
:
import dash_fcast as fcast
import dash_fcast.distributions as dist
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash.dependencies import Input, Output
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = html.Div([
html.Br(),
dist.Moments(id='Forecast'),
html.Br(),
fcast.Table(
id='Table',
datatable={'editable': True, 'row_deletable': True},
row_addable=True
),
html.Div(id='graphs')
], className='container')
dist.Moments.register_callbacks(app)
fcast.Table.register_callbacks(app)
@app.callback(
Output('graphs', 'children'),
[
Input(dist.Moments.get_id('Forecast'), 'children'),
Input(fcast.Table.get_id('Table'), 'children')
]
)
def update_graphs(dist_state, table_state):
distribution = dist.Moments.load(dist_state)
table = fcast.Table.load(table_state)
pdf = go.Figure([distribution.pdf_plot(), table.bar_plot('Forecast')])
pdf.update_layout(transition_duration=500, title='PDF')
cdf = go.Figure([distribution.cdf_plot()])
cdf.update_layout(transition_duration=500, title='CDF')
return [dcc.Graph(figure=pdf), dcc.Graph(figure=cdf)]
if __name__ == '__main__':
app.run_server(debug=True)
Run your application with:
$ python app.py
Open your browser and navigate to http://localhost:8050/.
Citation
@software{bowen2020dash-fcast,
author = {Dillon Bowen},
title = {Dash-Forecast},
url = {https://dsbowen.github.io/dash-fcast/},
date = {2020-09-11},
}
License
Users must cite this package in any publications which use it.
It is licensed with the MIT License.
Acknowledgements
The following collaborators deserve special acknowledgement:
- David Melgin, for the bounds and moments elicitation
- Ezra Karger, whose non-parametric elicitation methods helped inspire my 'tabular elicitation'
- Sarah Reed, for feedback on the front-end design
I would also like to thank the Tetlock Lab, whose weekly presentations inspired various aspects of this package, including Zachary Jacobs' and Ian Lustick's 'first approximation algorithm', Scott Page's multi-model thinking, and Annie Duke's presentation on intuitively eliciting predictions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dash-fcast-0.0.5.tar.gz
.
File metadata
- Download URL: dash-fcast-0.0.5.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99e767a9715e0d32b133fa13e0517354c22ad201183859a799f8d52dde6ea058 |
|
MD5 | c52d4a55cf1b20a425efaf4a3c9398ae |
|
BLAKE2b-256 | c26cb6a2413e2bbfaf18369c47b1fa1c989b9dd2bdc509919a65df663c95f3e6 |
File details
Details for the file dash_fcast-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: dash_fcast-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7407b1990d523cc81511a6ee2c78f9cf207b2a2d4374b855d604bf4d124ddbe3 |
|
MD5 | 42e98e2f603c841468518166c78aa11d |
|
BLAKE2b-256 | b5ad1b726fecdc3abfecb092e7e1b8c775197dca4619cad4eacb1bb2cc40e1ec |