Skip to content

Commit

Permalink
Added import model from JSON to handle multiple models (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedecia authored and serendipious committed Jun 29, 2016
1 parent 1943a3b commit a60d381
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/decision-tree.js
Expand Up @@ -82,6 +82,13 @@ module.exports = (function() {

return correct / total;
},

/**
* Imports a previously saved model with the toJSON() method
*/
import: function(json) {
model = json;
},

/**
* Returns JSON representation of trained model
Expand Down

0 comments on commit a60d381

Please sign in to comment.