Skip to content

Commit

Permalink
convert linear svms to use dense instead of sparse features.
Browse files Browse the repository at this point in the history
adjust reference output data accordingly (trained svms didn't change!)

cpu time should be < 0.5 so True is the correct output
  • Loading branch information
Soeren Sonnenburg committed Sep 9, 2013
1 parent 3c2209b commit 08c63b3
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion testsuite/tests/classifier_svmlin_modular0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ g2
Ntp8
Rp9
(I01
S'<<_SHOGUN_SERIALIZABLE_ASCII_FILE_V_00_>>\nversion_parameter int32 1\nmax_train_time float64 0\nsolver_type int32 0\nlabels SGSerializable* BinaryLabels [\nversion_parameter int32 1\nsubset_stack SGSerializable* SubsetStack [\nversion_parameter int32 1\nactive_subset SGSerializable* null []\nactive_subsets_stack SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\n]\nlabels SGVector<float64> 92 ({1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1})\n]\nstore_model_features bool f\ndata_locked bool f\nw SGVector<float64> 2 ({-0.0836279517534162}{-0.0811939730419934})\nbias float64 0.08607485706130583\nfeatures SGSerializable* SparseFeatures float64 [\nversion_parameter int32 1\nproperties uint64 1\ncache_size int32 0\npreproc SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\npreprocessed SGSerializable* DynamicArray bool [\nversion_parameter int32 1\narray Vector<bool> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\nsubset_stack SGSerializable* SubsetStack [\nversion_parameter int32 1\nactive_subset SGSerializable* null []\nactive_subsets_stack SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\n]\ncombined_weight float64 1\nsparse_feature_matrix Vector<Sparse<float64>> 120 ({2 ( 0 {-1.162273319266262} 1 {-2.736135020402096})}{2 ( 0 {-2.225011115660302} 1 {-2.217077929924163})}{2 ( 0 {-1.795354671215349} 1 {-0.5243042248700311})}{2 ( 0 {-1.968380395494842} 1 {-2.759857073777984})}{2 ( 0 {-0.631631320403945} 1 {-1.549282021592439})}{2 ( 0 {-1.337174832541163} 1 {-1.862601607302286})}{2 ( 0 {-1.154893327420766} 1 {-0.7654138899639953})}{2 ( 0 {-1.514686597359673} 1 {-2.840573921708206})}{2 ( 0 {-3.800118584231998} 1 {-2.815973128017998})}{2 ( 0 {-4.334358240976068} 1 {-2.422719506203468})}{2 ( 0 {-3.058384031055297} 1 {-2.514533577377949})}{2 ( 0 {-1.768513933144829} 1 {-0.9356731957907414})}{2 ( 0 {-1.906769970181702} 1 {-3.480109848814767})}{2 ( 0 {-0.188343771395366} 1 {-1.461737394595835})}{2 ( 0 {-0.9281559735165215} 1 {-2.736453308588313})}{2 ( 0 {-3.594967112457025} 1 {-1.527929226044384})}{2 ( 0 {-2.397495222859226} 1 {-2.037845810487135})}{2 ( 0 {-2.226777157253632} 1 {-3.06935958428157})}{2 ( 0 {-3.868842776795889} 1 {-1.974839347942902})}{2 ( 0 {-2.04940591270917} 1 {-5.124729698158459})}{2 ( 0 {-1.644322468294669} 1 {-1.183846449090669})}{2 ( 0 {-3.081631848847445} 1 {-2.316419141484652})}{2 ( 0 {-1.857714579237158} 1 {-3.985587933258199})}{2 ( 0 {-3.966100267323945} 1 {-1.522906119286314})}{2 ( 0 {-0.7605267319180096} 1 {-0.5520479411500931})}{2 ( 0 {-1.000231526494924} 1 {-2.521604145354162})}{2 ( 0 {-3.043648393435689} 1 {-0.9479023147824512})}{2 ( 0 {-0.2450361546924229} 1 {-2.978808802828795})}{2 ( 0 {-2.428547841871981} 1 {-1.947939809733191})}{2 ( 0 {-2.368501154507425} 1 {-2.763754880791284})}{2 ( 0 {3.270346713702211} 1 {2.635030018919171})}{2 ( 0 {2.892916452292812} 1 {3.595558095094268})}{2 ( 0 {2.775216929271296} 1 {1.080761431311377})}{2 ( 0 {1.218163926397364} 1 {1.344563712059399})}{2 ( 0 {1.77245969482419} 1 {0.06174425129659511})}{2 ( 0 {1.529321758116366} 1 {2.068842855361534})}{2 ( 0 {1.624528265801153} 1 {2.016934510525421})}{2 ( 0 {0.1385133538858927} 1 {2.571991613023937})}{2 ( 0 {2.13357764198624} 1 {1.661969840810945})}{2 ( 0 {1.54384476476914} 1 {2.692685049053073})}{2 ( 0 {1.122655470484061} 1 {1.654312415522972})}{2 ( 0 {0.3966231311467983} 1 {3.523462868619792})}{2 ( 0 {2.627352856877914} 1 {1.762409782997033})}{2 ( 0 {1.473145677843995} 1 {2.21658998872249})}{2 ( 0 {3.454554627476132} 1 {2.028787465385562})}{2 ( 0 {3.771564061539683} 1 {1.540632469125621})}{2 ( 0 {3.470952959892766} 1 {2.628856095991832})}{2 ( 0 {1.406052773763612} 1 {2.991080066652124})}{2 ( 0 {2.400890034448376} 1 {1.571222099679919})}{2 ( 0 {3.161562918206027} 1 {0.6460513326244135})}{2 ( 0 {1.683663769476419} 1 {1.127440873896514})}{2 ( 0 {1.748834366856509} 1 {1.483617012741206})}{2 ( 0 {3.234492106809665} 1 {2.201606746531785})}{2 ( 0 {3.60659702726429} 1 {3.521412091146483})}{2 ( 0 {1.882085524623792} 1 {0.4518202910236688})}{2 ( 0 {2.427606804394046} 1 {2.851187771945598})}{2 ( 0 {3.182625475457992} 1 {0.7431137844314908})}{2 ( 0 {3.435153495706692} 1 {1.91578670912607})}{2 ( 0 {0.2463750054899136} 1 {1.729402309177142})}{2 ( 0 {1.254478506875025} 1 {2.199912766119815})}{2 ( 0 {0.493100843892968} 1 {0.5120886440156529})}{2 ( 0 {3.912651897291154} 1 {0.7722207087661038})}{2 ( 0 {2.156134962824072} 1 {0.2899502342393693})}{2 ( 0 {5.024318148517301} 1 {0.2377432545713964})}{2 ( 0 {2.678464500418626} 1 {0.3178656874334511})}{2 ( 0 {0.9229332661873511} 1 {3.086210237351624})}{2 ( 0 {3.152849121656339} 1 {1.622561243382932})}{2 ( 0 {1.459209591537816} 1 {1.032096151694264})}{2 ( 0 {4.193320416546337} 1 {-2.397996197178812})}{2 ( 0 {2.426770116227607} 1 {-0.2082312277149179})}{2 ( 0 {1.64347370369898} 1 {1.26806454342041})}{2 ( 0 {2.002588329505942} 1 {-1.565775001081931})}{2 ( 0 {1.572659654563606} 1 {0.8666459944386501})}{2 ( 0 {1.762600177516351} 1 {-0.02408410343484471})}{2 ( 0 {1.467402580871842} 1 {-1.972892653446683})}{2 ( 0 {2.193121689163387} 1 {2.783512315973205})}{2 ( 0 {3.328640898465834} 1 {1.226386579371189})}{2 ( 0 {2.901749188307652} 1 {1.073816858795743})}{2 ( 0 {1.42067333233368} 1 {0.5412959938399927})}{2 ( 0 {3.392594360515341} 1 {-0.1523150256949844})}{2 ( 0 {2.025244985140795} 1 {-1.27164622214666})}{2 ( 0 {1.716181504918142} 1 {-0.3323574684477137})}{2 ( 0 {2.407357264928086} 1 {-0.7744546963302313})}{2 ( 0 {2.40494268914516} 1 {0.1404624382817154})}{2 ( 0 {0.08404815098045493} 1 {0.872518501279567})}{2 ( 0 {1.734081496056538} 1 {-0.1542121123461977})}{2 ( 0 {1.826147588057097} 1 {-0.8592287871409139})}{2 ( 0 {4.351782761348557} 1 {-0.2495593333187602})}{2 ( 0 {1.33331292347001} 1 {1.975377937313616})}{2 ( 0 {1.250117559929307} 1 {-0.4296290509395593})}{2 ( 0 {1.348844850108228} 1 {2.694540400148789})}{2 ( 0 {1.858691668280327} 1 {2.583530360298465})}{2 ( 0 {0.2211261465014716} 1 {1.414958902817809})}{2 ( 0 {-2.313633902176043} 1 {3.79714190723192})}{2 ( 0 {-0.4393476169240257} 1 {1.469874441876963})}{2 ( 0 {0.9299314654093864} 1 {3.837428742504462})}{2 ( 0 {0.3042812263264197} 1 {2.226794530998717})}{2 ( 0 {-1.757131781443074} 1 {2.643731069101391})}{2 ( 0 {-0.1366082557729697} 1 {3.710327301150917})}{2 ( 0 {-0.178064475123102} 1 {3.232012076195472})}{2 ( 0 {0.2806712628998599} 1 {3.246496668469436})}{2 ( 0 {0.8572428196538835} 1 {3.928632578294732})}{2 ( 0 {-1.36169400527559} 1 {2.146509547864285})}{2 ( 0 {-0.5751117442027438} 1 {1.047536167370979})}{2 ( 0 {1.147033451325094} 1 {3.86255503132116})}{2 ( 0 {-0.1620772373272576} 1 {1.191584775535363})}{2 ( 0 {1.341460853657847} 1 {0.02965416410486377})}{2 ( 0 {0.1602603648416699} 1 {0.8170439260116182})}{2 ( 0 {-0.4337240059582861} 1 {2.454136970978525})}{2 ( 0 {-1.155605987328249} 1 {2.086877904805521})}{2 ( 0 {0.9394774953626472} 1 {1.391504575827808})}{2 ( 0 {-0.2397792299854748} 1 {0.7441020144588693})}{2 ( 0 {-0.5795058593588126} 1 {2.777862107376695})}{2 ( 0 {0.7061903276929008} 1 {1.874027951691315})}{2 ( 0 {0.05584350865903571} 1 {1.921305896167091})}{2 ( 0 {-1.401738605020372} 1 {1.558155179385741})}{2 ( 0 {1.659834712799875} 1 {1.957255390903647})}{2 ( 0 {1.040722943126618} 1 {2.613141326753483})}{2 ( 0 {0.5777939462859061} 1 {1.12875345469705})}{2 ( 0 {0.02240780921584391} 1 {0.9724440139544677})})\nsparse_feature_matrix.num_features int32 2\n]\n'
S'<<_SHOGUN_SERIALIZABLE_ASCII_FILE_V_00_>>\nversion_parameter int32 1\nmax_train_time float64 0\nsolver_type int32 0\nlabels SGSerializable* BinaryLabels [\nversion_parameter int32 1\nsubset_stack SGSerializable* SubsetStack [\nversion_parameter int32 1\nactive_subset SGSerializable* null []\nactive_subsets_stack SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\n]\nlabels SGVector<float64> 92 ({1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1}{-1})\n]\nstore_model_features bool f\ndata_locked bool f\nw SGVector<float64> 2 ({-0.0836279517534162}{-0.0811939730419934})\nbias float64 0.08607485706130583\nfeatures SGSerializable* DenseFeatures float64 [\nversion_parameter int32 1\nproperties uint64 1\ncache_size int32 0\npreproc SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\npreprocessed SGSerializable* DynamicArray bool [\nversion_parameter int32 1\narray Vector<bool> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\nsubset_stack SGSerializable* SubsetStack [\nversion_parameter int32 1\nactive_subset SGSerializable* null []\nactive_subsets_stack SGSerializable* DynamicObjectArray [\nversion_parameter int32 1\narray Vector<SGSerializable*> 0 ()\nnum_elements int32 0\nresize_granularity int32 128\nuse_sg_malloc bool t\nfree_array bool t\n]\n]\ncombined_weight float64 1\nnum_vectors int32 120\nnum_features int32 2\nfeature_matrix SGMatrix<float64> 2 120 ({-1.162273319266262}{-2.736135020402096}{-2.225011115660302}{-2.217077929924163}{-1.795354671215349}{-0.5243042248700311}{-1.968380395494842}{-2.759857073777984}{-0.631631320403945}{-1.549282021592439}{-1.337174832541163}{-1.862601607302286}{-1.154893327420766}{-0.7654138899639953}{-1.514686597359673}{-2.840573921708206}{-3.800118584231998}{-2.815973128017998}{-4.334358240976068}{-2.422719506203468}{-3.058384031055297}{-2.514533577377949}{-1.768513933144829}{-0.9356731957907414}{-1.906769970181702}{-3.480109848814767}{-0.188343771395366}{-1.461737394595835}{-0.9281559735165215}{-2.736453308588313}{-3.594967112457025}{-1.527929226044384}{-2.397495222859226}{-2.037845810487135}{-2.226777157253632}{-3.06935958428157}{-3.868842776795889}{-1.974839347942902}{-2.04940591270917}{-5.124729698158459}{-1.644322468294669}{-1.183846449090669}{-3.081631848847445}{-2.316419141484652}{-1.857714579237158}{-3.985587933258199}{-3.966100267323945}{-1.522906119286314}{-0.7605267319180096}{-0.5520479411500931}{-1.000231526494924}{-2.521604145354162}{-3.043648393435689}{-0.9479023147824512}{-0.2450361546924229}{-2.978808802828795}{-2.428547841871981}{-1.947939809733191}{-2.368501154507425}{-2.763754880791284}{3.270346713702211}{2.635030018919171}{2.892916452292812}{3.595558095094268}{2.775216929271296}{1.080761431311377}{1.218163926397364}{1.344563712059399}{1.77245969482419}{0.06174425129659511}{1.529321758116366}{2.068842855361534}{1.624528265801153}{2.016934510525421}{0.1385133538858927}{2.571991613023937}{2.13357764198624}{1.661969840810945}{1.54384476476914}{2.692685049053073}{1.122655470484061}{1.654312415522972}{0.3966231311467983}{3.523462868619792}{2.627352856877914}{1.762409782997033}{1.473145677843995}{2.21658998872249}{3.454554627476132}{2.028787465385562}{3.771564061539683}{1.540632469125621}{3.470952959892766}{2.628856095991832}{1.406052773763612}{2.991080066652124}{2.400890034448376}{1.571222099679919}{3.161562918206027}{0.6460513326244135}{1.683663769476419}{1.127440873896514}{1.748834366856509}{1.483617012741206}{3.234492106809665}{2.201606746531785}{3.60659702726429}{3.521412091146483}{1.882085524623792}{0.4518202910236688}{2.427606804394046}{2.851187771945598}{3.182625475457992}{0.7431137844314908}{3.435153495706692}{1.91578670912607}{0.2463750054899136}{1.729402309177142}{1.254478506875025}{2.199912766119815}{0.493100843892968}{0.5120886440156529}{3.912651897291154}{0.7722207087661038}{2.156134962824072}{0.2899502342393693}{5.024318148517301}{0.2377432545713964}{2.678464500418626}{0.3178656874334511}{0.9229332661873511}{3.086210237351624}{3.152849121656339}{1.622561243382932}{1.459209591537816}{1.032096151694264}{4.193320416546337}{-2.397996197178812}{2.426770116227607}{-0.2082312277149179}{1.64347370369898}{1.26806454342041}{2.002588329505942}{-1.565775001081931}{1.572659654563606}{0.8666459944386501}{1.762600177516351}{-0.02408410343484471}{1.467402580871842}{-1.972892653446683}{2.193121689163387}{2.783512315973205}{3.328640898465834}{1.226386579371189}{2.901749188307652}{1.073816858795743}{1.42067333233368}{0.5412959938399927}{3.392594360515341}{-0.1523150256949844}{2.025244985140795}{-1.27164622214666}{1.716181504918142}{-0.3323574684477137}{2.407357264928086}{-0.7744546963302313}{2.40494268914516}{0.1404624382817154}{0.08404815098045493}{0.872518501279567}{1.734081496056538}{-0.1542121123461977}{1.826147588057097}{-0.8592287871409139}{4.351782761348557}{-0.2495593333187602}{1.33331292347001}{1.975377937313616}{1.250117559929307}{-0.4296290509395593}{1.348844850108228}{2.694540400148789}{1.858691668280327}{2.583530360298465}{0.2211261465014716}{1.414958902817809}{-2.313633902176043}{3.79714190723192}{-0.4393476169240257}{1.469874441876963}{0.9299314654093864}{3.837428742504462}{0.3042812263264197}{2.226794530998717}{-1.757131781443074}{2.643731069101391}{-0.1366082557729697}{3.710327301150917}{-0.178064475123102}{3.232012076195472}{0.2806712628998599}{3.246496668469436}{0.8572428196538835}{3.928632578294732}{-1.36169400527559}{2.146509547864285}{-0.5751117442027438}{1.047536167370979}{1.147033451325094}{3.86255503132116}{-0.1620772373272576}{1.191584775535363}{1.341460853657847}{0.02965416410486377}{0.1602603648416699}{0.8170439260116182}{-0.4337240059582861}{2.454136970978525}{-1.155605987328249}{2.086877904805521}{0.9394774953626472}{1.391504575827808}{-0.2397792299854748}{0.7441020144588693}{-0.5795058593588126}{2.777862107376695}{0.7061903276929008}{1.874027951691315}{0.05584350865903571}{1.921305896167091}{-1.401738605020372}{1.558155179385741}{1.659834712799875}{1.957255390903647}{1.040722943126618}{2.613141326753483}{0.5777939462859061}{1.12875345469705}{0.02240780921584391}{0.9724440139544677})\n]\n'
p10
tp11
bcnumpy.core.multiarray
Expand Down
Loading

0 comments on commit 08c63b3

Please sign in to comment.