Ejemplo n.º 1
0
  .on('end', function () {
    console.log('training complete');

    var predict = clf.predict();
    var features = scikit.dataset('load_digits.data');
    features.pipe(slice(-1))
      .pipe(predict)
      .pipe(inspect());
  });
Ejemplo n.º 2
0
var scikit = require('../lib/scikit-learn');

var features = scikit.dataset('load_digits.data');
var labels   = scikit.dataset('load_digits.target');
var trainingSet = arrayify();
features.pipe(trainingSet);
labels.pipe(trainingSet);

var clf = scikit.svm('SVC', {
  gamma: 0.001,
  C:     100
});

trainingSet
  .pipe(slice([0, -1]))
  .pipe(clf)
  .on('error', function (err) {
    console.log(err);
  })
  .on('end', function () {
    console.log('training complete');

    var predict = clf.predict();
    var features = scikit.dataset('load_digits.data');
    features.pipe(slice(-1))
      .pipe(predict)
      .pipe(inspect());
  });