Commit fe9c3c27 authored by André Anjos's avatar André Anjos 💬

Implement enumerations; Moving testing code and data

parent 64891fa9
include LICENSE README.rst bootstrap.py buildout.cfg include LICENSE README.rst bootstrap.py buildout.cfg
recursive-include doc conf.py *.rst recursive-include doc conf.py *.rst
recursive-include xbob/learn/svm *.cpp *.h recursive-include xbob/learn/libsvm *.cpp *.h
recursive-include xbob/learn/svm/data *.* recursive-include xbob/learn/svm/data *.*
...@@ -67,4 +67,24 @@ LIBSVM File Interface ...@@ -67,4 +67,24 @@ LIBSVM File Interface
Checks if the input object ``o`` is a ``PyBobLearnLibsvmFileObject``. Checks if the input object ``o`` is a ``PyBobLearnLibsvmFileObject``.
Returns ``1`` if it is, and ``0`` otherwise. Returns ``1`` if it is, and ``0`` otherwise.
LIBSVM Machine Interface
------------------------
.. cpp:type:: PyBobLearnLibsvmMachineObject
The pythonic object representation for a ``bob::learn::libsvm::Machine``
object.
.. code-block:: cpp
typedef struct {
PyObject_HEAD
bob::learn::libsvm::Machine* cxx;
} PyBobLearnLibsvmMachineObject
.. cpp:member:: bob::learn::libsvm::Machine* cxx
A pointer to the C++ file implementation.
.. include:: links.rst .. include:: links.rst
...@@ -17,7 +17,7 @@ include_dirs = [ ...@@ -17,7 +17,7 @@ include_dirs = [
xbob.io.get_include(), xbob.io.get_include(),
] ]
packages = [] packages = ['bob-core >= 1.2.2', 'bob-io >= 1.2.2']
version = '2.0.0a0' version = '2.0.0a0'
# process libsvm requirement # process libsvm requirement
...@@ -195,6 +195,8 @@ setup( ...@@ -195,6 +195,8 @@ setup(
), ),
Extension("xbob.learn.libsvm._library", Extension("xbob.learn.libsvm._library",
[ [
"xbob/learn/libsvm/pymachine.cpp",
"xbob/learn/libsvm/main.cpp",
"xbob/learn/libsvm/file.cpp", "xbob/learn/libsvm/file.cpp",
"xbob/learn/libsvm/machine.cpp", "xbob/learn/libsvm/machine.cpp",
"xbob/learn/libsvm/trainer.cpp", "xbob/learn/libsvm/trainer.cpp",
......
from ._library import *
from . import version from . import version
from .version import module as __version__ from .version import module as __version__
from .version import api as __api_version__ from .version import api as __api_version__
......
labels 1 -1
1 0.903779 0.0962213
-1 0.377605 0.622395
-1 0.226042 0.773958
1 0.929688 0.0703117
-1 0.166207 0.833793
-1 0.448552 0.551448
1 0.862331 0.137669
1 0.958139 0.0418607
1 0.939599 0.0604013
1 0.882677 0.117323
1 0.576141 0.423859
1 0.885033 0.114967
-1 0.122875 0.877125
-1 0.386002 0.613998
-1 0.167482 0.832518
-1 0.166401 0.833599
1 0.969844 0.0301564
1 0.889697 0.110303
-1 0.166318 0.833682
-1 0.26817 0.73183
1 0.980719 0.0192814
-1 0.0918775 0.908123
-1 0.166238 0.833762
-1 0.166243 0.833757
-1 0.166271 0.833729
-1 0.0571237 0.942876
-1 0.215994 0.784006
-1 0.0632425 0.936758
1 0.830202 0.169798
-1 0.166277 0.833723
1 0.833483 0.166517
1 0.694735 0.305265
-1 0.0430658 0.956934
1 0.928065 0.0719346
1 0.924444 0.0755563
1 0.933169 0.0668313
1 0.947777 0.052223
-1 0.1484 0.8516
-1 0.105137 0.894863
-1 0.168529 0.831471
-1 0.429135 0.570865
-1 0.0619362 0.938064
-1 0.155091 0.844909
-1 0.0985838 0.901416
-1 0.452962 0.547038
-1 0.108179 0.891821
1 0.757799 0.242201
-1 0.351846 0.648154
1 0.862328 0.137672
1 0.897424 0.102576
1 0.86232 0.13768
-1 0.0366367 0.963363
-1 0.166201 0.833799
-1 0.111971 0.888029
-1 0.0481735 0.951826
-1 0.0553659 0.944634
1 0.860445 0.139555
-1 0.0971654 0.902835
-1 0.385035 0.614965
1 0.791031 0.208969
-1 0.223716 0.776284
1 0.826734 0.173266
-1 0.0836514 0.916349
-1 0.042177 0.957823
-1 0.188198 0.811802
1 0.957933 0.0420675
-1 0.309101 0.690899
-1 0.179012 0.820988
-1 0.137011 0.862989
-1 0.101045 0.898955
1 0.94785 0.0521496
-1 0.180933 0.819067
-1 0.16626 0.83374
-1 0.144976 0.855024
-1 0.221753 0.778247
1 0.978286 0.0217141
1 0.551407 0.448593
-1 0.0380896 0.96191
-1 0.0588789 0.941121
-1 0.0654508 0.934549
1 0.871968 0.128032
1 0.866423 0.133577
1 0.901426 0.0985737
-1 0.181619 0.818381
1 0.814131 0.185869
-1 0.238939 0.761061
-1 0.100581 0.899419
-1 0.407153 0.592847
-1 0.0368445 0.963156
1 0.862408 0.137592
-1 0.121017 0.878983
-1 0.0863495 0.91365
1 0.97307 0.0269296
1 0.788335 0.211665
1 0.782622 0.217378
1 0.793466 0.206534
-1 0.309357 0.690643
1 0.609418 0.390582
-1 0.219696 0.780304
-1 0.0389001 0.9611
-1 0.0601384 0.939862
-1 0.48731 0.51269
-1 0.0648546 0.935145
1 0.902348 0.0976522
1 0.912682 0.0873181
1 0.771274 0.228726
-1 0.299954 0.700046
1 0.862262 0.137738
1 0.836411 0.163589
-1 0.0591877 0.940812
1 0.600814 0.399186
-1 0.0724698 0.92753
-1 0.108254 0.891746
-1 0.0540287 0.945971
-1 0.068833 0.931167
-1 0.0535065 0.946494
1 0.767755 0.232245
1 0.9267 0.0733002
-1 0.16625 0.83375
1 0.909066 0.0909342
1 0.88594 0.11406
1 0.929476 0.070524
1 0.949615 0.0503846
-1 0.0956299 0.90437
-1 0.386444 0.613556
-1 0.095219 0.904781
1 0.965845 0.0341554
-1 0.0702772 0.929723
-1 0.153882 0.846118
1 0.862349 0.137651
1 0.637296 0.362704
1 0.691761 0.308239
-1 0.119768 0.880232
1 0.86239 0.13761
1 0.606543 0.393457
-1 0.193916 0.806084
-1 0.0884042 0.911596
1 0.753473 0.246527
-1 0.0334486 0.966551
1 0.694024 0.305976
1 0.945754 0.0542458
-1 0.187251 0.812749
1 0.649493 0.350507
-1 0.247421 0.752579
1 0.560051 0.439949
1 0.969275 0.0307248
-1 0.262092 0.737908
1 0.919706 0.0802938
1 0.871586 0.128414
-1 0.0720696 0.92793
-1 0.0751859 0.924814
-1 0.0839729 0.916027
-1 0.0523988 0.947601
-1 0.482868 0.517132
-1 0.0699624 0.930038
-1 0.0308645 0.969135
1 0.918488 0.0815123
-1 0.0968823 0.903118
-1 0.317033 0.682967
1 0.884695 0.115305
-1 0.44621 0.55379
-1 0.392477 0.607523
-1 0.078436 0.921564
1 0.983597 0.0164026
-1 0.437791 0.562209
-1 0.255563 0.744437
-1 0.0842028 0.915797
-1 0.16637 0.83363
-1 0.220083 0.779917
-1 0.134672 0.865328
-1 0.171497 0.828503
1 0.939241 0.0607589
1 0.897454 0.102546
-1 0.146519 0.853481
-1 0.0678458 0.932154
1 0.63396 0.36604
1 0.975164 0.0248362
-1 0.254629 0.745371
1 0.651847 0.348153
-1 0.0913843 0.908616
-1 0.23761 0.76239
1 0.936172 0.0638285
1 0.71283 0.28717
-1 0.154668 0.845332
-1 0.415203 0.584797
-1 0.23255 0.76745
1 0.962696 0.037304
1 0.634597 0.365403
-1 0.155025 0.844975
1 0.922229 0.0777715
-1 0.169184 0.830816
1 0.891035 0.108965
-1 0.195339 0.804661
1 0.846192 0.153808
-1 0.166186 0.833814
-1 0.0644495 0.93555
-1 0.166221 0.833779
-1 0.0810207 0.918979
-1 0.14606 0.85394
1 0.862331 0.137669
1 0.514115 0.485885
1 0.904602 0.0953984
1 0.968687 0.0313134
1 0.782632 0.217368
1 0.964133 0.0358671
-1 0.110921 0.889079
-1 0.0744968 0.925503
1 0.789758 0.210242
1 0.806098 0.193902
-1 0.181497 0.818503
-1 0.350009 0.649991
-1 0.157617 0.842383
-1 0.0647532 0.935247
1 0.984756 0.0152435
-1 0.0687194 0.931281
-1 0.0477033 0.952297
-1 0.0588076 0.941192
1 0.688166 0.311834
1 0.670441 0.329559
-1 0.0608438 0.939156
1 0.944905 0.0550945
1 0.931354 0.0686459
-1 0.110458 0.889542
1 0.955915 0.0440851
-1 0.0767685 0.923232
-1 0.26908 0.73092
1 0.608546 0.391454
1 0.862329 0.137671
-1 0.0635569 0.936443
-1 0.166391 0.833609
1 0.823178 0.176822
1 0.66717 0.33283
-1 0.16948 0.83052
1 0.848262 0.151738
1 0.878825 0.121175
1 0.879781 0.120219
-1 0.0937088 0.906291
1 0.928563 0.0714369
-1 0.16358 0.83642
-1 0.0669999 0.933
1 0.837427 0.162573
-1 0.123471 0.876529
-1 0.138952 0.861048
1 0.584773 0.415227
-1 0.166305 0.833695
1 0.88988 0.11012
1 0.882368 0.117632
-1 0.0687586 0.931241
-1 0.273414 0.726586
1 0.983022 0.0169785
1 0.849726 0.150274
-1 0.0773389 0.922661
-1 0.433947 0.566053
-1 0.15361 0.84639
-1 0.0841517 0.915848
-1 0.151726 0.848274
-1 0.33234 0.66766
1 0.942238 0.0577619
-1 0.115781 0.884219
-1 0.159824 0.840176
-1 0.0412549 0.958745
1 0.982171 0.0178292
-1 0.149185 0.850815
-1 0.0684107 0.931589
-1 0.352538 0.647462
-1 0.166313 0.833687
-1 0.179813 0.820187
-1 0.0718384 0.928162
1 0.506185 0.493815
1 0.948474 0.0515257
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
labels 1 2 3
1 0.981123 0.01167 0.0072068
1 0.96646 0.0251155 0.00842454
1 0.979467 0.0135917 0.00694156
1 0.972242 0.0197053 0.00805233
1 0.983337 0.00973127 0.0069319
1 0.968523 0.019756 0.0117207
1 0.979235 0.0131993 0.00756543
1 0.978338 0.0140879 0.00757421
1 0.96657 0.0248327 0.00859726
1 0.974335 0.0180316 0.00763342
1 0.978896 0.0127284 0.00837584
1 0.978156 0.0141329 0.00771066
1 0.973827 0.0186652 0.00750769
1 0.981867 0.0115425 0.0065902
1 0.978849 0.0116797 0.00947118
1 0.967469 0.0183504 0.0141802
1 0.977042 0.0135294 0.00942881
1 0.977374 0.0146197 0.00800671
1 0.965299 0.0224307 0.0122704
1 0.980155 0.0115595 0.00828506
1 0.966379 0.0235864 0.0100348
1 0.974759 0.0159385 0.00930289
1 0.988489 0.00581072 0.00570067
1 0.938405 0.0479975 0.013597
1 0.970619 0.0200596 0.00932108
1 0.956204 0.0340437 0.00975207
1 0.96381 0.0259512 0.010239
1 0.97825 0.0138706 0.00787957
1 0.97791 0.0144375 0.00765295
1 0.972772 0.0190377 0.00818989
1 0.966894 0.024374 0.00873246
1 0.957793 0.0308764 0.0113303
1 0.984245 0.00782321 0.00793168
1 0.980252 0.0103125 0.0094356
1 0.974335 0.0180316 0.00763342
1 0.978726 0.0143057 0.00696798
1 0.977483 0.0143526 0.00816441
1 0.974335 0.0180316 0.00763342
1 0.974311 0.0179971 0.00769142
1 0.977186 0.0150102 0.00780393
1 0.980238 0.0123825 0.0073794
1 0.872978 0.112382 0.0146401
1 0.980647 0.0123508 0.00700241
1 0.948468 0.0380685 0.0134637
1 0.966181 0.0219465 0.0118728
1 0.959969 0.0307995 0.00923102
1 0.981621 0.0104423 0.00793676
1 0.978167 0.0145576 0.00727523
1 0.980206 0.0117837 0.00801075
1 0.977729 0.0148632 0.00740815
2 0.0157092 0.944561 0.0397302
2 0.0122741 0.943323 0.0444029
2 0.01049 0.829189 0.160321
2 0.00527597 0.967923 0.0268014
2 0.00628446 0.870438 0.123278
2 0.00687766 0.971568 0.0215548
2 0.0128093 0.847271 0.139919
2 0.038695 0.952032 0.00927259
2 0.00829628 0.972305 0.0193986
2 0.0100997 0.96802 0.0218804
2 0.0150816 0.976131 0.0087869
2 0.00931029 0.958767 0.0319231
2 0.00653361 0.989601 0.00386582
2 0.00652073 0.935269 0.0582103
2 0.0205033 0.973622 0.00587436
2 0.0128229 0.968201 0.0189758
2 0.00902272 0.915109 0.0758687
2 0.0146286 0.981859 0.00351212
2 0.00752357 0.682538 0.309938
2 0.00972387 0.986241 0.00403559
3 0.0146616 0.360406 0.624933
2 0.00914485 0.984893 0.00596203
2 0.00742612 0.594544 0.39803
2 0.006748 0.979352 0.0139004
2 0.00927547 0.981712 0.0090121
2 0.00991155 0.968346 0.0217421
2 0.00671069 0.898693 0.0945968
3 0.0101526 0.343545 0.646303
2 0.0068422 0.911157 0.0820011
2 0.025599 0.96852 0.00588126
2 0.00954381 0.985915 0.00454087
2 0.0142356 0.981712 0.00405202
2 0.0105403 0.985344 0.00411574
3 0.00972621 0.328134 0.66214
2 0.0101067 0.906392 0.0835011
2 0.0177248 0.908807 0.0734679
2 0.00990826 0.8971 0.0929917
2 0.00402061 0.949638 0.0463411
2 0.0153442 0.977238 0.00741749
2 0.00630293 0.9779 0.0157967
2 0.00647711 0.979209 0.0143138
2 0.00811138 0.9556 0.0362888
2 0.00779685 0.986999 0.00520406
2 0.0290743 0.963301 0.007625
2 0.00717607 0.978758 0.0140661
2 0.0168038 0.977796 0.00540014
2 0.0105278 0.980512 0.00896068
2 0.00902726 0.981872 0.00910106
2 0.0452889 0.944595 0.0101164
2 0.00912812 0.982189 0.00868338
3 0.00759949 0.000432484 0.991968
3 0.00949742 0.0292074 0.961295
3 0.00639693 0.00185472 0.991748
3 0.00780624 0.0288395 0.963354
3 0.00591113 0.000903203 0.993186
3 0.0075668 0.00097646 0.991457
3 0.0214431 0.313569 0.664988
3 0.00707701 0.00652935 0.986394
3 0.00632409 0.00905496 0.984621
3 0.0109153 0.00130665 0.987778
3 0.0102792 0.0392358 0.950485
3 0.00723535 0.0181048 0.97466
3 0.00676909 0.00406439 0.989167
3 0.00895935 0.0111213 0.979919
3 0.00766268 0.000813238 0.991524
3 0.00815625 0.00228344 0.98956
3 0.00866419 0.0472161 0.94412
3 0.0149595 0.00379917 0.981241
3 0.00872418 0.00057752 0.990698
3 0.0102283 0.353316 0.636456
3 0.00714881 0.00113644 0.991715
3 0.0112685 0.0261878 0.962544
3 0.00792585 0.00119361 0.990881
3 0.00942326 0.122548 0.868029
3 0.00801213 0.0049786 0.987009
3 0.00852726 0.0219752 0.969497
3 0.0103488 0.185918 0.803733
3 0.0114706 0.211853 0.776676
3 0.0058537 0.00188179 0.992265
3 0.00958802 0.118267 0.872145
3 0.00699503 0.00437116 0.988634
3 0.0171458 0.0130162 0.969838
3 0.0056834 0.000910518 0.993406
2 0.00782525 0.6177 0.374474
3 0.00885009 0.377371 0.613779
3 0.0083119 0.000952571 0.990736
3 0.00908152 0.00123957 0.989679
3 0.00967692 0.0583711 0.931952
3 0.012192 0.261694 0.726114
3 0.00761095 0.00675033 0.985639
3 0.00673402 0.000610388 0.992656
3 0.00823594 0.00331425 0.98845
3 0.00949742 0.0292074 0.961295
3 0.00672381 0.000763815 0.992512
3 0.00793357 0.000627486 0.991439
3 0.00722087 0.00192118 0.990858
3 0.00822406 0.0278372 0.963939
3 0.0081575 0.0189395 0.972903
3 0.0100718 0.00320389 0.986724
3 0.0115565 0.130434 0.85801
1 1:-0.555556 2:0.25 3:-0.864407 4:-0.916667
1 1:-0.666667 2:-0.166667 3:-0.864407 4:-0.916667
1 1:-0.777778 3:-0.898305 4:-0.916667
1 1:-0.833333 2:-0.0833334 3:-0.830508 4:-0.916667
1 1:-0.611111 2:0.333333 3:-0.864407 4:-0.916667
1 1:-0.388889 2:0.583333 3:-0.762712 4:-0.75
1 1:-0.833333 2:0.166667 3:-0.864407 4:-0.833333
1 1:-0.611111 2:0.166667 3:-0.830508 4:-0.916667
1 1:-0.944444 2:-0.25 3:-0.864407 4:-0.916667
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
1 1:-0.388889 2:0.416667 3:-0.830508 4:-0.916667
1 1:-0.722222 2:0.166667 3:-0.79661 4:-0.916667
1 1:-0.722222 2:-0.166667 3:-0.864407 4:-1
1 1:-1 2:-0.166667 3:-0.966102 4:-1
1 1:-0.166667 2:0.666667 3:-0.932203 4:-0.916667
1 1:-0.222222 2:1 3:-0.830508 4:-0.75
1 1:-0.388889 2:0.583333 3:-0.898305 4:-0.75
1 1:-0.555556 2:0.25 3:-0.864407 4:-0.833333
1 1:-0.222222 2:0.5 3:-0.762712 4:-0.833333
1 1:-0.555556 2:0.5 3:-0.830508 4:-0.833333
1 1:-0.388889 2:0.166667 3:-0.762712 4:-0.916667
1 1:-0.555556 2:0.416667 3:-0.830508 4:-0.75
1 1:-0.833333 2:0.333333 3:-1 4:-0.916667
1 1:-0.555556 2:0.0833333 3:-0.762712 4:-0.666667
1 1:-0.722222 2:0.166667 3:-0.694915 4:-0.916667
1 1:-0.611111 2:-0.166667 3:-0.79661 4:-0.916667
1 1:-0.611111 2:0.166667 3:-0.79661 4:-0.75
1 1:-0.5 2:0.25 3:-0.830508 4:-0.916667
1 1:-0.5 2:0.166667 3:-0.864407 4:-0.916667
1 1:-0.777778 3:-0.79661 4:-0.916667
1 1:-0.722222 2:-0.0833334 3:-0.79661 4:-0.916667
1 1:-0.388889 2:0.166667 3:-0.830508 4:-0.75
1 1:-0.5 2:0.75 3:-0.830508 4:-1
1 1:-0.333333 2:0.833333 3:-0.864407 4:-0.916667
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
1 1:-0.611111 3:-0.932203 4:-0.916667
1 1:-0.333333 2:0.25 3:-0.898305 4:-0.916667
1 1:-0.666667 2:-0.0833334 3:-0.830508 4:-1
1 1:-0.944444 2:-0.166667 3:-0.898305 4:-0.916667
1 1:-0.555556 2:0.166667 3:-0.830508 4:-0.916667
1 1:-0.611111 2:0.25 3:-0.898305 4:-0.833333
1 1:-0.888889 2:-0.75 3:-0.898305 4:-0.833333
1 1:-0.944444 3:-0.898305 4:-0.916667
1 1:-0.611111 2:0.25 3:-0.79661 4:-0.583333
1 1:-0.555556 2:0.5 3:-0.694915 4:-0.75
1 1:-0.722222 2:-0.166667 3:-0.864407 4:-0.833333
1 1:-0.555556 2:0.5 3:-0.79661 4:-0.916667
1 1:-0.833333 3:-0.864407 4:-0.916667
1 1:-0.444444 2:0.416667 3:-0.830508 4:-0.916667
1 1:-0.611111 2:0.0833333 3:-0.864407 4:-0.916667
2 1:0.5 3:0.254237 4:0.0833333
2 1:0.166667 3:0.186441 4:0.166667
2 1:0.444444 2:-0.0833334 3:0.322034 4:0.166667
2 1:-0.333333 2:-0.75 3:0.0169491 4:-4.03573e-08
2 1:0.222222 2:-0.333333 3:0.220339 4:0.166667
2 1:-0.222222 2:-0.333333 3:0.186441 4:-4.03573e-08
2 1:0.111111 2:0.0833333 3:0.254237 4:0.25
2 1:-0.666667 2:-0.666667 3:-0.220339 4:-0.25
2 1:0.277778 2:-0.25 3:0.220339 4:-4.03573e-08
2 1:-0.5 2:-0.416667 3:-0.0169491 4:0.0833333
2 1:-0.611111 2:-1 3:-0.152542 4:-0.25
2 1:-0.111111 2:-0.166667 3:0.0847457 4:0.166667
2 1:-0.0555556 2:-0.833333 3:0.0169491 4:-0.25
2 1:-1.32455e-07 2:-0.25 3:0.254237 4:0.0833333
2 1:-0.277778 2:-0.25 3:-0.118644 4:-4.03573e-08
2 1:0.333333 2:-0.0833334 3:0.152542 4:0.0833333
2 1:-0.277778 2:-0.166667 3:0.186441 4:0.166667
2 1:-0.166667 2:-0.416667 3:0.0508474 4:-0.25
2 1:0.0555554 2:-0.833333 3:0.186441 4:0.166667
2 1:-0.277778 2:-0.583333 3:-0.0169491 4:-0.166667
2 1:-0.111111 3:0.288136 4:0.416667
2 1:-1.32455e-07 2:-0.333333 3:0.0169491 4:-4.03573e-08
2 1:0.111111 2:-0.583333 3:0.322034 4:0.166667
2 1:-1.32455e-07 2:-0.333333 3:0.254237 4:-0.0833333
2 1:0.166667 2:-0.25 3:0.118644 4:-4.03573e-08
2 1:0.277778 2:-0.166667 3:0.152542 4:0.0833333
2 1:0.388889 2:-0.333333 3:0.288136 4:0.0833333
2 1:0.333333 2:-0.166667 3:0.355932 4:0.333333
2 1:-0.0555556 2:-0.25 3:0.186441 4:0.166667
2 1:-0.222222 2:-0.5 3:-0.152542 4:-0.25
2 1:-0.333333 2:-0.666667 3:-0.0508475 4:-0.166667
2 1:-0.333333 2:-0.666667 3:-0.0847458 4:-0.25
2 1:-0.166667 2:-0.416667 3:-0.0169491 4:-0.0833333
2 1:-0.0555556 2:-0.416667 3:0.38983 4:0.25
2 1:-0.388889 2:-0.166667 3:0.186441 4:0.166667
2 1:-0.0555556 2:0.166667 3:0.186441 4:0.25
2 1:0.333333 2:-0.0833334 3:0.254237 4:0.166667
2 1:0.111111 2:-0.75 3:0.152542 4:-4.03573e-08
2 1:-0.277778 2:-0.166667 3:0.0508474 4:-4.03573e-08
2 1:-0.333333 2:-0.583333 3:0.0169491 4:-4.03573e-08
2 1:-0.333333 2:-0.5 3:0.152542 4:-0.0833333
2 1:-1.32455e-07 2:-0.166667 3:0.220339 4:0.0833333
2 1:-0.166667 2:-0.5 3:0.0169491 4:-0.0833333
2 1:-0.611111 2:-0.75 3:-0.220339 4:-0.25
2 1:-0.277778 2:-0.416667 3:0.0847457 4:-4.03573e-08
2 1:-0.222222 2:-0.166667 3:0.0847457 4:-0.0833333
2 1:-0.222222 2:-0.25 3:0.0847457 4:-4.03573e-08
2 1:0.0555554 2:-0.25 3:0.118644 4:-4.03573e-08
2 1:-0.555556 2:-0.583333 3:-0.322034 4:-0.166667
2 1:-0.222222 2:-0.333333 3:0.0508474 4:-4.03573e-08
3 1:0.111111 2:0.0833333 3:0.694915 4:1
3 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
3 1:0.555555 2:-0.166667 3:0.661017 4:0.666667
3 1:0.111111 2:-0.25 3:0.559322 4:0.416667
3 1:0.222222 2:-0.166667 3:0.627119 4:0.75
3 1:0.833333 2:-0.166667 3:0.898305 4:0.666667
3 1:-0.666667 2:-0.583333 3:0.186441 4:0.333333
3 1:0.666667 2:-0.25 3:0.79661 4:0.416667
3 1:0.333333 2:-0.583333 3:0.627119 4:0.416667
3 1:0.611111 2:0.333333 3:0.728813 4:1
3 1:0.222222 3:0.38983 4:0.583333
3 1:0.166667 2:-0.416667 3:0.457627 4:0.5
3 1:0.388889 2:-0.166667 3:0.525424 4:0.666667
3 1:-0.222222 2:-0.583333 3:0.355932 4:0.583333
3 1:-0.166667 2:-0.333333 3:0.38983 4:0.916667
3 1:0.166667 3:0.457627 4:0.833333
3 1:0.222222 2:-0.166667 3:0.525424 4:0.416667
3 1:0.888889 2:0.5 3:0.932203 4:0.75
3 1:0.888889 2:-0.5 3:1 4:0.833333
3 1:-0.0555556 2:-0.833333 3:0.355932 4:0.166667
3 1:0.444444 3:0.59322 4:0.833333
3 1:-0.277778 2:-0.333333 3:0.322034 4:0.583333
3 1:0.888889 2:-0.333333 3:0.932203 4:0.583333
3 1:0.111111 2:-0.416667 3:0.322034 4:0.416667
3 1:0.333333 2:0.0833333 3:0.59322 4:0.666667
3 1:0.611111 3:0.694915 4:0.416667
3 1:0.0555554 2:-0.333333 3:0.288136 4:0.416667
3 1:-1.32455e-07 2:-0.166667 3:0.322034 4:0.416667
3 1:0.166667 2:-0.333333 3:0.559322 4:0.666667
3 1:0.611111 2:-0.166667 3:0.627119 4:0.25
3 1:0.722222 2:-0.333333 3:0.728813 4:0.5
3 1:1 2:0.5 3:0.830508 4:0.583333
3 1:0.166667 2:-0.333333 3:0.559322 4:0.75
3 1:0.111111 2:-0.333333 3:0.38983 4:0.166667
3 1:-1.32455e-07 2:-0.5 3:0.559322 4:0.0833333
3 1:0.888889 2:-0.166667 3:0.728813 4:0.833333
3 1:0.111111 2:0.166667 3:0.559322 4:0.916667
3 1:0.166667 2:-0.0833334 3:0.525424 4:0.416667
3 1:-0.0555556 2:-0.166667 3:0.288136 4:0.416667
3 1:0.444444 2:-0.0833334 3:0.491525 4:0.666667
3 1:0.333333 2:-0.0833334 3:0.559322 4:0.916667
3 1:0.444444 2:-0.0833334 3:0.38983 4:0.833333
3 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
3 1:0.388889 3:0.661017 4:0.833333
3 1:0.333333 2:0.0833333 3:0.59322 4:1
3 1:0.333333 2:-0.166667 3:0.423729 4:0.833333
3 1:0.111111 2:-0.583333 3:0.355932 4:0.5
3 1:0.222222 2:-0.166667 3:0.423729 4:0.583333
3 1:0.0555554 2:0.166667 3:0.491525 4:0.833333
3 1:-0.111111 2:-0.166667 3:0.38983 4:0.416667
svm_type c_svc
kernel_type rbf
gamma 0.25
nr_class 3
total_sv 58
rho -0.0620413 0.0160067 0.105572
label 1 2 3
probA -3.45425 -3.50335 -4.16331
probB -0.0236386 -0.0234692 0.335123
nr_sv 7 28 23
SV
0 0.6558482158175761 1:-0.222222 2:1 3:-0.830508 4:-0.75
1 0.7561731159868541 1:-0.555556 2:0.0833333 3:-0.762712 4:-0.666667
1 0 1:-0.611111 2:-0.166667 3:-0.79661 4:-0.916667
0.02705630804452891 0 1:-0.388889 2:0.166667 3:-0.830508 4:-0.75
1 1 1:-0.888889 2:-0.75 3:-0.898305 4:-0.833333
1 0 1:-0.611111 2:0.25 3:-0.79661 4:-0.583333
0.6013914532393592 0 1:-0.722222 2:-0.166667 3:-0.864407 4:-0.833333
-0 1 1:0.5 3:0.254237 4:0.0833333
-0 1 1:0.166667 3:0.186441 4:0.166667
-0 1 1:0.444444 2:-0.0833334 3:0.322034 4:0.166667
-0 1 1:-0.333333 2:-0.75 3:0.0169491 4:-4.03573e-08
-0 1 1:0.222222 2:-0.333333 3:0.220339 4:0.166667
-0 0.7481858240405803 1:-0.222222 2:-0.333333 3:0.186441 4:-4.03573e-08
-0 1 1:0.111111 2:0.0833333 3:0.254237 4:0.25
-1 0 1:-0.666667 2:-0.666667 3:-0.220339 4:-0.25
-0 1 1:-0.111111 2:-0.166667 3:0.0847457 4:0.166667
-0 1 1:-1.32455e-07 2:-0.25 3:0.254237 4:0.0833333
-0.628447761283888 0 1:-0.277778 2:-0.25 3:-0.118644 4:-4.03573e-08
-0 1 1:-0.277778 2:-0.166667 3:0.186441 4:0.166667
-0 1 1:0.0555554 2:-0.833333 3:0.186441 4:0.166667
-0 1 1:-0.111111 3:0.288136 4:0.416667
-0 1 1:0.111111 2:-0.583333 3:0.322034 4:0.166667
-0 0.6242857061443716 1:0.277778 2:-0.166667 3:0.152542 4:0.0833333
-0 1 1:0.388889 2:-0.333333 3:0.288136 4:0.0833333
-0 1 1:0.333333 2:-0.166667 3:0.355932 4:0.333333
-0 1 1:-0.0555556 2:-0.25 3:0.186441 4:0.166667
-1 0 1:-0.222222 2:-0.5 3:-0.152542 4:-0.25
-0 1 1:-0.0555556 2:-0.416667 3:0.38983 4:0.25
-0 1 1:-0.388889 2:-0.166667 3:0.186441 4:0.166667
-0 1 1:-0.0555556 2:0.166667 3:0.186441 4:0.25
-0 1 1:0.333333 2:-0.0833334 3:0.254237 4:0.166667
-0 1 1:0.111111 2:-0.75 3:0.152542 4:-4.03573e-08
-0 1 1:-1.32455e-07 2:-0.166667 3:0.220339 4:0.0833333
-1 0 1:-0.611111 2:-0.75 3:-0.220339 4:-0.25
-1 0 1:-0.555556 2:-0.583333 3:-0.322034 4:-0.166667
-0 -1 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
-0 -1 1:0.111111 2:-0.25 3:0.559322 4:0.416667
-1 -1 1:-0.666667 2:-0.583333 3:0.186441 4:0.333333
-0 -1 1:0.222222 3:0.38983 4:0.583333
-0 -1 1:0.166667 2:-0.416667 3:0.457627 4:0.5
-0 -0.9285834693444339 1:-0.222222 2:-0.583333 3:0.355932 4:0.583333
-0 -1 1:0.222222 2:-0.166667 3:0.525424 4:0.416667
-0.513609902052525 -1 1:-0.0555556 2:-0.833333 3:0.355932 4:0.166667
-0 -1 1:-0.277778 2:-0.333333 3:0.322034 4:0.583333
-0 -1 1:0.111111 2:-0.416667 3:0.322034 4:0.416667
-0 -1 1:0.611111 3:0.694915 4:0.416667
-0 -1 1:0.0555554 2:-0.333333 3:0.288136 4:0.416667
-0 -1 1:-1.32455e-07 2:-0.166667 3:0.322034 4:0.416667
-0 -1 1:0.611111 2:-0.166667 3:0.627119 4:0.25
-0.5941888562343858 -0.4438880608405181 1:1 2:0.5 3:0.830508 4:0.583333
-0.2413959668348911 -1 1:0.111111 2:-0.333333 3:0.38983 4:0.166667
-0 -1 1:-1.32455e-07 2:-0.5 3:0.559322 4:0.0833333
-0 -1 1:0.166667 2:-0.0833334 3:0.525424 4:0.416667
-0.06282660668262839 -1 1:-0.0555556 2:-0.166667 3:0.288136 4:0.416667
-0 -1 1:-0.166667 2:-0.416667 3:0.38983 4:0.5
-0 -1 1:0.111111 2:-0.583333 3:0.355932 4:0.5
-0 -1 1:0.222222 2:-0.166667 3:0.423729 4:0.583333
-0 -1 1:-0.111111 2:-0.166667 3:0.38983 4:0.416667
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <Python.h> #include <Python.h>
#include <xbob.learn.libsvm/config.h> #include <xbob.learn.libsvm/config.h>
#include <xbob.learn.libsvm/file.h> #include <xbob.learn.libsvm/file.h>
#include <xbob.learn.libsvm/machine.h>
#include <xbob.learn.libsvm/trainer.h>
#define XBOB_LEARN_LIBSVM_MODULE_PREFIX xbob.learn.libsvm #define XBOB_LEARN_LIBSVM_MODULE_PREFIX xbob.learn.libsvm
#define XBOB_LEARN_LIBSVM_MODULE_NAME _library #define XBOB_LEARN_LIBSVM_MODULE_NAME _library
...@@ -33,7 +35,7 @@ ...@@ -33,7 +35,7 @@
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
bob::learn::libsvm::File* cxx; bob::learn::libsvm::File* cxx;
} PyBobLearnLibsvmMachineObject; } PyBobLearnLibsvmFileObject;
#define PyBobLearnLibsvmFile_Type_NUM 1 #define PyBobLearnLibsvmFile_Type_NUM 1
#define PyBobLearnLibsvmFile_Type_TYPE PyTypeObject #define PyBobLearnLibsvmFile_Type_TYPE PyTypeObject
...@@ -42,8 +44,30 @@ typedef struct { ...@@ -42,8 +44,30 @@ typedef struct {
#define PyBobLearnLibsvmFile_Check_RET int #define PyBobLearnLibsvmFile_Check_RET int
#define PyBobLearnLibsvmFile_Check_PROTO (PyObject* o) #define PyBobLearnLibsvmFile_Check_PROTO (PyObject* o)
/******************************************
* Bindings for xbob.learn.libsvm.Machine *
******************************************/
#define PyBobLearnLibsvmMachineSvmType_Type_NUM 3
#define PyBobLearnLibsvmMachineSvmType_Type_TYPE PyTypeObject
#define PyBobLearnLibsvmMachineSvmKe