daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Submit dataset
  2. const NexosisClient = require('nexosis-api-client').default;
  3. const client = new NexosisClient({key: process.env.NEXOSIS_API_KEY});
  4. client.DataSets.create('widget-sales', readDataFrom(csvFile));
  5.  
  6. // Create a forecast session
  7. let session = {};
  8. client.Sessions.createForecast(
  9.     'widget-sales',
  10.     moment().startOf('day'),
  11.     moment.startOf('day').add(30, 'days'),
  12.     'sales',
  13.     'day'
  14. ).then(results=>session = results);
  15.  
  16. // Retrieve forecast results
  17. client.Sessions.results(session.sessionId).then(results=>write(results));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top