gramex icon indicating copy to clipboard operation
gramex copied to clipboard

GRAMEX-205 ⁃ ENH: MLHandler supports FBProphet for forecasting

Open jaidevd opened this issue 3 years ago • 0 comments
trafficstars

"Prophet" is available as a valid model class in MLHandler now.

Usage

Use the following spec:

mlhandler/prophet:
    pattern: /prophet
    handler: MLHandler
    kwargs:
      model:
        class: Prophet
      xsrf_cookies: false

Download a sample dataset here

  • Training:
curl -X POST "/prophet?_action=train&target_col=y" -d @train.json -H "Content-Type: application/json"
# {score: 0.33} Returns the MAE score
  • Getting predictions against timestamps
curl -X POST "/prophet?_action=predict&target_col=y" -d @test.json -H "Content-Type: application/json"
# The timestamp column MUST be called "ds"
  • Getting forecasts for n periods in the future
# Get a month's forecast, assuming daily data
curl -X GET "/prophet?_action=predict&n_perids=30"

To be merged after #547

jaidevd avatar Jun 07 '22 08:06 jaidevd