Variables with Python Forecasting
Is there a way to use variables with a Python forecast model like ARIMA or Random Forest?
I have a linear regression working, and I'm able to extract the coefficients, create variables, and use a Beast Mode calculation to generate a forecast. However, I'm unsure if this can be done with models that aren’t linear.
Ideally, I'd like the user to input their exogenous/explanatory variables and see a forecast at the dashboard level. Has anyone done something similar?
Best Answer
-
1. Model Setup with ARIMA (Exogenous Variables) or Random Forest
- ARIMA with Exogenous Variables (ARIMAX): ARIMA can accept external (exogenous) variables in addition to time series data. You can set up an ARIMAX model using Python in Domo's data science tool (like Jupyter Workspaces or Python tile).
- In Python, when fitting an ARIMAX model, use the
statsmodels
library'sSARIMAX
method, and pass your exogenous variables. - After training the model, you can store the forecast results in a dataset in Domo.
- In Python, when fitting an ARIMAX model, use the
- Random Forest for Forecasting: You can also use Random Forest Regressors (or other models like XGBoost) for forecasting if you have explanatory variables. After training the model in a Python tile, you can output the predictions to a dataset.
2. User Input for Exogenous Variables
- Webform for Input: You can create a Domo Webform for user input. This webform could capture variables like economic indicators, marketing spend, or any other factors that affect your forecast.
- These inputs will be stored in a dataset that can be dynamically updated as users enter new values.
- Domo Variables: Domo introduced a Variables feature that allows users to create variables on a dashboard and use them to dynamically adjust visualizations. You can create variables that correspond to the exogenous/explanatory variables used in your ARIMAX or Random Forest model. Users can interact with these variables using dropdowns, sliders, or text inputs on the dashboard.
3. Real-Time Forecast with Python Integration
- After obtaining user input (either through a webform or Domo Variables), you need to link these inputs back into your forecast model.
- In Python, you can fetch this data dynamically (e.g., pulling the most recent inputs from the webform dataset or variable inputs).
- Update your model or create a new prediction based on these inputs, then write the forecast results to a new dataset.
- This dataset can then be visualized on the dashboard, showing the forecast based on the user's custom inputs in real-time.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 - ARIMA with Exogenous Variables (ARIMAX): ARIMA can accept external (exogenous) variables in addition to time series data. You can set up an ARIMAX model using Python in Domo's data science tool (like Jupyter Workspaces or Python tile).
Answers
-
You should be able to use the Python tile to use Domo inputs or filtering. Run something like
from statsmodels.tsa.arima.model import ARIMA
y = your_time_series
X = your_exogenous_variable
model = ARIMA(y, exog=X, order=(p, d, q))
model_fit = model.fit()
forecast = model_fit.forecast(steps=10, exog=user_input_exog)** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Um…I did not put those numbers on that code. Hmm.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
I have a dataset and the model working right now, but the problem is getting input on the dashboard side of things.
If I create a webform I can create my own forecasts, but I'd like to be able to visualize that and incorporate variables so the user can see impact in real-time0 -
1. Model Setup with ARIMA (Exogenous Variables) or Random Forest
- ARIMA with Exogenous Variables (ARIMAX): ARIMA can accept external (exogenous) variables in addition to time series data. You can set up an ARIMAX model using Python in Domo's data science tool (like Jupyter Workspaces or Python tile).
- In Python, when fitting an ARIMAX model, use the
statsmodels
library'sSARIMAX
method, and pass your exogenous variables. - After training the model, you can store the forecast results in a dataset in Domo.
- In Python, when fitting an ARIMAX model, use the
- Random Forest for Forecasting: You can also use Random Forest Regressors (or other models like XGBoost) for forecasting if you have explanatory variables. After training the model in a Python tile, you can output the predictions to a dataset.
2. User Input for Exogenous Variables
- Webform for Input: You can create a Domo Webform for user input. This webform could capture variables like economic indicators, marketing spend, or any other factors that affect your forecast.
- These inputs will be stored in a dataset that can be dynamically updated as users enter new values.
- Domo Variables: Domo introduced a Variables feature that allows users to create variables on a dashboard and use them to dynamically adjust visualizations. You can create variables that correspond to the exogenous/explanatory variables used in your ARIMAX or Random Forest model. Users can interact with these variables using dropdowns, sliders, or text inputs on the dashboard.
3. Real-Time Forecast with Python Integration
- After obtaining user input (either through a webform or Domo Variables), you need to link these inputs back into your forecast model.
- In Python, you can fetch this data dynamically (e.g., pulling the most recent inputs from the webform dataset or variable inputs).
- Update your model or create a new prediction based on these inputs, then write the forecast results to a new dataset.
- This dataset can then be visualized on the dashboard, showing the forecast based on the user's custom inputs in real-time.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 - ARIMA with Exogenous Variables (ARIMAX): ARIMA can accept external (exogenous) variables in addition to time series data. You can set up an ARIMAX model using Python in Domo's data science tool (like Jupyter Workspaces or Python tile).
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive