MAX-Weather-Forecaster icon indicating copy to clipboard operation
MAX-Weather-Forecaster copied to clipboard

Improve API input format

Open MLnick opened this issue 7 years ago • 2 comments

Currently the model can only take in a numpy array of weather data, in txt format, with a specific hard-coded shape (specifically the number of data rows in the input array)

As a user I would like:

  • to be able to post a single "data point" (in this case a data point would be a 12-hour timeframe of data) and receive a single prediction.
  • to post data in a more user-friendly format (i.e. JSON)

For bulk requests we could add a bulk predict endpoint. We could support CSV files rather than (or in addition to) numpy arrays in txt serialized format.

MLnick avatar Sep 17 '18 11:09 MLnick

@MLnick The input size for the three models is: 1) ?*24*12 for univariate model; 2) ?*24*12 for multivariate_model; 3) ?*48*12 for multistep model, where 12 is the number of input variables; 24/48 is for the hour.

For the json input, do you think the following structure will be ok?

{
  "input_data": [
     {"entry_0": [
       {"var0":["values for 24/48 hours"]},
       {"var1":["values for 24/48 hours"]},
       {"var2":["values for 24/48 hours"]},
       {"var3":["values for 24/48 hours"]},
       {"var4":["values for 24/48 hours"]},
       {"var5":["values for 24/48 hours"]},
       {"var6":["values for 24/48 hours"]},
       {"var7":["values for 24/48 hours"]},
       {"var8":["values for 24/48 hours"]},
       {"var9":["values for 24/48 hours"]},
       {"var10":["values for 24/48 hours"]},
       {"var11":["values for 24/48 hours"]}
      ]
     },
    
     ..........
     
     {"entry_n": [
       {"var0":["values for 24/48 hours"]},
       {"var1":["values for 24/48 hours"]},
       {"var2":["values for 24/48 hours"]},
       {"var3":["values for 24/48 hours"]},
       {"var4":["values for 24/48 hours"]},
       {"var5":["values for 24/48 hours"]},
       {"var6":["values for 24/48 hours"]},
       {"var7":["values for 24/48 hours"]},
       {"var8":["values for 24/48 hours"]},
       {"var9":["values for 24/48 hours"]},
       {"var10":["values for 24/48 hours"]},
       {"var11":["values for 24/48 hours"]}
      ]
     }
  ]
}

feihugis avatar Oct 30 '18 18:10 feihugis

Dear, my question is more conceptual. Sorry! I need to be able to predict a climatic behavior for a certain point or polygon, expressed from its latitude and longitude for the first case, or as a ring for the second case. How should I build the entrance? What data should happen to you? Is it necessary for me to send training data as well, about the climatic behavior of the place? or does this project use a trained model with NY data JFK can predict anywhere else? THANK YOU !

diegoromeroacro avatar Jul 05 '19 19:07 diegoromeroacro