svm-light
v2.0.0
Published
svm-light multiclass wrapper, http://www.cs.cornell.edu/people/tj/svm_light/svm_multiclass.html
Downloads
2
Readme
SVM Light Multiclass Wrapper for Node.js
Installation
npm install --save svm-light
How To Use
- learn & classify function available. All the functions are promise object. See below.
- example are here
let {learn, classify} = require('svm-light');
learn({
// file path for input, model
input: 'train.dat',
model: 'model.dat',
// on stream process data in here
data: (data)=> {
console.log(data + '');
},
// on error here
error: (err)=> {
console.log(err + '');
},
}).then(()=> {
// if finished, something do in here!
});
classify({
// file path for input, model, result
input: 'test.txt',
model: 'model.dat',
result: 'result.txt',
// on stream data in here
data: (data)=> {
console.log(data + '');
},
// on error here
error: (err)=> {
console.log(err + '');
}
}).then(()=> {
// if finished, something do in here!
})
Using Options in Training
- available options
c
: default 0.01v
: default 1y
: default 0p
: default 1o
: default 2- more detail info in here
let {learn, classify} = require('svm-light');
learn({
input: 'yeast_4.txt',
model: 'model.dat',
// apply options like this
c: 500,
v: 1,
data: (data)=> {
console.log(data + '');
},
error: (err)=> {
console.log(err + '');
},
}).then(()=> {
// if finished, something do in here!
});