You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "YousefMohassab (via GitHub)" <gi...@apache.org> on 2025/12/28 19:17:02 UTC

[I] [AINode] Add Prophet and StatsForecaster to Built-in Forecast Models [iotdb]

YousefMohassab opened a new issue, #16958:
URL: https://github.com/apache/iotdb/issues/16958

   ## Feature Request
   
   Add **Prophet** (Facebook/Meta) and **StatsForecaster** to the built-in forecast models in IoTDB AINode, alongside existing models like ARIMA, HoltWinters, and Timer-XL.
   
   ## Motivation
   
   1. **Prophet** is a widely-used forecasting library that handles seasonality, holidays, and missing data automatically. It's production-proven at scale.
   
   2. **StatsForecaster** provides efficient statistical models (AutoARIMA, AutoETS, AutoTheta) that are significantly faster than traditional implementations while maintaining accuracy.
   
   3. Both libraries are already common dependencies in time-series forecasting pipelines, making IoTDB a more complete solution for industrial IoT analytics.
   
   ## Proposed Changes
   
   ### 1. ConfigNode (Java)
   Add models to the whitelist in `ModelInfo.java`:
   
   ```java
   // iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ModelInfo.java
   static {
       builtInForecastModel.add("arima");
       builtInForecastModel.add("naive_forecaster");
       // ... existing models ...
       builtInForecastModel.add("prophet");      // NEW
       builtInForecastModel.add("statsforecast"); // NEW
   }
   ```
   
   ### 2. AINode (Python)
   
   **constant.py** - Add Prophet attributes:
   ```python
   class AttributeName(Enum):
       # Prophet attributes
       YEARLY_SEASONALITY = "yearly_seasonality"
       WEEKLY_SEASONALITY = "weekly_seasonality"
       DAILY_SEASONALITY = "daily_seasonality"
       SEASONALITY_MODE = "seasonality_mode"
   ```
   
   **model_info.py** - Add model enum and mapping:
   ```python
   class BuiltInModelType(Enum):
       PROPHET = "Prophet"
       STATSFORECASTER = "StatsForecaster"
   
   BUILT_IN_MACHINE_LEARNING_MODEL_MAP = {
       "prophet": ModelInfo(model_id="prophet", ...),
       "statsforecast": ModelInfo(model_id="statsforecast", ...),
   }
   ```
   
   **built_in_model_factory.py** - Add model implementations.
   
   ### 3. Dependencies
   Add to AINode requirements:
   ```
   prophet>=1.1.5
   statsforecast>=1.7.0
   ```
   
   ## Usage Example
   
   ```sql
   -- Prophet forecast
   SELECT prophet(temperature, 'predict_length'='24', 'daily_seasonality'='true')
   FROM root.factory.sensor1
   WHERE time >= 2024-01-01 AND time < 2024-02-01
   
   -- StatsForecaster with AutoARIMA
   SELECT statsforecast(temperature, 'predict_length'='24', 'model'='autoarima')
   FROM root.factory.sensor1
   WHERE time >= 2024-01-01 AND time < 2024-02-01
   ```
   
   ## Benefits
   
   - **Performance**: Built-in models execute 7-20x faster than API-based approaches due to eliminated Python client overhead
   - **Simplicity**: Native SQL interface without requiring external Python code
   - **Production-ready**: Both libraries are battle-tested in production environments
   
   ## Additional Context
   
   I have working prototype patches for the AINode side. Happy to contribute a PR if there's interest.
   
   /cc @apache/iotdb-committers


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [AINode] Add Prophet and StatsForecaster to Built-in Forecast Models [iotdb]

Posted by "YousefMohassab (via GitHub)" <gi...@apache.org>.
YousefMohassab commented on issue #16958:
URL: https://github.com/apache/iotdb/issues/16958#issuecomment-3694976215

   Closing - submitted prematurely.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [AINode] Add Prophet and StatsForecaster to Built-in Forecast Models [iotdb]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #16958:
URL: https://github.com/apache/iotdb/issues/16958#issuecomment-3694974950

   Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [AINode] Add Prophet and StatsForecaster to Built-in Forecast Models [iotdb]

Posted by "YousefMohassab (via GitHub)" <gi...@apache.org>.
YousefMohassab closed issue #16958: [AINode] Add Prophet and StatsForecaster to Built-in Forecast Models
URL: https://github.com/apache/iotdb/issues/16958


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org