Giter VIP home page Giter VIP logo

predictionio-node-sdk's People

Contributors

the8thbit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

predictionio-node-sdk's Issues

recommend and similar use POST instead of GET

hi, at first thanks for this sdk!

i think using POST for retrieving recommendations is the wrong method according to the documentation (the same for similarity). using POST results in a 404 wich is not detected by the tests as there are no checks for correct statusCodes.

Library is fragile in baseUrl configuration

var prediction = require('predictionio')({
    key: 'xxx',//add valid key here
    baseUrl: 'http://127.0.0.1:8000/'
});
prediction.users.get('nonexistinguserid', function (err, res) {
        console.log('err', err);
        console.log('res', res);
});

Results in

null
{}

This is because the request is structured as http://127.0.0.1:8000//users/nonexistinguserid.json with double // and the response of the server is

{ 
  //...
  links: {},
  text: 'Your request is not supported.',
  body: {},
  files: {},
  buffered: true,
  headers: 
   { 'content-type': 'text/plain; charset=utf-8',
     'access-control-allow-origin': '',
     connection: 'close',
     'content-length': '30' },
  header: 
   { 'content-type': 'text/plain; charset=utf-8',
     'access-control-allow-origin': '',
     connection: 'close',
     'content-length': '30' },
  statusCode: 404,
  status: 404,
  statusType: 4,
  info: false,
  ok: false,
  redirect: false,
  clientError: true,
  serverError: false,
  error: 
   { [Error: cannot GET //users/14.json?pio_appkey=xxx (404)]
     status: 404,
     method: 'GET',
     path: '//users/14.json?pio_appkey=xxx'
  }
  //...
}

Doc's for Node.JS Support lacking

any improvement in the near future for node.js in the docs online? noticed md file has some information but surprised to not see it online.

Support for catch? And documentation is incorrect..

A couple of things...

Your documentation here https://github.com/ShaunBaker/PredictionIO-Node-SDK/blob/master/DOCS.md#fetch-user-recommendations

Is missing the pio_engine param. This is required and I didn't realize this until I used the call back method.

Which leads to the second issue, is there .then().catch() support? I see that on the items.recommendation function if there's an error you call defer.reject(err). That stops the process, but the error message is not accessible. Whats the best way to handle errors when using the promise approach?

Why is everything prefixed with `pio`?

Kind of annoying to have to take sane data and run it through a prefixer, then run data that comes back through a prefix removal fn. Why does predictionIO do this? I've never seen anything like it in other dbs

Crashing app when server not found

/Users/joaoribeiro/Documents/Projects/imoglobe/node_modules/predictionio/lib/items.js:26
        deferred.resolve(res.body)
                            ^
TypeError: Cannot read property 'body' of undefined
    at /Users/joaoribeiro/Documents/Projects/imoglobe/node_modules/predictionio/lib/items.js:26:29
    at Request.callback (/Users/joaoribeiro/Documents/Projects/imoglobe/node_modules/predictionio/node_modules/superagent/lib/node/index.js:628:30)
    at ClientRequest.<anonymous> (/Users/joaoribeiro/Documents/Projects/imoglobe/node_modules/predictionio/node_modules/superagent/lib/node/index.js:596:10)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at Socket.socketErrorListener (http.js:1547:9)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)
[nodemon] app crashed - waiting for file changes before starting...

Item Similarity Issue

Hi,
Thanks for starting this project.
I did a npm install for this SDK couple of days back and the version I have is 0.0.4.The implementation of prediction.items.similarity takes in parameter for pio_uid. However, as per the PredictionIO API endpoint specs, this should be pio_iid.

Can you please confirm?

Thanks,
Prakash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.