1.0.5 • Published 3 years ago

akkio v1.0.5

Weekly downloads
204
License
ISC
Repository
github
Last release
3 years ago

Akkio

Convenient access to the Akkio API from server-side javascript.

Installation

npm install --save akkio

Usage

// get your API key at https://app.akk.io/team-settings
const akkio = require('akkio')('your API key');

(async () => {
  // create a new dataset
  let newDataset = await akkio.createDataset('my new dataset');

  // populate it with some toy data
  let rows = [];
  for (var i = 0; i < 1000; i++) {
    let x = Math.random();
    rows.push({
      'x': x,
      'value larger than 0.5': x > 0.5,
    });
  }
  await akkio.addRowsToDataset(newDataset.dataset_id, rows);

  // train a model
  let model = await akkio.createModel(newDataset.dataset_id, ['value larger than 0.5'], [], {
    duration: 1
  });

  // field importance
  for (let field in model.field_importance) {
    console.log('field:', field, 'importance:', model.field_importance[field]);
  }

  // model stats
  for (let field of model.stats) {
    for (let outcome of field) {
      console.log(outcome);
    }
  }

  // use the trained model to make predictions
  let predictions = await akkio.makePrediction(model.model_id, [{
    'x': 0.25
  }, {
    'x': 0.75
  }], {
    explain: true
  });
  console.log(predictions);

})();
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago