0.0.0-16 • Published 11 years ago

oryql v0.0.0-16

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

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)
0.0.0-16

11 years ago

0.0.0-15

11 years ago

0.0.0-13

11 years ago

0.0.0-12

11 years ago

0.0.0-10

11 years ago

0.0.0-8

11 years ago

0.0.0-6

11 years ago

0.0.0-4

11 years ago

0.0.0-3

11 years ago