UNPKG

674 BJavaScriptView Raw
1'use strict';
2
3var expect = require('chai').expect;
4var SigmoidKernel = require('./sigmoid.js');
5
6describe('Kernel.SigmoidKernel', function () {
7 describe('.apply', function () {
8 it('should calculate the Sigmoid kernel with gamma 0.01 and no bias when called with default parameters', function () {
9 expect(new SigmoidKernel().apply([1, 2], [3, 4])).to.closeTo(0.10955847021, 1e-5);
10 });
11
12 it('should correctly calculate the Sigmoid kernel with custom parameters', function () {
13 var kernel = new SigmoidKernel({
14 gamma: 0.1,
15 coef0: 1
16 });
17 expect(kernel.apply([1, 2], [3, 4])).to.closeTo(0.97045193661, 1e-5);
18 });
19 });
20});
\No newline at end of file