oryql
v0.0.0-16
Published
oryql adaptive structures
Downloads
11
Readme
oryql
label
Usage
// create a labeller
var spam_filter = label();
// train the labeller
spam_filter.learn('getchyoself a bigga prick mate!', ['spam', 'adult']);
spam_filter.learn('get m3dz! h3r3!', ['spam', 'pharmacy']);
// use the labeller
console.log(spam_filter.label('m3dz free!'));
Output
[ {"label": "pharmacy", "score": 2},
{"label": "spam", "score": 1},
{"label": "adult", "score": 0} ]
path
Usage
// create a path learner
var path_learner = path();
// perform a training run, by providing the state hash and choices from that state
path_learner.explore('A', ['forward', 'backward']);
path_learner.explore('B', ['forward', 'backward']);
// upon completion of training run, provide feedback, repeat until stable
path_learner.feedback(10);
// get optimal choice using perfom, use the same way you would explore
path_learner.perform('A', ['forward', 'backward']);
// upon completion of performance run, provide feedback
path_learner.feedback(10);
Output
(none)