2.1.2
Simplified version of the Sequential Minimal Optimization algorithm for training 114 | support vector machines
115 | 116 | 117 |([object])
SVM options
134 |
135 | Name | 145 |Description | 146 |
---|---|
options.C [number]
152 |
153 | (default 1 )
154 | |
155 | regularization parameter 156 | | 157 |
options.tol [number]
161 |
162 | (default 1e-4 )
163 | |
164 | numerical tolerance 165 | | 166 |
options.alphaTol [number]
170 |
171 | (default 1e-6 )
172 | |
173 | alpha tolerance, threshold to decide support vectors 174 | | 175 |
options.maxPasses [number]
179 |
180 | (default 10 )
181 | |
182 | max number of times to iterate over alphas without changing 183 | | 184 |
options.maxIterations [number]
188 |
189 | (default 10000 )
190 | |
191 | max number of iterations 192 | | 193 |
options.kernel [string]
197 |
198 | (default linear )
199 | |
200 | the kind of kernel. 201 | List of kernels 202 | | 203 |
options.random [function]
207 |
208 | (default Math.random )
209 | |
210 | custom random number generator 211 | | 212 |
Create a SVM instance from a saved model
247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 |SVM
:
281 | Instance of svm classifier
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 | Train the SVM model
322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 |Predict the classification outcome of a trained svm given one or several observations' features.
388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 |(Array)
The observation(s)' features
407 |
408 | (Array<number> | number)
:
421 | An array of {-1, 1} if several observations are given or a number if one observation
422 | is given
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 | Returns the margin of one or several observations given its features
455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 |(number | Array)
:
488 | The computed margin. Is an Array if several observations' features given, or a number if
489 | only one observation's features given
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 | Get support vectors indexes of the trained classifier. WARINNG: this method does not work for svm instances 522 | created from load if linear kernel
523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 |Array<number>
:
543 | The indices in the training vector of the support vectors
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 | Export the minimal object that enables to reload the model
576 | 577 | 578 |object
:
596 | Model object that can be reused with
597 | load
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |