You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_untildpathkernel_acyclic-checkpoint.ipynb 93 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [
  8. {
  9. "name": "stdout",
  10. "output_type": "stream",
  11. "text": [
  12. "\n",
  13. " --- This is a regression problem ---\n",
  14. "\n",
  15. "\n",
  16. " #--- calculating kernel matrix when depth = 0.0 ---#\n",
  17. "\n",
  18. " Loading dataset from file...\n",
  19. "\n",
  20. " Calculating kernel matrix, this could take a while...\n",
  21. "\n",
  22. " --- kernel matrix of path kernel up to 0 of size 185 built in 0.09047365188598633 seconds ---\n",
  23. "[[ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n",
  24. " 0.33333333]\n",
  25. " [ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n",
  26. " 0.33333333]\n",
  27. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  28. " ..., \n",
  29. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  30. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  31. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]]\n",
  32. "\n",
  33. " Saving kernel matrix to file...\n",
  34. "\n",
  35. " Mean performance on train set: 43.616902\n",
  36. "With standard deviation: 2.132120\n",
  37. "\n",
  38. " Mean performance on test set: 41.620214\n",
  39. "With standard deviation: 6.453003\n",
  40. "\n",
  41. "\n",
  42. " #--- calculating kernel matrix when depth = 1.0 ---#\n",
  43. "\n",
  44. " Loading dataset from file...\n",
  45. "\n",
  46. " Calculating kernel matrix, this could take a while...\n",
  47. "\n",
  48. " --- kernel matrix of path kernel up to 1 of size 185 built in 0.1754138469696045 seconds ---\n",
  49. "[[ 1. 0.8 0.14285714 ..., 0.125 0.125 0.125 ]\n",
  50. " [ 0.8 1. 0.125 ..., 0.11111111 0.11111111\n",
  51. " 0.11111111]\n",
  52. " [ 0.14285714 0.125 1. ..., 0.8 0.8 0.8 ]\n",
  53. " ..., \n",
  54. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n",
  55. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n",
  56. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]]\n",
  57. "\n",
  58. " Saving kernel matrix to file...\n",
  59. "\n",
  60. " Mean performance on train set: 40.832861\n",
  61. "With standard deviation: 3.441465\n",
  62. "\n",
  63. " Mean performance on test set: 38.844613\n",
  64. "With standard deviation: 6.446482\n",
  65. "\n",
  66. "\n",
  67. " #--- calculating kernel matrix when depth = 2.0 ---#\n",
  68. "\n",
  69. " Loading dataset from file...\n",
  70. "\n",
  71. " Calculating kernel matrix, this could take a while...\n",
  72. "\n",
  73. " --- kernel matrix of path kernel up to 2 of size 185 built in 0.3448960781097412 seconds ---\n",
  74. "[[ 1. 0.5 0.11111111 ..., 0.07692308 0.07692308\n",
  75. " 0.07692308]\n",
  76. " [ 0.5 1. 0.09090909 ..., 0.06666667 0.06666667\n",
  77. " 0.06666667]\n",
  78. " [ 0.11111111 0.09090909 1. ..., 0.55555556 0.55555556\n",
  79. " 0.55555556]\n",
  80. " ..., \n",
  81. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n",
  82. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n",
  83. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]]\n",
  84. "\n",
  85. " Saving kernel matrix to file...\n",
  86. "\n",
  87. " Mean performance on train set: 35.746142\n",
  88. "With standard deviation: 1.611340\n",
  89. "\n",
  90. " Mean performance on test set: 35.291451\n",
  91. "With standard deviation: 4.781298\n",
  92. "\n",
  93. "\n",
  94. " #--- calculating kernel matrix when depth = 3.0 ---#\n",
  95. "\n",
  96. " Loading dataset from file...\n",
  97. "\n",
  98. " Calculating kernel matrix, this could take a while...\n",
  99. "\n",
  100. " --- kernel matrix of path kernel up to 3 of size 185 built in 0.5539388656616211 seconds ---\n",
  101. "[[ 1. 0.44444444 0.11111111 ..., 0.05555556 0.05555556\n",
  102. " 0.05555556]\n",
  103. " [ 0.44444444 1. 0.08333333 ..., 0.04761905 0.04761905\n",
  104. " 0.04761905]\n",
  105. " [ 0.11111111 0.08333333 1. ..., 0.35714286 0.35714286\n",
  106. " 0.35714286]\n",
  107. " ..., \n",
  108. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n",
  109. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n",
  110. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]]\n",
  111. "\n",
  112. " Saving kernel matrix to file...\n",
  113. "\n",
  114. " Mean performance on train set: 28.464581\n",
  115. "With standard deviation: 3.001371\n",
  116. "\n",
  117. " Mean performance on test set: 29.484499\n",
  118. "With standard deviation: 3.903507\n",
  119. "\n",
  120. "\n",
  121. " #--- calculating kernel matrix when depth = 4.0 ---#\n",
  122. "\n",
  123. " Loading dataset from file...\n",
  124. "\n",
  125. " Calculating kernel matrix, this could take a while...\n",
  126. "\n",
  127. " --- kernel matrix of path kernel up to 4 of size 185 built in 0.7706489562988281 seconds ---\n",
  128. "[[ 1. 0.44444444 0.11111111 ..., 0.04347826 0.04166667\n",
  129. " 0.04347826]\n",
  130. " [ 0.44444444 1. 0.08333333 ..., 0.03846154 0.03703704\n",
  131. " 0.03846154]\n",
  132. " [ 0.11111111 0.08333333 1. ..., 0.26315789 0.25 0.26315789]\n",
  133. " ..., \n",
  134. " [ 0.04347826 0.03846154 0.26315789 ..., 1. 0.95 0.9 ]\n",
  135. " [ 0.04166667 0.03703704 0.25 ..., 0.95 1. 0.95 ]\n",
  136. " [ 0.04347826 0.03846154 0.26315789 ..., 0.9 0.95 1. ]]\n",
  137. "\n",
  138. " Saving kernel matrix to file...\n",
  139. "\n",
  140. " Mean performance on train set: 19.251747\n",
  141. "With standard deviation: 3.428930\n",
  142. "\n",
  143. " Mean performance on test set: 22.669312\n",
  144. "With standard deviation: 6.280526\n",
  145. "\n",
  146. "\n",
  147. " #--- calculating kernel matrix when depth = 5.0 ---#\n",
  148. "\n",
  149. " Loading dataset from file...\n",
  150. "\n",
  151. " Calculating kernel matrix, this could take a while...\n",
  152. "\n",
  153. " --- kernel matrix of path kernel up to 5 of size 185 built in 1.015580415725708 seconds ---\n",
  154. "[[ 1. 0.44444444 0.11111111 ..., 0.03703704 0.03333333\n",
  155. " 0.03571429]\n",
  156. " [ 0.44444444 1. 0.08333333 ..., 0.03333333 0.03030303\n",
  157. " 0.03225806]\n",
  158. " [ 0.11111111 0.08333333 1. ..., 0.2173913 0.19230769\n",
  159. " 0.20833333]\n",
  160. " ..., \n",
  161. " [ 0.03703704 0.03333333 0.2173913 ..., 1. 0.88461538\n",
  162. " 0.74074074]\n",
  163. " [ 0.03333333 0.03030303 0.19230769 ..., 0.88461538 1. 0.85185185]\n",
  164. " [ 0.03571429 0.03225806 0.20833333 ..., 0.74074074 0.85185185 1. ]]\n",
  165. "\n",
  166. " Saving kernel matrix to file...\n",
  167. "\n",
  168. " Mean performance on train set: 16.886016\n",
  169. "With standard deviation: 2.605194\n",
  170. "\n",
  171. " Mean performance on test set: 21.795626\n",
  172. "With standard deviation: 5.522502\n",
  173. "\n",
  174. "\n",
  175. " #--- calculating kernel matrix when depth = 6.0 ---#\n",
  176. "\n",
  177. " Loading dataset from file...\n",
  178. "\n",
  179. " Calculating kernel matrix, this could take a while...\n",
  180. "\n",
  181. " --- kernel matrix of path kernel up to 6 of size 185 built in 1.3330223560333252 seconds ---\n",
  182. "[[ 1. 0.44444444 0.11111111 ..., 0.03333333 0.02857143\n",
  183. " 0.03030303]\n",
  184. " [ 0.44444444 1. 0.08333333 ..., 0.03030303 0.02631579\n",
  185. " 0.02777778]\n",
  186. " [ 0.11111111 0.08333333 1. ..., 0.19230769 0.16129032\n",
  187. " 0.17241379]\n",
  188. " ..., \n",
  189. " [ 0.03333333 0.03030303 0.19230769 ..., 1. 0.83870968\n",
  190. " 0.57142857]\n",
  191. " [ 0.02857143 0.02631579 0.16129032 ..., 0.83870968 1. 0.71428571]\n",
  192. " [ 0.03030303 0.02777778 0.17241379 ..., 0.57142857 0.71428571 1. ]]\n",
  193. "\n",
  194. " Saving kernel matrix to file...\n",
  195. "\n",
  196. " Mean performance on train set: 13.109746\n",
  197. "With standard deviation: 2.584308\n",
  198. "\n",
  199. " Mean performance on test set: 20.604920\n",
  200. "With standard deviation: 5.499831\n",
  201. "\n",
  202. "\n",
  203. " #--- calculating kernel matrix when depth = 7.0 ---#\n",
  204. "\n",
  205. " Loading dataset from file...\n",
  206. "\n",
  207. " Calculating kernel matrix, this could take a while...\n",
  208. "\n",
  209. " --- kernel matrix of path kernel up to 7 of size 185 built in 1.602663278579712 seconds ---\n",
  210. "[[ 1. 0.44444444 0.11111111 ..., 0.03125 0.02564103\n",
  211. " 0.02631579]\n",
  212. " [ 0.44444444 1. 0.08333333 ..., 0.02857143 0.02380952\n",
  213. " 0.02439024]\n",
  214. " [ 0.11111111 0.08333333 1. ..., 0.17857143 0.14285714\n",
  215. " 0.14705882]\n",
  216. " ..., \n",
  217. " [ 0.03125 0.02857143 0.17857143 ..., 1. 0.8 0.47619048]\n",
  218. " [ 0.02564103 0.02380952 0.14285714 ..., 0.8 1. 0.56818182]\n",
  219. " [ 0.02631579 0.02439024 0.14705882 ..., 0.47619048 0.56818182 1. ]]\n",
  220. "\n",
  221. " Saving kernel matrix to file...\n",
  222. "\n",
  223. " Mean performance on train set: 12.015210\n",
  224. "With standard deviation: 2.592798\n",
  225. "\n",
  226. " Mean performance on test set: 20.347932\n",
  227. "With standard deviation: 5.176314\n",
  228. "\n",
  229. "\n",
  230. " #--- calculating kernel matrix when depth = 8.0 ---#\n",
  231. "\n",
  232. " Loading dataset from file...\n",
  233. "\n",
  234. " Calculating kernel matrix, this could take a while...\n",
  235. "\n",
  236. " --- kernel matrix of path kernel up to 8 of size 185 built in 1.8121819496154785 seconds ---\n",
  237. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  238. " 0.02325581]\n",
  239. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  240. " 0.02173913]\n",
  241. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  242. " 0.12820513]\n",
  243. " ..., \n",
  244. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  245. " 0.41666667]\n",
  246. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.49019608]\n",
  247. " [ 0.02325581 0.02173913 0.12820513 ..., 0.41666667 0.49019608 1. ]]\n",
  248. "\n",
  249. " Saving kernel matrix to file...\n",
  250. "\n",
  251. " Mean performance on train set: 10.798096\n",
  252. "With standard deviation: 2.130816\n",
  253. "\n",
  254. " Mean performance on test set: 19.822797\n",
  255. "With standard deviation: 5.137687\n",
  256. "\n",
  257. "\n",
  258. " #--- calculating kernel matrix when depth = 9.0 ---#\n",
  259. "\n",
  260. " Loading dataset from file...\n",
  261. "\n",
  262. " Calculating kernel matrix, this could take a while...\n"
  263. ]
  264. },
  265. {
  266. "name": "stdout",
  267. "output_type": "stream",
  268. "text": [
  269. "\n",
  270. " --- kernel matrix of path kernel up to 9 of size 185 built in 2.2172586917877197 seconds ---\n",
  271. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  272. " 0.0212766 ]\n",
  273. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727 0.02 ]\n",
  274. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  275. " 0.11627907]\n",
  276. " ..., \n",
  277. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  278. " 0.38461538]\n",
  279. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.45454545]\n",
  280. " [ 0.0212766 0.02 0.11627907 ..., 0.38461538 0.45454545 1. ]]\n",
  281. "\n",
  282. " Saving kernel matrix to file...\n",
  283. "\n",
  284. " Mean performance on train set: 10.799656\n",
  285. "With standard deviation: 2.095494\n",
  286. "\n",
  287. " Mean performance on test set: 19.873364\n",
  288. "With standard deviation: 5.103689\n",
  289. "\n",
  290. "\n",
  291. " #--- calculating kernel matrix when depth = 10.0 ---#\n",
  292. "\n",
  293. " Loading dataset from file...\n",
  294. "\n",
  295. " Calculating kernel matrix, this could take a while...\n",
  296. "\n",
  297. " --- kernel matrix of path kernel up to 10 of size 185 built in 2.4100613594055176 seconds ---\n",
  298. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  299. " 0.02040816]\n",
  300. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  301. " 0.01923077]\n",
  302. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  303. " 0.11111111]\n",
  304. " ..., \n",
  305. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  306. " 0.37037037]\n",
  307. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  308. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  309. "\n",
  310. " Saving kernel matrix to file...\n",
  311. "\n",
  312. " Mean performance on train set: 10.778685\n",
  313. "With standard deviation: 2.100015\n",
  314. "\n",
  315. " Mean performance on test set: 19.870809\n",
  316. "With standard deviation: 5.092173\n",
  317. "\n",
  318. "\n",
  319. " #--- calculating kernel matrix when depth = 11.0 ---#\n",
  320. "\n",
  321. " Loading dataset from file...\n",
  322. "\n",
  323. " Calculating kernel matrix, this could take a while...\n",
  324. "\n",
  325. " --- kernel matrix of path kernel up to 11 of size 185 built in 2.7440149784088135 seconds ---\n",
  326. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  327. " 0.02040816]\n",
  328. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  329. " 0.01923077]\n",
  330. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  331. " 0.11111111]\n",
  332. " ..., \n",
  333. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  334. " 0.37037037]\n",
  335. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  336. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  337. "\n",
  338. " Saving kernel matrix to file...\n",
  339. "\n",
  340. " Mean performance on train set: 10.778685\n",
  341. "With standard deviation: 2.100015\n",
  342. "\n",
  343. " Mean performance on test set: 19.870809\n",
  344. "With standard deviation: 5.092173\n",
  345. "\n",
  346. "\n",
  347. " #--- calculating kernel matrix when depth = 12.0 ---#\n",
  348. "\n",
  349. " Loading dataset from file...\n",
  350. "\n",
  351. " Calculating kernel matrix, this could take a while...\n",
  352. "\n",
  353. " --- kernel matrix of path kernel up to 12 of size 185 built in 2.723442316055298 seconds ---\n",
  354. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  355. " 0.02040816]\n",
  356. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  357. " 0.01923077]\n",
  358. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  359. " 0.11111111]\n",
  360. " ..., \n",
  361. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  362. " 0.37037037]\n",
  363. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  364. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  365. "\n",
  366. " Saving kernel matrix to file...\n",
  367. "\n",
  368. " Mean performance on train set: 10.778685\n",
  369. "With standard deviation: 2.100015\n",
  370. "\n",
  371. " Mean performance on test set: 19.870809\n",
  372. "With standard deviation: 5.092173\n",
  373. "\n",
  374. "\n",
  375. " #--- calculating kernel matrix when depth = 13.0 ---#\n",
  376. "\n",
  377. " Loading dataset from file...\n",
  378. "\n",
  379. " Calculating kernel matrix, this could take a while...\n",
  380. "\n",
  381. " --- kernel matrix of path kernel up to 13 of size 185 built in 2.6163382530212402 seconds ---\n",
  382. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  383. " 0.02040816]\n",
  384. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  385. " 0.01923077]\n",
  386. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  387. " 0.11111111]\n",
  388. " ..., \n",
  389. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  390. " 0.37037037]\n",
  391. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  392. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  393. "\n",
  394. " Saving kernel matrix to file...\n",
  395. "\n",
  396. " Mean performance on train set: 10.778685\n",
  397. "With standard deviation: 2.100015\n",
  398. "\n",
  399. " Mean performance on test set: 19.870809\n",
  400. "With standard deviation: 5.092173\n",
  401. "\n",
  402. "\n",
  403. " #--- calculating kernel matrix when depth = 14.0 ---#\n",
  404. "\n",
  405. " Loading dataset from file...\n",
  406. "\n",
  407. " Calculating kernel matrix, this could take a while...\n",
  408. "\n",
  409. " --- kernel matrix of path kernel up to 14 of size 185 built in 2.629500389099121 seconds ---\n",
  410. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  411. " 0.02040816]\n",
  412. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  413. " 0.01923077]\n",
  414. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  415. " 0.11111111]\n",
  416. " ..., \n",
  417. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  418. " 0.37037037]\n",
  419. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  420. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  421. "\n",
  422. " Saving kernel matrix to file...\n",
  423. "\n",
  424. " Mean performance on train set: 10.778685\n",
  425. "With standard deviation: 2.100015\n",
  426. "\n",
  427. " Mean performance on test set: 19.870809\n",
  428. "With standard deviation: 5.092173\n",
  429. "\n",
  430. "\n",
  431. " #--- calculating kernel matrix when depth = 15.0 ---#\n",
  432. "\n",
  433. " Loading dataset from file...\n",
  434. "\n",
  435. " Calculating kernel matrix, this could take a while...\n",
  436. "\n",
  437. " --- kernel matrix of path kernel up to 15 of size 185 built in 2.664158821105957 seconds ---\n",
  438. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  439. " 0.02040816]\n",
  440. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  441. " 0.01923077]\n",
  442. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  443. " 0.11111111]\n",
  444. " ..., \n",
  445. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  446. " 0.37037037]\n",
  447. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  448. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  449. "\n",
  450. " Saving kernel matrix to file...\n",
  451. "\n",
  452. " Mean performance on train set: 10.778685\n",
  453. "With standard deviation: 2.100015\n",
  454. "\n",
  455. " Mean performance on test set: 19.870809\n",
  456. "With standard deviation: 5.092173\n",
  457. "\n",
  458. "\n",
  459. " #--- calculating kernel matrix when depth = 16.0 ---#\n",
  460. "\n",
  461. " Loading dataset from file...\n",
  462. "\n",
  463. " Calculating kernel matrix, this could take a while...\n",
  464. "\n",
  465. " --- kernel matrix of path kernel up to 16 of size 185 built in 2.7301340103149414 seconds ---\n",
  466. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  467. " 0.02040816]\n",
  468. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  469. " 0.01923077]\n",
  470. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  471. " 0.11111111]\n",
  472. " ..., \n",
  473. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  474. " 0.37037037]\n",
  475. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  476. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  477. "\n",
  478. " Saving kernel matrix to file...\n",
  479. "\n",
  480. " Mean performance on train set: 10.778685\n",
  481. "With standard deviation: 2.100015\n",
  482. "\n",
  483. " Mean performance on test set: 19.870809\n",
  484. "With standard deviation: 5.092173\n",
  485. "\n",
  486. "\n",
  487. " #--- calculating kernel matrix when depth = 17.0 ---#\n",
  488. "\n",
  489. " Loading dataset from file...\n",
  490. "\n",
  491. " Calculating kernel matrix, this could take a while...\n",
  492. "\n",
  493. " --- kernel matrix of path kernel up to 17 of size 185 built in 2.6328580379486084 seconds ---\n",
  494. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  495. " 0.02040816]\n",
  496. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  497. " 0.01923077]\n",
  498. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  499. " 0.11111111]\n",
  500. " ..., \n",
  501. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  502. " 0.37037037]\n",
  503. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  504. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  505. "\n",
  506. " Saving kernel matrix to file...\n",
  507. "\n",
  508. " Mean performance on train set: 10.778685\n",
  509. "With standard deviation: 2.100015\n",
  510. "\n",
  511. " Mean performance on test set: 19.870809\n",
  512. "With standard deviation: 5.092173\n",
  513. "\n",
  514. "\n",
  515. " #--- calculating kernel matrix when depth = 18.0 ---#\n",
  516. "\n",
  517. " Loading dataset from file...\n",
  518. "\n",
  519. " Calculating kernel matrix, this could take a while...\n"
  520. ]
  521. },
  522. {
  523. "name": "stdout",
  524. "output_type": "stream",
  525. "text": [
  526. "\n",
  527. " --- kernel matrix of path kernel up to 18 of size 185 built in 2.592944383621216 seconds ---\n",
  528. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  529. " 0.02040816]\n",
  530. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  531. " 0.01923077]\n",
  532. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  533. " 0.11111111]\n",
  534. " ..., \n",
  535. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  536. " 0.37037037]\n",
  537. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  538. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  539. "\n",
  540. " Saving kernel matrix to file...\n",
  541. "\n",
  542. " Mean performance on train set: 10.778685\n",
  543. "With standard deviation: 2.100015\n",
  544. "\n",
  545. " Mean performance on test set: 19.870809\n",
  546. "With standard deviation: 5.092173\n",
  547. "\n",
  548. "\n",
  549. " #--- calculating kernel matrix when depth = 19.0 ---#\n",
  550. "\n",
  551. " Loading dataset from file...\n",
  552. "\n",
  553. " Calculating kernel matrix, this could take a while...\n",
  554. "\n",
  555. " --- kernel matrix of path kernel up to 19 of size 185 built in 2.6368520259857178 seconds ---\n",
  556. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  557. " 0.02040816]\n",
  558. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  559. " 0.01923077]\n",
  560. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  561. " 0.11111111]\n",
  562. " ..., \n",
  563. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  564. " 0.37037037]\n",
  565. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  566. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  567. "\n",
  568. " Saving kernel matrix to file...\n",
  569. "\n",
  570. " Mean performance on train set: 10.778685\n",
  571. "With standard deviation: 2.100015\n",
  572. "\n",
  573. " Mean performance on test set: 19.870809\n",
  574. "With standard deviation: 5.092173\n",
  575. "\n",
  576. "\n",
  577. " #--- calculating kernel matrix when depth = 20.0 ---#\n",
  578. "\n",
  579. " Loading dataset from file...\n",
  580. "\n",
  581. " Calculating kernel matrix, this could take a while...\n",
  582. "\n",
  583. " --- kernel matrix of path kernel up to 20 of size 185 built in 2.52734375 seconds ---\n",
  584. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  585. " 0.02040816]\n",
  586. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  587. " 0.01923077]\n",
  588. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  589. " 0.11111111]\n",
  590. " ..., \n",
  591. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  592. " 0.37037037]\n",
  593. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  594. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  595. "\n",
  596. " Saving kernel matrix to file...\n",
  597. "\n",
  598. " Mean performance on train set: 10.778685\n",
  599. "With standard deviation: 2.100015\n",
  600. "\n",
  601. " Mean performance on test set: 19.870809\n",
  602. "With standard deviation: 5.092173\n",
  603. "\n",
  604. "\n",
  605. " depth rmse_test std_test rmse_train std_train k_time\n",
  606. "------- ----------- ---------- ------------ ----------- ---------\n",
  607. " 0 41.6202 6.453 43.6169 2.13212 0.0904737\n",
  608. " 1 38.8446 6.44648 40.8329 3.44147 0.175414\n",
  609. " 2 35.2915 4.7813 35.7461 1.61134 0.344896\n",
  610. " 3 29.4845 3.90351 28.4646 3.00137 0.553939\n",
  611. " 4 22.6693 6.28053 19.2517 3.42893 0.770649\n",
  612. " 5 21.7956 5.5225 16.886 2.60519 1.01558\n",
  613. " 6 20.6049 5.49983 13.1097 2.58431 1.33302\n",
  614. " 7 20.3479 5.17631 12.0152 2.5928 1.60266\n",
  615. " 8 19.8228 5.13769 10.7981 2.13082 1.81218\n",
  616. " 9 19.8734 5.10369 10.7997 2.09549 2.21726\n",
  617. " 10 19.8708 5.09217 10.7787 2.10002 2.41006\n",
  618. " 11 19.8708 5.09217 10.7787 2.10002 2.74401\n",
  619. " 12 19.8708 5.09217 10.7787 2.10002 2.72344\n",
  620. " 13 19.8708 5.09217 10.7787 2.10002 2.61634\n",
  621. " 14 19.8708 5.09217 10.7787 2.10002 2.6295\n",
  622. " 15 19.8708 5.09217 10.7787 2.10002 2.66416\n",
  623. " 16 19.8708 5.09217 10.7787 2.10002 2.73013\n",
  624. " 17 19.8708 5.09217 10.7787 2.10002 2.63286\n",
  625. " 18 19.8708 5.09217 10.7787 2.10002 2.59294\n",
  626. " 19 19.8708 5.09217 10.7787 2.10002 2.63685\n",
  627. " 20 19.8708 5.09217 10.7787 2.10002 2.52734\n",
  628. "\n",
  629. " --- This is a regression problem ---\n",
  630. "\n",
  631. "\n",
  632. " #--- calculating kernel matrix when depth = 0.0 ---#\n",
  633. "\n",
  634. " Loading dataset from file...\n",
  635. "\n",
  636. " Calculating kernel matrix, this could take a while...\n",
  637. "\n",
  638. " --- kernel matrix of path kernel up to 0 of size 185 built in 0.1027534008026123 seconds ---\n",
  639. "[[ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n",
  640. " 0.33333333]\n",
  641. " [ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n",
  642. " 0.33333333]\n",
  643. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  644. " ..., \n",
  645. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  646. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n",
  647. " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]]\n",
  648. "\n",
  649. " Saving kernel matrix to file...\n",
  650. "\n",
  651. " Mean performance on train set: 42.787136\n",
  652. "With standard deviation: 0.675806\n",
  653. "\n",
  654. " Mean performance on test set: 42.645892\n",
  655. "With standard deviation: 6.560629\n",
  656. "\n",
  657. "\n",
  658. " #--- calculating kernel matrix when depth = 1.0 ---#\n",
  659. "\n",
  660. " Loading dataset from file...\n",
  661. "\n",
  662. " Calculating kernel matrix, this could take a while...\n",
  663. "\n",
  664. " --- kernel matrix of path kernel up to 1 of size 185 built in 0.18301701545715332 seconds ---\n",
  665. "[[ 1. 0.8 0.14285714 ..., 0.125 0.125 0.125 ]\n",
  666. " [ 0.8 1. 0.125 ..., 0.11111111 0.11111111\n",
  667. " 0.11111111]\n",
  668. " [ 0.14285714 0.125 1. ..., 0.8 0.8 0.8 ]\n",
  669. " ..., \n",
  670. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n",
  671. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n",
  672. " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]]\n",
  673. "\n",
  674. " Saving kernel matrix to file...\n",
  675. "\n",
  676. " Mean performance on train set: 38.880117\n",
  677. "With standard deviation: 0.623999\n",
  678. "\n",
  679. " Mean performance on test set: 39.174317\n",
  680. "With standard deviation: 6.195371\n",
  681. "\n",
  682. "\n",
  683. " #--- calculating kernel matrix when depth = 2.0 ---#\n",
  684. "\n",
  685. " Loading dataset from file...\n",
  686. "\n",
  687. " Calculating kernel matrix, this could take a while...\n",
  688. "\n",
  689. " --- kernel matrix of path kernel up to 2 of size 185 built in 0.33235955238342285 seconds ---\n",
  690. "[[ 1. 0.5 0.11111111 ..., 0.07692308 0.07692308\n",
  691. " 0.07692308]\n",
  692. " [ 0.5 1. 0.09090909 ..., 0.06666667 0.06666667\n",
  693. " 0.06666667]\n",
  694. " [ 0.11111111 0.09090909 1. ..., 0.55555556 0.55555556\n",
  695. " 0.55555556]\n",
  696. " ..., \n",
  697. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n",
  698. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n",
  699. " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]]\n",
  700. "\n",
  701. " Saving kernel matrix to file...\n",
  702. "\n",
  703. " Mean performance on train set: 35.348332\n",
  704. "With standard deviation: 0.727833\n",
  705. "\n",
  706. " Mean performance on test set: 35.604226\n",
  707. "With standard deviation: 4.539211\n",
  708. "\n",
  709. "\n",
  710. " #--- calculating kernel matrix when depth = 3.0 ---#\n",
  711. "\n",
  712. " Loading dataset from file...\n",
  713. "\n",
  714. " Calculating kernel matrix, this could take a while...\n",
  715. "\n",
  716. " --- kernel matrix of path kernel up to 3 of size 185 built in 0.5400393009185791 seconds ---\n",
  717. "[[ 1. 0.44444444 0.11111111 ..., 0.05555556 0.05555556\n",
  718. " 0.05555556]\n",
  719. " [ 0.44444444 1. 0.08333333 ..., 0.04761905 0.04761905\n",
  720. " 0.04761905]\n",
  721. " [ 0.11111111 0.08333333 1. ..., 0.35714286 0.35714286\n",
  722. " 0.35714286]\n",
  723. " ..., \n",
  724. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n",
  725. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n",
  726. " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]]\n",
  727. "\n",
  728. " Saving kernel matrix to file...\n",
  729. "\n",
  730. " Mean performance on train set: 28.047646\n",
  731. "With standard deviation: 1.077805\n",
  732. "\n",
  733. " Mean performance on test set: 30.192177\n",
  734. "With standard deviation: 5.110324\n",
  735. "\n",
  736. "\n",
  737. " #--- calculating kernel matrix when depth = 4.0 ---#\n",
  738. "\n",
  739. " Loading dataset from file...\n",
  740. "\n",
  741. " Calculating kernel matrix, this could take a while...\n",
  742. "\n",
  743. " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8054666519165039 seconds ---\n",
  744. "[[ 1. 0.44444444 0.11111111 ..., 0.04347826 0.04166667\n",
  745. " 0.04347826]\n",
  746. " [ 0.44444444 1. 0.08333333 ..., 0.03846154 0.03703704\n",
  747. " 0.03846154]\n",
  748. " [ 0.11111111 0.08333333 1. ..., 0.26315789 0.25 0.26315789]\n",
  749. " ..., \n",
  750. " [ 0.04347826 0.03846154 0.26315789 ..., 1. 0.95 0.9 ]\n",
  751. " [ 0.04166667 0.03703704 0.25 ..., 0.95 1. 0.95 ]\n",
  752. " [ 0.04347826 0.03846154 0.26315789 ..., 0.9 0.95 1. ]]\n",
  753. "\n",
  754. " Saving kernel matrix to file...\n"
  755. ]
  756. },
  757. {
  758. "name": "stdout",
  759. "output_type": "stream",
  760. "text": [
  761. "\n",
  762. " Mean performance on train set: 18.878595\n",
  763. "With standard deviation: 1.711897\n",
  764. "\n",
  765. " Mean performance on test set: 23.751530\n",
  766. "With standard deviation: 7.808559\n",
  767. "\n",
  768. "\n",
  769. " #--- calculating kernel matrix when depth = 5.0 ---#\n",
  770. "\n",
  771. " Loading dataset from file...\n",
  772. "\n",
  773. " Calculating kernel matrix, this could take a while...\n",
  774. "\n",
  775. " --- kernel matrix of path kernel up to 5 of size 185 built in 1.0195980072021484 seconds ---\n",
  776. "[[ 1. 0.44444444 0.11111111 ..., 0.03703704 0.03333333\n",
  777. " 0.03571429]\n",
  778. " [ 0.44444444 1. 0.08333333 ..., 0.03333333 0.03030303\n",
  779. " 0.03225806]\n",
  780. " [ 0.11111111 0.08333333 1. ..., 0.2173913 0.19230769\n",
  781. " 0.20833333]\n",
  782. " ..., \n",
  783. " [ 0.03703704 0.03333333 0.2173913 ..., 1. 0.88461538\n",
  784. " 0.74074074]\n",
  785. " [ 0.03333333 0.03030303 0.19230769 ..., 0.88461538 1. 0.85185185]\n",
  786. " [ 0.03571429 0.03225806 0.20833333 ..., 0.74074074 0.85185185 1. ]]\n",
  787. "\n",
  788. " Saving kernel matrix to file...\n",
  789. "\n",
  790. " Mean performance on train set: 16.339135\n",
  791. "With standard deviation: 1.397693\n",
  792. "\n",
  793. " Mean performance on test set: 23.482309\n",
  794. "With standard deviation: 7.727117\n",
  795. "\n",
  796. "\n",
  797. " #--- calculating kernel matrix when depth = 6.0 ---#\n",
  798. "\n",
  799. " Loading dataset from file...\n",
  800. "\n",
  801. " Calculating kernel matrix, this could take a while...\n",
  802. "\n",
  803. " --- kernel matrix of path kernel up to 6 of size 185 built in 1.2962956428527832 seconds ---\n",
  804. "[[ 1. 0.44444444 0.11111111 ..., 0.03333333 0.02857143\n",
  805. " 0.03030303]\n",
  806. " [ 0.44444444 1. 0.08333333 ..., 0.03030303 0.02631579\n",
  807. " 0.02777778]\n",
  808. " [ 0.11111111 0.08333333 1. ..., 0.19230769 0.16129032\n",
  809. " 0.17241379]\n",
  810. " ..., \n",
  811. " [ 0.03333333 0.03030303 0.19230769 ..., 1. 0.83870968\n",
  812. " 0.57142857]\n",
  813. " [ 0.02857143 0.02631579 0.16129032 ..., 0.83870968 1. 0.71428571]\n",
  814. " [ 0.03030303 0.02777778 0.17241379 ..., 0.57142857 0.71428571 1. ]]\n",
  815. "\n",
  816. " Saving kernel matrix to file...\n",
  817. "\n",
  818. " Mean performance on train set: 12.523830\n",
  819. "With standard deviation: 1.040404\n",
  820. "\n",
  821. " Mean performance on test set: 22.745367\n",
  822. "With standard deviation: 8.028051\n",
  823. "\n",
  824. "\n",
  825. " #--- calculating kernel matrix when depth = 7.0 ---#\n",
  826. "\n",
  827. " Loading dataset from file...\n",
  828. "\n",
  829. " Calculating kernel matrix, this could take a while...\n",
  830. "\n",
  831. " --- kernel matrix of path kernel up to 7 of size 185 built in 1.5462064743041992 seconds ---\n",
  832. "[[ 1. 0.44444444 0.11111111 ..., 0.03125 0.02564103\n",
  833. " 0.02631579]\n",
  834. " [ 0.44444444 1. 0.08333333 ..., 0.02857143 0.02380952\n",
  835. " 0.02439024]\n",
  836. " [ 0.11111111 0.08333333 1. ..., 0.17857143 0.14285714\n",
  837. " 0.14705882]\n",
  838. " ..., \n",
  839. " [ 0.03125 0.02857143 0.17857143 ..., 1. 0.8 0.47619048]\n",
  840. " [ 0.02564103 0.02380952 0.14285714 ..., 0.8 1. 0.56818182]\n",
  841. " [ 0.02631579 0.02439024 0.14705882 ..., 0.47619048 0.56818182 1. ]]\n",
  842. "\n",
  843. " Saving kernel matrix to file...\n",
  844. "\n",
  845. " Mean performance on train set: 11.371668\n",
  846. "With standard deviation: 0.925446\n",
  847. "\n",
  848. " Mean performance on test set: 22.831602\n",
  849. "With standard deviation: 7.978369\n",
  850. "\n",
  851. "\n",
  852. " #--- calculating kernel matrix when depth = 8.0 ---#\n",
  853. "\n",
  854. " Loading dataset from file...\n",
  855. "\n",
  856. " Calculating kernel matrix, this could take a while...\n",
  857. "\n",
  858. " --- kernel matrix of path kernel up to 8 of size 185 built in 1.8658208847045898 seconds ---\n",
  859. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  860. " 0.02325581]\n",
  861. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  862. " 0.02173913]\n",
  863. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  864. " 0.12820513]\n",
  865. " ..., \n",
  866. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  867. " 0.41666667]\n",
  868. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.49019608]\n",
  869. " [ 0.02325581 0.02173913 0.12820513 ..., 0.41666667 0.49019608 1. ]]\n",
  870. "\n",
  871. " Saving kernel matrix to file...\n",
  872. "\n",
  873. " Mean performance on train set: 10.132106\n",
  874. "With standard deviation: 0.525580\n",
  875. "\n",
  876. " Mean performance on test set: 22.586071\n",
  877. "With standard deviation: 8.067887\n",
  878. "\n",
  879. "\n",
  880. " #--- calculating kernel matrix when depth = 9.0 ---#\n",
  881. "\n",
  882. " Loading dataset from file...\n",
  883. "\n",
  884. " Calculating kernel matrix, this could take a while...\n",
  885. "\n",
  886. " --- kernel matrix of path kernel up to 9 of size 185 built in 2.185042381286621 seconds ---\n",
  887. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  888. " 0.0212766 ]\n",
  889. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727 0.02 ]\n",
  890. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  891. " 0.11627907]\n",
  892. " ..., \n",
  893. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  894. " 0.38461538]\n",
  895. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.45454545]\n",
  896. " [ 0.0212766 0.02 0.11627907 ..., 0.38461538 0.45454545 1. ]]\n",
  897. "\n",
  898. " Saving kernel matrix to file...\n",
  899. "\n",
  900. " Mean performance on train set: 10.078464\n",
  901. "With standard deviation: 0.518149\n",
  902. "\n",
  903. " Mean performance on test set: 22.766801\n",
  904. "With standard deviation: 8.005709\n",
  905. "\n",
  906. "\n",
  907. " #--- calculating kernel matrix when depth = 10.0 ---#\n",
  908. "\n",
  909. " Loading dataset from file...\n",
  910. "\n",
  911. " Calculating kernel matrix, this could take a while...\n",
  912. "\n",
  913. " --- kernel matrix of path kernel up to 10 of size 185 built in 2.35276198387146 seconds ---\n",
  914. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  915. " 0.02040816]\n",
  916. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  917. " 0.01923077]\n",
  918. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  919. " 0.11111111]\n",
  920. " ..., \n",
  921. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  922. " 0.37037037]\n",
  923. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  924. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  925. "\n",
  926. " Saving kernel matrix to file...\n",
  927. "\n",
  928. " Mean performance on train set: 10.075607\n",
  929. "With standard deviation: 0.672820\n",
  930. "\n",
  931. " Mean performance on test set: 22.869720\n",
  932. "With standard deviation: 7.944560\n",
  933. "\n",
  934. "\n",
  935. " #--- calculating kernel matrix when depth = 11.0 ---#\n",
  936. "\n",
  937. " Loading dataset from file...\n",
  938. "\n",
  939. " Calculating kernel matrix, this could take a while...\n",
  940. "\n",
  941. " --- kernel matrix of path kernel up to 11 of size 185 built in 2.6274359226226807 seconds ---\n",
  942. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  943. " 0.02040816]\n",
  944. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  945. " 0.01923077]\n",
  946. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  947. " 0.11111111]\n",
  948. " ..., \n",
  949. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  950. " 0.37037037]\n",
  951. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  952. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  953. "\n",
  954. " Saving kernel matrix to file...\n",
  955. "\n",
  956. " Mean performance on train set: 10.075607\n",
  957. "With standard deviation: 0.672820\n",
  958. "\n",
  959. " Mean performance on test set: 22.869720\n",
  960. "With standard deviation: 7.944560\n",
  961. "\n",
  962. "\n",
  963. " #--- calculating kernel matrix when depth = 12.0 ---#\n",
  964. "\n",
  965. " Loading dataset from file...\n",
  966. "\n",
  967. " Calculating kernel matrix, this could take a while...\n",
  968. "\n",
  969. " --- kernel matrix of path kernel up to 12 of size 185 built in 2.7209105491638184 seconds ---\n",
  970. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  971. " 0.02040816]\n",
  972. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  973. " 0.01923077]\n",
  974. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  975. " 0.11111111]\n",
  976. " ..., \n",
  977. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  978. " 0.37037037]\n",
  979. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  980. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  981. "\n",
  982. " Saving kernel matrix to file...\n",
  983. "\n",
  984. " Mean performance on train set: 10.075607\n",
  985. "With standard deviation: 0.672820\n",
  986. "\n",
  987. " Mean performance on test set: 22.869720\n",
  988. "With standard deviation: 7.944560\n",
  989. "\n",
  990. "\n",
  991. " #--- calculating kernel matrix when depth = 13.0 ---#\n",
  992. "\n",
  993. " Loading dataset from file...\n",
  994. "\n",
  995. " Calculating kernel matrix, this could take a while...\n",
  996. "\n",
  997. " --- kernel matrix of path kernel up to 13 of size 185 built in 2.699059247970581 seconds ---\n",
  998. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  999. " 0.02040816]\n",
  1000. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1001. " 0.01923077]\n",
  1002. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1003. " 0.11111111]\n",
  1004. " ..., \n",
  1005. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1006. " 0.37037037]\n",
  1007. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1008. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1009. "\n",
  1010. " Saving kernel matrix to file...\n"
  1011. ]
  1012. },
  1013. {
  1014. "name": "stdout",
  1015. "output_type": "stream",
  1016. "text": [
  1017. "\n",
  1018. " Mean performance on train set: 10.075607\n",
  1019. "With standard deviation: 0.672820\n",
  1020. "\n",
  1021. " Mean performance on test set: 22.869720\n",
  1022. "With standard deviation: 7.944560\n",
  1023. "\n",
  1024. "\n",
  1025. " #--- calculating kernel matrix when depth = 14.0 ---#\n",
  1026. "\n",
  1027. " Loading dataset from file...\n",
  1028. "\n",
  1029. " Calculating kernel matrix, this could take a while...\n",
  1030. "\n",
  1031. " --- kernel matrix of path kernel up to 14 of size 185 built in 2.6328344345092773 seconds ---\n",
  1032. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1033. " 0.02040816]\n",
  1034. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1035. " 0.01923077]\n",
  1036. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1037. " 0.11111111]\n",
  1038. " ..., \n",
  1039. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1040. " 0.37037037]\n",
  1041. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1042. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1043. "\n",
  1044. " Saving kernel matrix to file...\n",
  1045. "\n",
  1046. " Mean performance on train set: 10.075607\n",
  1047. "With standard deviation: 0.672820\n",
  1048. "\n",
  1049. " Mean performance on test set: 22.869720\n",
  1050. "With standard deviation: 7.944560\n",
  1051. "\n",
  1052. "\n",
  1053. " #--- calculating kernel matrix when depth = 15.0 ---#\n",
  1054. "\n",
  1055. " Loading dataset from file...\n",
  1056. "\n",
  1057. " Calculating kernel matrix, this could take a while...\n",
  1058. "\n",
  1059. " --- kernel matrix of path kernel up to 15 of size 185 built in 2.6556999683380127 seconds ---\n",
  1060. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1061. " 0.02040816]\n",
  1062. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1063. " 0.01923077]\n",
  1064. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1065. " 0.11111111]\n",
  1066. " ..., \n",
  1067. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1068. " 0.37037037]\n",
  1069. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1070. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1071. "\n",
  1072. " Saving kernel matrix to file...\n",
  1073. "\n",
  1074. " Mean performance on train set: 10.075607\n",
  1075. "With standard deviation: 0.672820\n",
  1076. "\n",
  1077. " Mean performance on test set: 22.869720\n",
  1078. "With standard deviation: 7.944560\n",
  1079. "\n",
  1080. "\n",
  1081. " #--- calculating kernel matrix when depth = 16.0 ---#\n",
  1082. "\n",
  1083. " Loading dataset from file...\n",
  1084. "\n",
  1085. " Calculating kernel matrix, this could take a while...\n",
  1086. "\n",
  1087. " --- kernel matrix of path kernel up to 16 of size 185 built in 2.621814012527466 seconds ---\n",
  1088. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1089. " 0.02040816]\n",
  1090. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1091. " 0.01923077]\n",
  1092. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1093. " 0.11111111]\n",
  1094. " ..., \n",
  1095. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1096. " 0.37037037]\n",
  1097. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1098. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1099. "\n",
  1100. " Saving kernel matrix to file...\n",
  1101. "\n",
  1102. " Mean performance on train set: 10.075607\n",
  1103. "With standard deviation: 0.672820\n",
  1104. "\n",
  1105. " Mean performance on test set: 22.869720\n",
  1106. "With standard deviation: 7.944560\n",
  1107. "\n",
  1108. "\n",
  1109. " #--- calculating kernel matrix when depth = 17.0 ---#\n",
  1110. "\n",
  1111. " Loading dataset from file...\n",
  1112. "\n",
  1113. " Calculating kernel matrix, this could take a while...\n",
  1114. "\n",
  1115. " --- kernel matrix of path kernel up to 17 of size 185 built in 2.5938243865966797 seconds ---\n",
  1116. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1117. " 0.02040816]\n",
  1118. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1119. " 0.01923077]\n",
  1120. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1121. " 0.11111111]\n",
  1122. " ..., \n",
  1123. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1124. " 0.37037037]\n",
  1125. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1126. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1127. "\n",
  1128. " Saving kernel matrix to file...\n",
  1129. "\n",
  1130. " Mean performance on train set: 10.075607\n",
  1131. "With standard deviation: 0.672820\n",
  1132. "\n",
  1133. " Mean performance on test set: 22.869720\n",
  1134. "With standard deviation: 7.944560\n",
  1135. "\n",
  1136. "\n",
  1137. " #--- calculating kernel matrix when depth = 18.0 ---#\n",
  1138. "\n",
  1139. " Loading dataset from file...\n",
  1140. "\n",
  1141. " Calculating kernel matrix, this could take a while...\n",
  1142. "\n",
  1143. " --- kernel matrix of path kernel up to 18 of size 185 built in 2.65336275100708 seconds ---\n",
  1144. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1145. " 0.02040816]\n",
  1146. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1147. " 0.01923077]\n",
  1148. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1149. " 0.11111111]\n",
  1150. " ..., \n",
  1151. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1152. " 0.37037037]\n",
  1153. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1154. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1155. "\n",
  1156. " Saving kernel matrix to file...\n",
  1157. "\n",
  1158. " Mean performance on train set: 10.075607\n",
  1159. "With standard deviation: 0.672820\n",
  1160. "\n",
  1161. " Mean performance on test set: 22.869720\n",
  1162. "With standard deviation: 7.944560\n",
  1163. "\n",
  1164. "\n",
  1165. " #--- calculating kernel matrix when depth = 19.0 ---#\n",
  1166. "\n",
  1167. " Loading dataset from file...\n",
  1168. "\n",
  1169. " Calculating kernel matrix, this could take a while...\n",
  1170. "\n",
  1171. " --- kernel matrix of path kernel up to 19 of size 185 built in 2.628486156463623 seconds ---\n",
  1172. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1173. " 0.02040816]\n",
  1174. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1175. " 0.01923077]\n",
  1176. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1177. " 0.11111111]\n",
  1178. " ..., \n",
  1179. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1180. " 0.37037037]\n",
  1181. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1182. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1183. "\n",
  1184. " Saving kernel matrix to file...\n",
  1185. "\n",
  1186. " Mean performance on train set: 10.075607\n",
  1187. "With standard deviation: 0.672820\n",
  1188. "\n",
  1189. " Mean performance on test set: 22.869720\n",
  1190. "With standard deviation: 7.944560\n",
  1191. "\n",
  1192. "\n",
  1193. " #--- calculating kernel matrix when depth = 20.0 ---#\n",
  1194. "\n",
  1195. " Loading dataset from file...\n",
  1196. "\n",
  1197. " Calculating kernel matrix, this could take a while...\n",
  1198. "\n",
  1199. " --- kernel matrix of path kernel up to 20 of size 185 built in 2.682689666748047 seconds ---\n",
  1200. "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n",
  1201. " 0.02040816]\n",
  1202. " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n",
  1203. " 0.01923077]\n",
  1204. " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n",
  1205. " 0.11111111]\n",
  1206. " ..., \n",
  1207. " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n",
  1208. " 0.37037037]\n",
  1209. " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n",
  1210. " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n",
  1211. "\n",
  1212. " Saving kernel matrix to file...\n",
  1213. "\n",
  1214. " Mean performance on train set: 10.075607\n",
  1215. "With standard deviation: 0.672820\n",
  1216. "\n",
  1217. " Mean performance on test set: 22.869720\n",
  1218. "With standard deviation: 7.944560\n",
  1219. "\n",
  1220. "\n",
  1221. " depth rmse_test std_test rmse_train std_train k_time\n",
  1222. "------- ----------- ---------- ------------ ----------- --------\n",
  1223. " 0 42.6459 6.56063 42.7871 0.675806 0.102753\n",
  1224. " 1 39.1743 6.19537 38.8801 0.623999 0.183017\n",
  1225. " 2 35.6042 4.53921 35.3483 0.727833 0.33236\n",
  1226. " 3 30.1922 5.11032 28.0476 1.0778 0.540039\n",
  1227. " 4 23.7515 7.80856 18.8786 1.7119 0.805467\n",
  1228. " 5 23.4823 7.72712 16.3391 1.39769 1.0196\n",
  1229. " 6 22.7454 8.02805 12.5238 1.0404 1.2963\n",
  1230. " 7 22.8316 7.97837 11.3717 0.925446 1.54621\n",
  1231. " 8 22.5861 8.06789 10.1321 0.52558 1.86582\n",
  1232. " 9 22.7668 8.00571 10.0785 0.518149 2.18504\n",
  1233. " 10 22.8697 7.94456 10.0756 0.67282 2.35276\n",
  1234. " 11 22.8697 7.94456 10.0756 0.67282 2.62744\n",
  1235. " 12 22.8697 7.94456 10.0756 0.67282 2.72091\n",
  1236. " 13 22.8697 7.94456 10.0756 0.67282 2.69906\n",
  1237. " 14 22.8697 7.94456 10.0756 0.67282 2.63283\n",
  1238. " 15 22.8697 7.94456 10.0756 0.67282 2.6557\n",
  1239. " 16 22.8697 7.94456 10.0756 0.67282 2.62181\n",
  1240. " 17 22.8697 7.94456 10.0756 0.67282 2.59382\n",
  1241. " 18 22.8697 7.94456 10.0756 0.67282 2.65336\n",
  1242. " 19 22.8697 7.94456 10.0756 0.67282 2.62849\n",
  1243. " 20 22.8697 7.94456 10.0756 0.67282 2.68269\n",
  1244. "\n",
  1245. " --- This is a regression problem ---\n",
  1246. "\n",
  1247. "\n",
  1248. " #--- calculating kernel matrix when depth = 0.0 ---#\n",
  1249. "\n",
  1250. " Loading dataset from file...\n",
  1251. "\n",
  1252. " Calculating kernel matrix, this could take a while...\n"
  1253. ]
  1254. },
  1255. {
  1256. "name": "stdout",
  1257. "output_type": "stream",
  1258. "text": [
  1259. "\n",
  1260. " --- kernel matrix of path kernel up to 0 of size 185 built in 0.3893899917602539 seconds ---\n",
  1261. "[[ 1. 0.75 0.5 ..., 0.16666667 0.16666667\n",
  1262. " 0.16666667]\n",
  1263. " [ 0.75 1. 0.4 ..., 0.15384615 0.15384615\n",
  1264. " 0.15384615]\n",
  1265. " [ 0.5 0.4 1. ..., 0.27272727 0.27272727\n",
  1266. " 0.27272727]\n",
  1267. " ..., \n",
  1268. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n",
  1269. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n",
  1270. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]]\n",
  1271. "\n",
  1272. " Saving kernel matrix to file...\n",
  1273. "\n",
  1274. " Mean performance on train set: 12.207923\n",
  1275. "With standard deviation: 0.700182\n",
  1276. "\n",
  1277. " Mean performance on test set: 12.682718\n",
  1278. "With standard deviation: 2.748815\n",
  1279. "\n",
  1280. "\n",
  1281. " #--- calculating kernel matrix when depth = 1.0 ---#\n",
  1282. "\n",
  1283. " Loading dataset from file...\n",
  1284. "\n",
  1285. " Calculating kernel matrix, this could take a while...\n",
  1286. "\n",
  1287. " --- kernel matrix of path kernel up to 1 of size 185 built in 0.4729621410369873 seconds ---\n",
  1288. "[[ 1. 0.7 0.16666667 ..., 0.05555556 0.05555556\n",
  1289. " 0.05555556]\n",
  1290. " [ 0.7 1. 0.13333333 ..., 0.05128205 0.05128205\n",
  1291. " 0.05128205]\n",
  1292. " [ 0.16666667 0.13333333 1. ..., 0.22580645 0.22580645\n",
  1293. " 0.22580645]\n",
  1294. " ..., \n",
  1295. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n",
  1296. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n",
  1297. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]]\n",
  1298. "\n",
  1299. " Saving kernel matrix to file...\n",
  1300. "\n",
  1301. " Mean performance on train set: 10.279220\n",
  1302. "With standard deviation: 0.914688\n",
  1303. "\n",
  1304. " Mean performance on test set: 12.609828\n",
  1305. "With standard deviation: 2.372778\n",
  1306. "\n",
  1307. "\n",
  1308. " #--- calculating kernel matrix when depth = 2.0 ---#\n",
  1309. "\n",
  1310. " Loading dataset from file...\n",
  1311. "\n",
  1312. " Calculating kernel matrix, this could take a while...\n",
  1313. "\n",
  1314. " --- kernel matrix of path kernel up to 2 of size 185 built in 0.576836109161377 seconds ---\n",
  1315. "[[ 1. 0.4375 0.125 ..., 0.03333333 0.03333333\n",
  1316. " 0.03571429]\n",
  1317. " [ 0.4375 1. 0.0952381 ..., 0.03076923 0.03076923\n",
  1318. " 0.03278689]\n",
  1319. " [ 0.125 0.0952381 1. ..., 0.16981132 0.16981132\n",
  1320. " 0.18367347]\n",
  1321. " ..., \n",
  1322. " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n",
  1323. " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n",
  1324. " [ 0.03571429 0.03278689 0.18367347 ..., 0.9245283 0.9245283 1. ]]\n",
  1325. "\n",
  1326. " Saving kernel matrix to file...\n",
  1327. "\n",
  1328. " Mean performance on train set: 2.588811\n",
  1329. "With standard deviation: 0.557162\n",
  1330. "\n",
  1331. " Mean performance on test set: 8.060609\n",
  1332. "With standard deviation: 2.470450\n",
  1333. "\n",
  1334. "\n",
  1335. " #--- calculating kernel matrix when depth = 3.0 ---#\n",
  1336. "\n",
  1337. " Loading dataset from file...\n",
  1338. "\n",
  1339. " Calculating kernel matrix, this could take a while...\n",
  1340. "\n",
  1341. " --- kernel matrix of path kernel up to 3 of size 185 built in 0.7169125080108643 seconds ---\n",
  1342. "[[ 1. 0.38888889 0.125 ..., 0.02631579 0.02631579\n",
  1343. " 0.02777778]\n",
  1344. " [ 0.38888889 1. 0.08695652 ..., 0.02409639 0.02409639\n",
  1345. " 0.02531646]\n",
  1346. " [ 0.125 0.08695652 1. ..., 0.13043478 0.13043478\n",
  1347. " 0.13846154]\n",
  1348. " ..., \n",
  1349. " [ 0.02631579 0.02409639 0.13043478 ..., 1. 0.94366197\n",
  1350. " 0.83561644]\n",
  1351. " [ 0.02631579 0.02409639 0.13043478 ..., 0.94366197 1. 0.78666667]\n",
  1352. " [ 0.02777778 0.02531646 0.13846154 ..., 0.83561644 0.78666667 1. ]]\n",
  1353. "\n",
  1354. " Saving kernel matrix to file...\n",
  1355. "\n",
  1356. " Mean performance on train set: 1.272670\n",
  1357. "With standard deviation: 0.760432\n",
  1358. "\n",
  1359. " Mean performance on test set: 9.755135\n",
  1360. "With standard deviation: 3.049170\n",
  1361. "\n",
  1362. "\n",
  1363. " #--- calculating kernel matrix when depth = 4.0 ---#\n",
  1364. "\n",
  1365. " Loading dataset from file...\n",
  1366. "\n",
  1367. " Calculating kernel matrix, this could take a while...\n",
  1368. "\n",
  1369. " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8342421054840088 seconds ---\n",
  1370. "[[ 1. 0.38888889 0.125 ..., 0.02222222 0.02222222\n",
  1371. " 0.02325581]\n",
  1372. " [ 0.38888889 1. 0.08695652 ..., 0.02061856 0.02061856\n",
  1373. " 0.02150538]\n",
  1374. " [ 0.125 0.08695652 1. ..., 0.10843373 0.10843373\n",
  1375. " 0.11392405]\n",
  1376. " ..., \n",
  1377. " [ 0.02222222 0.02061856 0.10843373 ..., 1. 0.82417582\n",
  1378. " 0.67010309]\n",
  1379. " [ 0.02222222 0.02061856 0.10843373 ..., 0.82417582 1. 0.70526316]\n",
  1380. " [ 0.02325581 0.02150538 0.11392405 ..., 0.67010309 0.70526316 1. ]]\n",
  1381. "\n",
  1382. " Saving kernel matrix to file...\n",
  1383. "\n",
  1384. " Mean performance on train set: 1.032293\n",
  1385. "With standard deviation: 0.728380\n",
  1386. "\n",
  1387. " Mean performance on test set: 10.319167\n",
  1388. "With standard deviation: 3.616673\n",
  1389. "\n",
  1390. "\n",
  1391. " #--- calculating kernel matrix when depth = 5.0 ---#\n",
  1392. "\n",
  1393. " Loading dataset from file...\n",
  1394. "\n",
  1395. " Calculating kernel matrix, this could take a while...\n",
  1396. "\n",
  1397. " --- kernel matrix of path kernel up to 5 of size 185 built in 0.9938209056854248 seconds ---\n",
  1398. "[[ 1. 0.38888889 0.125 ..., 0.01960784 0.01960784\n",
  1399. " 0.02040816]\n",
  1400. " [ 0.38888889 1. 0.08695652 ..., 0.01834862 0.01834862\n",
  1401. " 0.01904762]\n",
  1402. " [ 0.125 0.08695652 1. ..., 0.09473684 0.09473684\n",
  1403. " 0.0989011 ]\n",
  1404. " ..., \n",
  1405. " [ 0.01960784 0.01834862 0.09473684 ..., 1. 0.74311927\n",
  1406. " 0.56302521]\n",
  1407. " [ 0.01960784 0.01834862 0.09473684 ..., 0.74311927 1. 0.6173913 ]\n",
  1408. " [ 0.02040816 0.01904762 0.0989011 ..., 0.56302521 0.6173913 1. ]]\n",
  1409. "\n",
  1410. " Saving kernel matrix to file...\n",
  1411. "\n",
  1412. " Mean performance on train set: 0.923543\n",
  1413. "With standard deviation: 0.660532\n",
  1414. "\n",
  1415. " Mean performance on test set: 10.659250\n",
  1416. "With standard deviation: 4.120523\n",
  1417. "\n",
  1418. "\n",
  1419. " #--- calculating kernel matrix when depth = 6.0 ---#\n",
  1420. "\n",
  1421. " Loading dataset from file...\n",
  1422. "\n",
  1423. " Calculating kernel matrix, this could take a while...\n",
  1424. "\n",
  1425. " --- kernel matrix of path kernel up to 6 of size 185 built in 1.1753439903259277 seconds ---\n",
  1426. "[[ 1. 0.38888889 0.125 ..., 0.01785714 0.01785714\n",
  1427. " 0.01851852]\n",
  1428. " [ 0.38888889 1. 0.08695652 ..., 0.01680672 0.01680672\n",
  1429. " 0.0173913 ]\n",
  1430. " [ 0.125 0.08695652 1. ..., 0.08571429 0.08571429\n",
  1431. " 0.08910891]\n",
  1432. " ..., \n",
  1433. " [ 0.01785714 0.01680672 0.08571429 ..., 1. 0.68 0.48201439]\n",
  1434. " [ 0.01785714 0.01680672 0.08571429 ..., 0.68 1. 0.54887218]\n",
  1435. " [ 0.01851852 0.0173913 0.08910891 ..., 0.48201439 0.54887218 1. ]]\n",
  1436. "\n",
  1437. " Saving kernel matrix to file...\n",
  1438. "\n",
  1439. " Mean performance on train set: 0.878589\n",
  1440. "With standard deviation: 0.603598\n",
  1441. "\n",
  1442. " Mean performance on test set: 11.102521\n",
  1443. "With standard deviation: 4.330554\n",
  1444. "\n",
  1445. "\n",
  1446. " #--- calculating kernel matrix when depth = 7.0 ---#\n",
  1447. "\n",
  1448. " Loading dataset from file...\n",
  1449. "\n",
  1450. " Calculating kernel matrix, this could take a while...\n",
  1451. "\n",
  1452. " --- kernel matrix of path kernel up to 7 of size 185 built in 1.4358420372009277 seconds ---\n",
  1453. "[[ 1. 0.38888889 0.125 ..., 0.01666667 0.01666667\n",
  1454. " 0.01724138]\n",
  1455. " [ 0.38888889 1. 0.08695652 ..., 0.01574803 0.01574803\n",
  1456. " 0.01626016]\n",
  1457. " [ 0.125 0.08695652 1. ..., 0.07964602 0.07964602\n",
  1458. " 0.08256881]\n",
  1459. " ..., \n",
  1460. " [ 0.01666667 0.01574803 0.07964602 ..., 1. 0.64963504\n",
  1461. " 0.43225806]\n",
  1462. " [ 0.01666667 0.01574803 0.07964602 ..., 0.64963504 1. 0.48993289]\n",
  1463. " [ 0.01724138 0.01626016 0.08256881 ..., 0.43225806 0.48993289 1. ]]\n",
  1464. "\n",
  1465. " Saving kernel matrix to file...\n",
  1466. "\n",
  1467. " Mean performance on train set: 0.944049\n",
  1468. "With standard deviation: 0.694844\n",
  1469. "\n",
  1470. " Mean performance on test set: 11.352962\n",
  1471. "With standard deviation: 4.305459\n",
  1472. "\n",
  1473. "\n",
  1474. " #--- calculating kernel matrix when depth = 8.0 ---#\n",
  1475. "\n",
  1476. " Loading dataset from file...\n",
  1477. "\n",
  1478. " Calculating kernel matrix, this could take a while...\n",
  1479. "\n",
  1480. " --- kernel matrix of path kernel up to 8 of size 185 built in 1.7005987167358398 seconds ---\n",
  1481. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n",
  1482. " 0.01639344]\n",
  1483. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1484. " 0.01550388]\n",
  1485. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1486. " 0.07826087]\n",
  1487. " ..., \n",
  1488. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1489. " 0.3964497 ]\n",
  1490. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.44785276]\n",
  1491. " [ 0.01639344 0.01550388 0.07826087 ..., 0.3964497 0.44785276 1. ]]\n",
  1492. "\n",
  1493. " Saving kernel matrix to file...\n",
  1494. "\n",
  1495. " Mean performance on train set: 1.033979\n",
  1496. "With standard deviation: 0.775622\n",
  1497. "\n",
  1498. " Mean performance on test set: 11.298981\n",
  1499. "With standard deviation: 4.349648\n",
  1500. "\n",
  1501. "\n",
  1502. " #--- calculating kernel matrix when depth = 9.0 ---#\n",
  1503. "\n",
  1504. " Loading dataset from file...\n",
  1505. "\n",
  1506. " Calculating kernel matrix, this could take a while...\n"
  1507. ]
  1508. },
  1509. {
  1510. "name": "stdout",
  1511. "output_type": "stream",
  1512. "text": [
  1513. "\n",
  1514. " --- kernel matrix of path kernel up to 9 of size 185 built in 2.0194287300109863 seconds ---\n",
  1515. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n",
  1516. " 0.01587302]\n",
  1517. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1518. " 0.01503759]\n",
  1519. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1520. " 0.07563025]\n",
  1521. " ..., \n",
  1522. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1523. " 0.38728324]\n",
  1524. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43712575]\n",
  1525. " [ 0.01587302 0.01503759 0.07563025 ..., 0.38728324 0.43712575 1. ]]\n",
  1526. "\n",
  1527. " Saving kernel matrix to file...\n",
  1528. "\n",
  1529. " Mean performance on train set: 1.003187\n",
  1530. "With standard deviation: 0.572070\n",
  1531. "\n",
  1532. " Mean performance on test set: 11.332669\n",
  1533. "With standard deviation: 4.324120\n",
  1534. "\n",
  1535. "\n",
  1536. " #--- calculating kernel matrix when depth = 10.0 ---#\n",
  1537. "\n",
  1538. " Loading dataset from file...\n",
  1539. "\n",
  1540. " Calculating kernel matrix, this could take a while...\n",
  1541. "\n",
  1542. " --- kernel matrix of path kernel up to 10 of size 185 built in 2.243326187133789 seconds ---\n",
  1543. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625 0.015625 ]\n",
  1544. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1545. " 0.01481481]\n",
  1546. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1547. " 0.07438017]\n",
  1548. " ..., \n",
  1549. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1550. " 0.38285714]\n",
  1551. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43195266]\n",
  1552. " [ 0.015625 0.01481481 0.07438017 ..., 0.38285714 0.43195266 1. ]]\n",
  1553. "\n",
  1554. " Saving kernel matrix to file...\n",
  1555. "\n",
  1556. " Mean performance on train set: 1.002272\n",
  1557. "With standard deviation: 0.570937\n",
  1558. "\n",
  1559. " Mean performance on test set: 11.343515\n",
  1560. "With standard deviation: 4.327265\n",
  1561. "\n",
  1562. "\n",
  1563. " depth rmse_test std_test rmse_train std_train k_time\n",
  1564. "------- ----------- ---------- ------------ ----------- --------\n",
  1565. " 0 12.6827 2.74882 12.2079 0.700182 0.38939\n",
  1566. " 1 12.6098 2.37278 10.2792 0.914688 0.472962\n",
  1567. " 2 8.06061 2.47045 2.58881 0.557162 0.576836\n",
  1568. " 3 9.75514 3.04917 1.27267 0.760432 0.716913\n",
  1569. " 4 10.3192 3.61667 1.03229 0.72838 0.834242\n",
  1570. " 5 10.6593 4.12052 0.923543 0.660532 0.993821\n",
  1571. " 6 11.1025 4.33055 0.878589 0.603598 1.17534\n",
  1572. " 7 11.353 4.30546 0.944049 0.694844 1.43584\n",
  1573. " 8 11.299 4.34965 1.03398 0.775622 1.7006\n",
  1574. " 9 11.3327 4.32412 1.00319 0.57207 2.01943\n",
  1575. " 10 11.3435 4.32726 1.00227 0.570937 2.24333\n",
  1576. "\n",
  1577. " --- This is a regression problem ---\n",
  1578. "\n",
  1579. "\n",
  1580. " #--- calculating kernel matrix when depth = 0.0 ---#\n",
  1581. "\n",
  1582. " Loading dataset from file...\n",
  1583. "\n",
  1584. " Calculating kernel matrix, this could take a while...\n",
  1585. "\n",
  1586. " --- kernel matrix of path kernel up to 0 of size 185 built in 0.3775763511657715 seconds ---\n",
  1587. "[[ 1. 0.75 0.5 ..., 0.16666667 0.16666667\n",
  1588. " 0.16666667]\n",
  1589. " [ 0.75 1. 0.4 ..., 0.15384615 0.15384615\n",
  1590. " 0.15384615]\n",
  1591. " [ 0.5 0.4 1. ..., 0.27272727 0.27272727\n",
  1592. " 0.27272727]\n",
  1593. " ..., \n",
  1594. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n",
  1595. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n",
  1596. " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]]\n",
  1597. "\n",
  1598. " Saving kernel matrix to file...\n",
  1599. "\n",
  1600. " Mean performance on train set: 12.120872\n",
  1601. "With standard deviation: 0.500467\n",
  1602. "\n",
  1603. " Mean performance on test set: 12.579966\n",
  1604. "With standard deviation: 2.732346\n",
  1605. "\n",
  1606. "\n",
  1607. " #--- calculating kernel matrix when depth = 1.0 ---#\n",
  1608. "\n",
  1609. " Loading dataset from file...\n",
  1610. "\n",
  1611. " Calculating kernel matrix, this could take a while...\n",
  1612. "\n",
  1613. " --- kernel matrix of path kernel up to 1 of size 185 built in 0.4563324451446533 seconds ---\n",
  1614. "[[ 1. 0.7 0.16666667 ..., 0.05555556 0.05555556\n",
  1615. " 0.05555556]\n",
  1616. " [ 0.7 1. 0.13333333 ..., 0.05128205 0.05128205\n",
  1617. " 0.05128205]\n",
  1618. " [ 0.16666667 0.13333333 1. ..., 0.22580645 0.22580645\n",
  1619. " 0.22580645]\n",
  1620. " ..., \n",
  1621. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n",
  1622. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n",
  1623. " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]]\n",
  1624. "\n",
  1625. " Saving kernel matrix to file...\n",
  1626. "\n",
  1627. " Mean performance on train set: 10.224322\n",
  1628. "With standard deviation: 0.734261\n",
  1629. "\n",
  1630. " Mean performance on test set: 12.621509\n",
  1631. "With standard deviation: 2.188664\n",
  1632. "\n",
  1633. "\n",
  1634. " #--- calculating kernel matrix when depth = 2.0 ---#\n",
  1635. "\n",
  1636. " Loading dataset from file...\n",
  1637. "\n",
  1638. " Calculating kernel matrix, this could take a while...\n",
  1639. "\n",
  1640. " --- kernel matrix of path kernel up to 2 of size 185 built in 0.5852782726287842 seconds ---\n",
  1641. "[[ 1. 0.4375 0.125 ..., 0.03333333 0.03333333\n",
  1642. " 0.03571429]\n",
  1643. " [ 0.4375 1. 0.0952381 ..., 0.03076923 0.03076923\n",
  1644. " 0.03278689]\n",
  1645. " [ 0.125 0.0952381 1. ..., 0.16981132 0.16981132\n",
  1646. " 0.18367347]\n",
  1647. " ..., \n",
  1648. " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n",
  1649. " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n",
  1650. " [ 0.03571429 0.03278689 0.18367347 ..., 0.9245283 0.9245283 1. ]]\n",
  1651. "\n",
  1652. " Saving kernel matrix to file...\n",
  1653. "\n",
  1654. " Mean performance on train set: 2.718851\n",
  1655. "With standard deviation: 0.732922\n",
  1656. "\n",
  1657. " Mean performance on test set: 7.429032\n",
  1658. "With standard deviation: 2.693953\n",
  1659. "\n",
  1660. "\n",
  1661. " #--- calculating kernel matrix when depth = 3.0 ---#\n",
  1662. "\n",
  1663. " Loading dataset from file...\n",
  1664. "\n",
  1665. " Calculating kernel matrix, this could take a while...\n",
  1666. "\n",
  1667. " --- kernel matrix of path kernel up to 3 of size 185 built in 0.7065560817718506 seconds ---\n",
  1668. "[[ 1. 0.38888889 0.125 ..., 0.02631579 0.02631579\n",
  1669. " 0.02777778]\n",
  1670. " [ 0.38888889 1. 0.08695652 ..., 0.02409639 0.02409639\n",
  1671. " 0.02531646]\n",
  1672. " [ 0.125 0.08695652 1. ..., 0.13043478 0.13043478\n",
  1673. " 0.13846154]\n",
  1674. " ..., \n",
  1675. " [ 0.02631579 0.02409639 0.13043478 ..., 1. 0.94366197\n",
  1676. " 0.83561644]\n",
  1677. " [ 0.02631579 0.02409639 0.13043478 ..., 0.94366197 1. 0.78666667]\n",
  1678. " [ 0.02777778 0.02531646 0.13846154 ..., 0.83561644 0.78666667 1. ]]\n",
  1679. "\n",
  1680. " Saving kernel matrix to file...\n",
  1681. "\n",
  1682. " Mean performance on train set: 1.540000\n",
  1683. "With standard deviation: 1.138134\n",
  1684. "\n",
  1685. " Mean performance on test set: 9.024680\n",
  1686. "With standard deviation: 2.508084\n",
  1687. "\n",
  1688. "\n",
  1689. " #--- calculating kernel matrix when depth = 4.0 ---#\n",
  1690. "\n",
  1691. " Loading dataset from file...\n",
  1692. "\n",
  1693. " Calculating kernel matrix, this could take a while...\n",
  1694. "\n",
  1695. " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8479568958282471 seconds ---\n",
  1696. "[[ 1. 0.38888889 0.125 ..., 0.02222222 0.02222222\n",
  1697. " 0.02325581]\n",
  1698. " [ 0.38888889 1. 0.08695652 ..., 0.02061856 0.02061856\n",
  1699. " 0.02150538]\n",
  1700. " [ 0.125 0.08695652 1. ..., 0.10843373 0.10843373\n",
  1701. " 0.11392405]\n",
  1702. " ..., \n",
  1703. " [ 0.02222222 0.02061856 0.10843373 ..., 1. 0.82417582\n",
  1704. " 0.67010309]\n",
  1705. " [ 0.02222222 0.02061856 0.10843373 ..., 0.82417582 1. 0.70526316]\n",
  1706. " [ 0.02325581 0.02150538 0.11392405 ..., 0.67010309 0.70526316 1. ]]\n",
  1707. "\n",
  1708. " Saving kernel matrix to file...\n",
  1709. "\n",
  1710. " Mean performance on train set: 1.360291\n",
  1711. "With standard deviation: 1.423990\n",
  1712. "\n",
  1713. " Mean performance on test set: 10.081112\n",
  1714. "With standard deviation: 3.647700\n",
  1715. "\n",
  1716. "\n",
  1717. " #--- calculating kernel matrix when depth = 5.0 ---#\n",
  1718. "\n",
  1719. " Loading dataset from file...\n",
  1720. "\n",
  1721. " Calculating kernel matrix, this could take a while...\n",
  1722. "\n",
  1723. " --- kernel matrix of path kernel up to 5 of size 185 built in 1.0008597373962402 seconds ---\n",
  1724. "[[ 1. 0.38888889 0.125 ..., 0.01960784 0.01960784\n",
  1725. " 0.02040816]\n",
  1726. " [ 0.38888889 1. 0.08695652 ..., 0.01834862 0.01834862\n",
  1727. " 0.01904762]\n",
  1728. " [ 0.125 0.08695652 1. ..., 0.09473684 0.09473684\n",
  1729. " 0.0989011 ]\n",
  1730. " ..., \n",
  1731. " [ 0.01960784 0.01834862 0.09473684 ..., 1. 0.74311927\n",
  1732. " 0.56302521]\n",
  1733. " [ 0.01960784 0.01834862 0.09473684 ..., 0.74311927 1. 0.6173913 ]\n",
  1734. " [ 0.02040816 0.01904762 0.0989011 ..., 0.56302521 0.6173913 1. ]]\n",
  1735. "\n",
  1736. " Saving kernel matrix to file...\n",
  1737. "\n",
  1738. " Mean performance on train set: 1.085175\n",
  1739. "With standard deviation: 1.062063\n",
  1740. "\n",
  1741. " Mean performance on test set: 11.300476\n",
  1742. "With standard deviation: 4.441634\n",
  1743. "\n",
  1744. "\n",
  1745. " #--- calculating kernel matrix when depth = 6.0 ---#\n",
  1746. "\n",
  1747. " Loading dataset from file...\n",
  1748. "\n",
  1749. " Calculating kernel matrix, this could take a while...\n"
  1750. ]
  1751. },
  1752. {
  1753. "name": "stdout",
  1754. "output_type": "stream",
  1755. "text": [
  1756. "\n",
  1757. " --- kernel matrix of path kernel up to 6 of size 185 built in 1.1979196071624756 seconds ---\n",
  1758. "[[ 1. 0.38888889 0.125 ..., 0.01785714 0.01785714\n",
  1759. " 0.01851852]\n",
  1760. " [ 0.38888889 1. 0.08695652 ..., 0.01680672 0.01680672\n",
  1761. " 0.0173913 ]\n",
  1762. " [ 0.125 0.08695652 1. ..., 0.08571429 0.08571429\n",
  1763. " 0.08910891]\n",
  1764. " ..., \n",
  1765. " [ 0.01785714 0.01680672 0.08571429 ..., 1. 0.68 0.48201439]\n",
  1766. " [ 0.01785714 0.01680672 0.08571429 ..., 0.68 1. 0.54887218]\n",
  1767. " [ 0.01851852 0.0173913 0.08910891 ..., 0.48201439 0.54887218 1. ]]\n",
  1768. "\n",
  1769. " Saving kernel matrix to file...\n",
  1770. "\n",
  1771. " Mean performance on train set: 1.064431\n",
  1772. "With standard deviation: 1.001911\n",
  1773. "\n",
  1774. " Mean performance on test set: 12.186014\n",
  1775. "With standard deviation: 4.888158\n",
  1776. "\n",
  1777. "\n",
  1778. " #--- calculating kernel matrix when depth = 7.0 ---#\n",
  1779. "\n",
  1780. " Loading dataset from file...\n",
  1781. "\n",
  1782. " Calculating kernel matrix, this could take a while...\n",
  1783. "\n",
  1784. " --- kernel matrix of path kernel up to 7 of size 185 built in 1.4372029304504395 seconds ---\n",
  1785. "[[ 1. 0.38888889 0.125 ..., 0.01666667 0.01666667\n",
  1786. " 0.01724138]\n",
  1787. " [ 0.38888889 1. 0.08695652 ..., 0.01574803 0.01574803\n",
  1788. " 0.01626016]\n",
  1789. " [ 0.125 0.08695652 1. ..., 0.07964602 0.07964602\n",
  1790. " 0.08256881]\n",
  1791. " ..., \n",
  1792. " [ 0.01666667 0.01574803 0.07964602 ..., 1. 0.64963504\n",
  1793. " 0.43225806]\n",
  1794. " [ 0.01666667 0.01574803 0.07964602 ..., 0.64963504 1. 0.48993289]\n",
  1795. " [ 0.01724138 0.01626016 0.08256881 ..., 0.43225806 0.48993289 1. ]]\n",
  1796. "\n",
  1797. " Saving kernel matrix to file...\n",
  1798. "\n",
  1799. " Mean performance on train set: 1.199119\n",
  1800. "With standard deviation: 1.340313\n",
  1801. "\n",
  1802. " Mean performance on test set: 12.753387\n",
  1803. "With standard deviation: 5.145288\n",
  1804. "\n",
  1805. "\n",
  1806. " #--- calculating kernel matrix when depth = 8.0 ---#\n",
  1807. "\n",
  1808. " Loading dataset from file...\n",
  1809. "\n",
  1810. " Calculating kernel matrix, this could take a while...\n",
  1811. "\n",
  1812. " --- kernel matrix of path kernel up to 8 of size 185 built in 1.68448805809021 seconds ---\n",
  1813. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n",
  1814. " 0.01639344]\n",
  1815. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1816. " 0.01550388]\n",
  1817. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1818. " 0.07826087]\n",
  1819. " ..., \n",
  1820. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1821. " 0.3964497 ]\n",
  1822. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.44785276]\n",
  1823. " [ 0.01639344 0.01550388 0.07826087 ..., 0.3964497 0.44785276 1. ]]\n",
  1824. "\n",
  1825. " Saving kernel matrix to file...\n",
  1826. "\n",
  1827. " Mean performance on train set: 1.358221\n",
  1828. "With standard deviation: 1.843147\n",
  1829. "\n",
  1830. " Mean performance on test set: 13.047098\n",
  1831. "With standard deviation: 5.271835\n",
  1832. "\n",
  1833. "\n",
  1834. " #--- calculating kernel matrix when depth = 9.0 ---#\n",
  1835. "\n",
  1836. " Loading dataset from file...\n",
  1837. "\n",
  1838. " Calculating kernel matrix, this could take a while...\n",
  1839. "\n",
  1840. " --- kernel matrix of path kernel up to 9 of size 185 built in 1.9654510021209717 seconds ---\n",
  1841. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n",
  1842. " 0.01587302]\n",
  1843. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1844. " 0.01503759]\n",
  1845. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1846. " 0.07563025]\n",
  1847. " ..., \n",
  1848. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1849. " 0.38728324]\n",
  1850. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43712575]\n",
  1851. " [ 0.01587302 0.01503759 0.07563025 ..., 0.38728324 0.43712575 1. ]]\n",
  1852. "\n",
  1853. " Saving kernel matrix to file...\n",
  1854. "\n",
  1855. " Mean performance on train set: 1.360024\n",
  1856. "With standard deviation: 1.848342\n",
  1857. "\n",
  1858. " Mean performance on test set: 13.178933\n",
  1859. "With standard deviation: 5.277067\n",
  1860. "\n",
  1861. "\n",
  1862. " #--- calculating kernel matrix when depth = 10.0 ---#\n",
  1863. "\n",
  1864. " Loading dataset from file...\n",
  1865. "\n",
  1866. " Calculating kernel matrix, this could take a while...\n",
  1867. "\n",
  1868. " --- kernel matrix of path kernel up to 10 of size 185 built in 2.2494258880615234 seconds ---\n",
  1869. "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625 0.015625 ]\n",
  1870. " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n",
  1871. " 0.01481481]\n",
  1872. " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n",
  1873. " 0.07438017]\n",
  1874. " ..., \n",
  1875. " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n",
  1876. " 0.38285714]\n",
  1877. " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43195266]\n",
  1878. " [ 0.015625 0.01481481 0.07438017 ..., 0.38285714 0.43195266 1. ]]\n",
  1879. "\n",
  1880. " Saving kernel matrix to file...\n",
  1881. "\n",
  1882. " Mean performance on train set: 1.362078\n",
  1883. "With standard deviation: 1.854262\n",
  1884. "\n",
  1885. " Mean performance on test set: 13.253773\n",
  1886. "With standard deviation: 5.264247\n",
  1887. "\n",
  1888. "\n",
  1889. " depth rmse_test std_test rmse_train std_train k_time\n",
  1890. "------- ----------- ---------- ------------ ----------- --------\n",
  1891. " 0 12.58 2.73235 12.1209 0.500467 0.377576\n",
  1892. " 1 12.6215 2.18866 10.2243 0.734261 0.456332\n",
  1893. " 2 7.42903 2.69395 2.71885 0.732922 0.585278\n",
  1894. " 3 9.02468 2.50808 1.54 1.13813 0.706556\n",
  1895. " 4 10.0811 3.6477 1.36029 1.42399 0.847957\n",
  1896. " 5 11.3005 4.44163 1.08518 1.06206 1.00086\n",
  1897. " 6 12.186 4.88816 1.06443 1.00191 1.19792\n",
  1898. " 7 12.7534 5.14529 1.19912 1.34031 1.4372\n",
  1899. " 8 13.0471 5.27184 1.35822 1.84315 1.68449\n",
  1900. " 9 13.1789 5.27707 1.36002 1.84834 1.96545\n",
  1901. " 10 13.2538 5.26425 1.36208 1.85426 2.24943\n"
  1902. ]
  1903. }
  1904. ],
  1905. "source": [
  1906. "%load_ext line_profiler\n",
  1907. "\n",
  1908. "import sys\n",
  1909. "sys.path.insert(0, \"../\")\n",
  1910. "from pygraph.utils.utils import kernel_train_test\n",
  1911. "from pygraph.kernels.untildPathKernel import untildpathkernel\n",
  1912. "\n",
  1913. "import numpy as np\n",
  1914. "\n",
  1915. "datafile = '../../../../datasets/acyclic/Acyclic/dataset_bps.ds'\n",
  1916. "kernel_file_path = 'kernelmatrices_path_acyclic/'\n",
  1917. "\n",
  1918. "kernel_para = dict(node_label = 'atom', edge_label = 'bond_type', labeled = True, k_func = 'tanimoto')\n",
  1919. "\n",
  1920. "# kernel_train_test(datafile, kernel_file_path, treeletkernel, kernel_para, normalize = False)\n",
  1921. "\n",
  1922. "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n",
  1923. " hyper_name = 'depth', hyper_range = np.linspace(0, 20, 21), normalize = True)\n",
  1924. "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n",
  1925. " hyper_name = 'depth', hyper_range = np.linspace(0, 20, 21), normalize = False)\n",
  1926. "\n",
  1927. "kernel_para['k_func'] = 'minmax'\n",
  1928. "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n",
  1929. " hyper_name = 'depth', hyper_range = np.linspace(0, 10, 11), normalize = True)\n",
  1930. "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n",
  1931. " hyper_name = 'depth', hyper_range = np.linspace(0, 10, 11), normalize = False)\n",
  1932. "\n",
  1933. "# # kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, normalize = False)\n",
  1934. "\n",
  1935. "# kernel_para['depth'] = 10\n",
  1936. "# %lprun -f untildpathkernel \\\n",
  1937. "# kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, normalize = False)"
  1938. ]
  1939. },
  1940. {
  1941. "cell_type": "code",
  1942. "execution_count": null,
  1943. "metadata": {},
  1944. "outputs": [],
  1945. "source": [
  1946. "# results\n",
  1947. "\n",
  1948. "# kernel Tanimoto with y normalization\n",
  1949. " depth rmse_test std_test rmse_train std_train k_time\n",
  1950. "------- ----------- ---------- ------------ ----------- ---------\n",
  1951. " 0 41.6202 6.453 43.6169 2.13212 0.0904737\n",
  1952. " 1 38.8446 6.44648 40.8329 3.44147 0.175414\n",
  1953. " 2 35.2915 4.7813 35.7461 1.61134 0.344896\n",
  1954. " 3 29.4845 3.90351 28.4646 3.00137 0.553939\n",
  1955. " 4 22.6693 6.28053 19.2517 3.42893 0.770649\n",
  1956. " 5 21.7956 5.5225 16.886 2.60519 1.01558\n",
  1957. " 6 20.6049 5.49983 13.1097 2.58431 1.33302\n",
  1958. " 7 20.3479 5.17631 12.0152 2.5928 1.60266\n",
  1959. " 8 19.8228 5.13769 10.7981 2.13082 1.81218\n",
  1960. " 9 19.8734 5.10369 10.7997 2.09549 2.21726\n",
  1961. " 10 19.8708 5.09217 10.7787 2.10002 2.41006\n",
  1962. " 11 19.8708 5.09217 10.7787 2.10002 2.74401\n",
  1963. " 12 19.8708 5.09217 10.7787 2.10002 2.72344\n",
  1964. " 13 19.8708 5.09217 10.7787 2.10002 2.61634\n",
  1965. " 14 19.8708 5.09217 10.7787 2.10002 2.6295\n",
  1966. " 15 19.8708 5.09217 10.7787 2.10002 2.66416\n",
  1967. " 16 19.8708 5.09217 10.7787 2.10002 2.73013\n",
  1968. " 17 19.8708 5.09217 10.7787 2.10002 2.63286\n",
  1969. " 18 19.8708 5.09217 10.7787 2.10002 2.59294\n",
  1970. " 19 19.8708 5.09217 10.7787 2.10002 2.63685\n",
  1971. " 20 19.8708 5.09217 10.7787 2.10002 2.52734\n",
  1972. "\n",
  1973. "# kernel Tanimoto without y normalization\n",
  1974. " depth rmse_test std_test rmse_train std_train k_time\n",
  1975. "------- ----------- ---------- ------------ ----------- --------\n",
  1976. " 0 42.6459 6.56063 42.7871 0.675806 0.102753\n",
  1977. " 1 39.1743 6.19537 38.8801 0.623999 0.183017\n",
  1978. " 2 35.6042 4.53921 35.3483 0.727833 0.33236\n",
  1979. " 3 30.1922 5.11032 28.0476 1.0778 0.540039\n",
  1980. " 4 23.7515 7.80856 18.8786 1.7119 0.805467\n",
  1981. " 5 23.4823 7.72712 16.3391 1.39769 1.0196\n",
  1982. " 6 22.7454 8.02805 12.5238 1.0404 1.2963\n",
  1983. " 7 22.8316 7.97837 11.3717 0.925446 1.54621\n",
  1984. " 8 22.5861 8.06789 10.1321 0.52558 1.86582\n",
  1985. " 9 22.7668 8.00571 10.0785 0.518149 2.18504\n",
  1986. " 10 22.8697 7.94456 10.0756 0.67282 2.35276\n",
  1987. " 11 22.8697 7.94456 10.0756 0.67282 2.62744\n",
  1988. " 12 22.8697 7.94456 10.0756 0.67282 2.72091\n",
  1989. " 13 22.8697 7.94456 10.0756 0.67282 2.69906\n",
  1990. " 14 22.8697 7.94456 10.0756 0.67282 2.63283\n",
  1991. " 15 22.8697 7.94456 10.0756 0.67282 2.6557\n",
  1992. " 16 22.8697 7.94456 10.0756 0.67282 2.62181\n",
  1993. " 17 22.8697 7.94456 10.0756 0.67282 2.59382\n",
  1994. " 18 22.8697 7.94456 10.0756 0.67282 2.65336\n",
  1995. " 19 22.8697 7.94456 10.0756 0.67282 2.62849\n",
  1996. " 20 22.8697 7.94456 10.0756 0.67282 2.68269\n",
  1997. " \n",
  1998. "# kernel MinMax with y normalization \n",
  1999. " depth rmse_test std_test rmse_train std_train k_time\n",
  2000. "------- ----------- ---------- ------------ ----------- --------\n",
  2001. " 0 12.6827 2.74882 12.2079 0.700182 0.38939\n",
  2002. " 1 12.6098 2.37278 10.2792 0.914688 0.472962\n",
  2003. " 2 8.06061 2.47045 2.58881 0.557162 0.576836\n",
  2004. " 3 9.75514 3.04917 1.27267 0.760432 0.716913\n",
  2005. " 4 10.3192 3.61667 1.03229 0.72838 0.834242\n",
  2006. " 5 10.6593 4.12052 0.923543 0.660532 0.993821\n",
  2007. " 6 11.1025 4.33055 0.878589 0.603598 1.17534\n",
  2008. " 7 11.353 4.30546 0.944049 0.694844 1.43584\n",
  2009. " 8 11.299 4.34965 1.03398 0.775622 1.7006\n",
  2010. " 9 11.3327 4.32412 1.00319 0.57207 2.01943\n",
  2011. " 10 11.3435 4.32726 1.00227 0.570937 2.24333\n",
  2012. "\n",
  2013. "# kernel MinMax without y normalization\n",
  2014. " depth rmse_test std_test rmse_train std_train k_time\n",
  2015. "------- ----------- ---------- ------------ ----------- --------\n",
  2016. " 0 12.58 2.73235 12.1209 0.500467 0.377576\n",
  2017. " 1 12.6215 2.18866 10.2243 0.734261 0.456332\n",
  2018. " 2 7.42903 2.69395 2.71885 0.732922 0.585278\n",
  2019. " 3 9.02468 2.50808 1.54 1.13813 0.706556\n",
  2020. " 4 10.0811 3.6477 1.36029 1.42399 0.847957\n",
  2021. " 5 11.3005 4.44163 1.08518 1.06206 1.00086\n",
  2022. " 6 12.186 4.88816 1.06443 1.00191 1.19792\n",
  2023. " 7 12.7534 5.14529 1.19912 1.34031 1.4372\n",
  2024. " 8 13.0471 5.27184 1.35822 1.84315 1.68449\n",
  2025. " 9 13.1789 5.27707 1.36002 1.84834 1.96545\n",
  2026. " 10 13.2538 5.26425 1.36208 1.85426 2.24943"
  2027. ]
  2028. }
  2029. ],
  2030. "metadata": {
  2031. "kernelspec": {
  2032. "display_name": "Python 3",
  2033. "language": "python",
  2034. "name": "python3"
  2035. },
  2036. "language_info": {
  2037. "codemirror_mode": {
  2038. "name": "ipython",
  2039. "version": 3
  2040. },
  2041. "file_extension": ".py",
  2042. "mimetype": "text/x-python",
  2043. "name": "python",
  2044. "nbconvert_exporter": "python",
  2045. "pygments_lexer": "ipython3",
  2046. "version": "3.5.2"
  2047. }
  2048. },
  2049. "nbformat": 4,
  2050. "nbformat_minor": 2
  2051. }

A Python package for graph kernels, graph edit distances and graph pre-image problem.