{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- This is a regression problem ---\n", "\n", "\n", " #--- calculating kernel matrix when depth = 0.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 0 of size 185 built in 0.09047365188598633 seconds ---\n", "[[ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n", " 0.33333333]\n", " [ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n", " 0.33333333]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " ..., \n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 43.616902\n", "With standard deviation: 2.132120\n", "\n", " Mean performance on test set: 41.620214\n", "With standard deviation: 6.453003\n", "\n", "\n", " #--- calculating kernel matrix when depth = 1.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 1 of size 185 built in 0.1754138469696045 seconds ---\n", "[[ 1. 0.8 0.14285714 ..., 0.125 0.125 0.125 ]\n", " [ 0.8 1. 0.125 ..., 0.11111111 0.11111111\n", " 0.11111111]\n", " [ 0.14285714 0.125 1. ..., 0.8 0.8 0.8 ]\n", " ..., \n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 40.832861\n", "With standard deviation: 3.441465\n", "\n", " Mean performance on test set: 38.844613\n", "With standard deviation: 6.446482\n", "\n", "\n", " #--- calculating kernel matrix when depth = 2.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 2 of size 185 built in 0.3448960781097412 seconds ---\n", "[[ 1. 0.5 0.11111111 ..., 0.07692308 0.07692308\n", " 0.07692308]\n", " [ 0.5 1. 0.09090909 ..., 0.06666667 0.06666667\n", " 0.06666667]\n", " [ 0.11111111 0.09090909 1. ..., 0.55555556 0.55555556\n", " 0.55555556]\n", " ..., \n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 35.746142\n", "With standard deviation: 1.611340\n", "\n", " Mean performance on test set: 35.291451\n", "With standard deviation: 4.781298\n", "\n", "\n", " #--- calculating kernel matrix when depth = 3.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 3 of size 185 built in 0.5539388656616211 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.05555556 0.05555556\n", " 0.05555556]\n", " [ 0.44444444 1. 0.08333333 ..., 0.04761905 0.04761905\n", " 0.04761905]\n", " [ 0.11111111 0.08333333 1. ..., 0.35714286 0.35714286\n", " 0.35714286]\n", " ..., \n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 28.464581\n", "With standard deviation: 3.001371\n", "\n", " Mean performance on test set: 29.484499\n", "With standard deviation: 3.903507\n", "\n", "\n", " #--- calculating kernel matrix when depth = 4.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 4 of size 185 built in 0.7706489562988281 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.04347826 0.04166667\n", " 0.04347826]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03846154 0.03703704\n", " 0.03846154]\n", " [ 0.11111111 0.08333333 1. ..., 0.26315789 0.25 0.26315789]\n", " ..., \n", " [ 0.04347826 0.03846154 0.26315789 ..., 1. 0.95 0.9 ]\n", " [ 0.04166667 0.03703704 0.25 ..., 0.95 1. 0.95 ]\n", " [ 0.04347826 0.03846154 0.26315789 ..., 0.9 0.95 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 19.251747\n", "With standard deviation: 3.428930\n", "\n", " Mean performance on test set: 22.669312\n", "With standard deviation: 6.280526\n", "\n", "\n", " #--- calculating kernel matrix when depth = 5.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 5 of size 185 built in 1.015580415725708 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03703704 0.03333333\n", " 0.03571429]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03333333 0.03030303\n", " 0.03225806]\n", " [ 0.11111111 0.08333333 1. ..., 0.2173913 0.19230769\n", " 0.20833333]\n", " ..., \n", " [ 0.03703704 0.03333333 0.2173913 ..., 1. 0.88461538\n", " 0.74074074]\n", " [ 0.03333333 0.03030303 0.19230769 ..., 0.88461538 1. 0.85185185]\n", " [ 0.03571429 0.03225806 0.20833333 ..., 0.74074074 0.85185185 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 16.886016\n", "With standard deviation: 2.605194\n", "\n", " Mean performance on test set: 21.795626\n", "With standard deviation: 5.522502\n", "\n", "\n", " #--- calculating kernel matrix when depth = 6.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 6 of size 185 built in 1.3330223560333252 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03333333 0.02857143\n", " 0.03030303]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03030303 0.02631579\n", " 0.02777778]\n", " [ 0.11111111 0.08333333 1. ..., 0.19230769 0.16129032\n", " 0.17241379]\n", " ..., \n", " [ 0.03333333 0.03030303 0.19230769 ..., 1. 0.83870968\n", " 0.57142857]\n", " [ 0.02857143 0.02631579 0.16129032 ..., 0.83870968 1. 0.71428571]\n", " [ 0.03030303 0.02777778 0.17241379 ..., 0.57142857 0.71428571 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 13.109746\n", "With standard deviation: 2.584308\n", "\n", " Mean performance on test set: 20.604920\n", "With standard deviation: 5.499831\n", "\n", "\n", " #--- calculating kernel matrix when depth = 7.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 7 of size 185 built in 1.602663278579712 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03125 0.02564103\n", " 0.02631579]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02857143 0.02380952\n", " 0.02439024]\n", " [ 0.11111111 0.08333333 1. ..., 0.17857143 0.14285714\n", " 0.14705882]\n", " ..., \n", " [ 0.03125 0.02857143 0.17857143 ..., 1. 0.8 0.47619048]\n", " [ 0.02564103 0.02380952 0.14285714 ..., 0.8 1. 0.56818182]\n", " [ 0.02631579 0.02439024 0.14705882 ..., 0.47619048 0.56818182 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 12.015210\n", "With standard deviation: 2.592798\n", "\n", " Mean performance on test set: 20.347932\n", "With standard deviation: 5.176314\n", "\n", "\n", " #--- calculating kernel matrix when depth = 8.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 8 of size 185 built in 1.8121819496154785 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02325581]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.02173913]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.12820513]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.41666667]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.49019608]\n", " [ 0.02325581 0.02173913 0.12820513 ..., 0.41666667 0.49019608 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.798096\n", "With standard deviation: 2.130816\n", "\n", " Mean performance on test set: 19.822797\n", "With standard deviation: 5.137687\n", "\n", "\n", " #--- calculating kernel matrix when depth = 9.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- kernel matrix of path kernel up to 9 of size 185 built in 2.2172586917877197 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.0212766 ]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727 0.02 ]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11627907]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.38461538]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.45454545]\n", " [ 0.0212766 0.02 0.11627907 ..., 0.38461538 0.45454545 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.799656\n", "With standard deviation: 2.095494\n", "\n", " Mean performance on test set: 19.873364\n", "With standard deviation: 5.103689\n", "\n", "\n", " #--- calculating kernel matrix when depth = 10.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 10 of size 185 built in 2.4100613594055176 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 11.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 11 of size 185 built in 2.7440149784088135 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 12.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 12 of size 185 built in 2.723442316055298 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 13.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 13 of size 185 built in 2.6163382530212402 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 14.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 14 of size 185 built in 2.629500389099121 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 15.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 15 of size 185 built in 2.664158821105957 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 16.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 16 of size 185 built in 2.7301340103149414 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 17.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 17 of size 185 built in 2.6328580379486084 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 18.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- kernel matrix of path kernel up to 18 of size 185 built in 2.592944383621216 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 19.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 19 of size 185 built in 2.6368520259857178 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " #--- calculating kernel matrix when depth = 20.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 20 of size 185 built in 2.52734375 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.778685\n", "With standard deviation: 2.100015\n", "\n", " Mean performance on test set: 19.870809\n", "With standard deviation: 5.092173\n", "\n", "\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- ---------\n", " 0 41.6202 6.453 43.6169 2.13212 0.0904737\n", " 1 38.8446 6.44648 40.8329 3.44147 0.175414\n", " 2 35.2915 4.7813 35.7461 1.61134 0.344896\n", " 3 29.4845 3.90351 28.4646 3.00137 0.553939\n", " 4 22.6693 6.28053 19.2517 3.42893 0.770649\n", " 5 21.7956 5.5225 16.886 2.60519 1.01558\n", " 6 20.6049 5.49983 13.1097 2.58431 1.33302\n", " 7 20.3479 5.17631 12.0152 2.5928 1.60266\n", " 8 19.8228 5.13769 10.7981 2.13082 1.81218\n", " 9 19.8734 5.10369 10.7997 2.09549 2.21726\n", " 10 19.8708 5.09217 10.7787 2.10002 2.41006\n", " 11 19.8708 5.09217 10.7787 2.10002 2.74401\n", " 12 19.8708 5.09217 10.7787 2.10002 2.72344\n", " 13 19.8708 5.09217 10.7787 2.10002 2.61634\n", " 14 19.8708 5.09217 10.7787 2.10002 2.6295\n", " 15 19.8708 5.09217 10.7787 2.10002 2.66416\n", " 16 19.8708 5.09217 10.7787 2.10002 2.73013\n", " 17 19.8708 5.09217 10.7787 2.10002 2.63286\n", " 18 19.8708 5.09217 10.7787 2.10002 2.59294\n", " 19 19.8708 5.09217 10.7787 2.10002 2.63685\n", " 20 19.8708 5.09217 10.7787 2.10002 2.52734\n", "\n", " --- This is a regression problem ---\n", "\n", "\n", " #--- calculating kernel matrix when depth = 0.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 0 of size 185 built in 0.1027534008026123 seconds ---\n", "[[ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n", " 0.33333333]\n", " [ 1. 1. 0.33333333 ..., 0.33333333 0.33333333\n", " 0.33333333]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " ..., \n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]\n", " [ 0.33333333 0.33333333 1. ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 42.787136\n", "With standard deviation: 0.675806\n", "\n", " Mean performance on test set: 42.645892\n", "With standard deviation: 6.560629\n", "\n", "\n", " #--- calculating kernel matrix when depth = 1.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 1 of size 185 built in 0.18301701545715332 seconds ---\n", "[[ 1. 0.8 0.14285714 ..., 0.125 0.125 0.125 ]\n", " [ 0.8 1. 0.125 ..., 0.11111111 0.11111111\n", " 0.11111111]\n", " [ 0.14285714 0.125 1. ..., 0.8 0.8 0.8 ]\n", " ..., \n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]\n", " [ 0.125 0.11111111 0.8 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 38.880117\n", "With standard deviation: 0.623999\n", "\n", " Mean performance on test set: 39.174317\n", "With standard deviation: 6.195371\n", "\n", "\n", " #--- calculating kernel matrix when depth = 2.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 2 of size 185 built in 0.33235955238342285 seconds ---\n", "[[ 1. 0.5 0.11111111 ..., 0.07692308 0.07692308\n", " 0.07692308]\n", " [ 0.5 1. 0.09090909 ..., 0.06666667 0.06666667\n", " 0.06666667]\n", " [ 0.11111111 0.09090909 1. ..., 0.55555556 0.55555556\n", " 0.55555556]\n", " ..., \n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]\n", " [ 0.07692308 0.06666667 0.55555556 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 35.348332\n", "With standard deviation: 0.727833\n", "\n", " Mean performance on test set: 35.604226\n", "With standard deviation: 4.539211\n", "\n", "\n", " #--- calculating kernel matrix when depth = 3.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 3 of size 185 built in 0.5400393009185791 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.05555556 0.05555556\n", " 0.05555556]\n", " [ 0.44444444 1. 0.08333333 ..., 0.04761905 0.04761905\n", " 0.04761905]\n", " [ 0.11111111 0.08333333 1. ..., 0.35714286 0.35714286\n", " 0.35714286]\n", " ..., \n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.04761905 0.35714286 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 28.047646\n", "With standard deviation: 1.077805\n", "\n", " Mean performance on test set: 30.192177\n", "With standard deviation: 5.110324\n", "\n", "\n", " #--- calculating kernel matrix when depth = 4.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8054666519165039 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.04347826 0.04166667\n", " 0.04347826]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03846154 0.03703704\n", " 0.03846154]\n", " [ 0.11111111 0.08333333 1. ..., 0.26315789 0.25 0.26315789]\n", " ..., \n", " [ 0.04347826 0.03846154 0.26315789 ..., 1. 0.95 0.9 ]\n", " [ 0.04166667 0.03703704 0.25 ..., 0.95 1. 0.95 ]\n", " [ 0.04347826 0.03846154 0.26315789 ..., 0.9 0.95 1. ]]\n", "\n", " Saving kernel matrix to file...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " Mean performance on train set: 18.878595\n", "With standard deviation: 1.711897\n", "\n", " Mean performance on test set: 23.751530\n", "With standard deviation: 7.808559\n", "\n", "\n", " #--- calculating kernel matrix when depth = 5.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 5 of size 185 built in 1.0195980072021484 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03703704 0.03333333\n", " 0.03571429]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03333333 0.03030303\n", " 0.03225806]\n", " [ 0.11111111 0.08333333 1. ..., 0.2173913 0.19230769\n", " 0.20833333]\n", " ..., \n", " [ 0.03703704 0.03333333 0.2173913 ..., 1. 0.88461538\n", " 0.74074074]\n", " [ 0.03333333 0.03030303 0.19230769 ..., 0.88461538 1. 0.85185185]\n", " [ 0.03571429 0.03225806 0.20833333 ..., 0.74074074 0.85185185 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 16.339135\n", "With standard deviation: 1.397693\n", "\n", " Mean performance on test set: 23.482309\n", "With standard deviation: 7.727117\n", "\n", "\n", " #--- calculating kernel matrix when depth = 6.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 6 of size 185 built in 1.2962956428527832 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03333333 0.02857143\n", " 0.03030303]\n", " [ 0.44444444 1. 0.08333333 ..., 0.03030303 0.02631579\n", " 0.02777778]\n", " [ 0.11111111 0.08333333 1. ..., 0.19230769 0.16129032\n", " 0.17241379]\n", " ..., \n", " [ 0.03333333 0.03030303 0.19230769 ..., 1. 0.83870968\n", " 0.57142857]\n", " [ 0.02857143 0.02631579 0.16129032 ..., 0.83870968 1. 0.71428571]\n", " [ 0.03030303 0.02777778 0.17241379 ..., 0.57142857 0.71428571 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 12.523830\n", "With standard deviation: 1.040404\n", "\n", " Mean performance on test set: 22.745367\n", "With standard deviation: 8.028051\n", "\n", "\n", " #--- calculating kernel matrix when depth = 7.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 7 of size 185 built in 1.5462064743041992 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03125 0.02564103\n", " 0.02631579]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02857143 0.02380952\n", " 0.02439024]\n", " [ 0.11111111 0.08333333 1. ..., 0.17857143 0.14285714\n", " 0.14705882]\n", " ..., \n", " [ 0.03125 0.02857143 0.17857143 ..., 1. 0.8 0.47619048]\n", " [ 0.02564103 0.02380952 0.14285714 ..., 0.8 1. 0.56818182]\n", " [ 0.02631579 0.02439024 0.14705882 ..., 0.47619048 0.56818182 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 11.371668\n", "With standard deviation: 0.925446\n", "\n", " Mean performance on test set: 22.831602\n", "With standard deviation: 7.978369\n", "\n", "\n", " #--- calculating kernel matrix when depth = 8.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 8 of size 185 built in 1.8658208847045898 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02325581]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.02173913]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.12820513]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.41666667]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.49019608]\n", " [ 0.02325581 0.02173913 0.12820513 ..., 0.41666667 0.49019608 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.132106\n", "With standard deviation: 0.525580\n", "\n", " Mean performance on test set: 22.586071\n", "With standard deviation: 8.067887\n", "\n", "\n", " #--- calculating kernel matrix when depth = 9.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 9 of size 185 built in 2.185042381286621 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.0212766 ]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727 0.02 ]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11627907]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.38461538]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.45454545]\n", " [ 0.0212766 0.02 0.11627907 ..., 0.38461538 0.45454545 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.078464\n", "With standard deviation: 0.518149\n", "\n", " Mean performance on test set: 22.766801\n", "With standard deviation: 8.005709\n", "\n", "\n", " #--- calculating kernel matrix when depth = 10.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 10 of size 185 built in 2.35276198387146 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 11.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 11 of size 185 built in 2.6274359226226807 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 12.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 12 of size 185 built in 2.7209105491638184 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 13.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 13 of size 185 built in 2.699059247970581 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 14.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 14 of size 185 built in 2.6328344345092773 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 15.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 15 of size 185 built in 2.6556999683380127 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 16.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 16 of size 185 built in 2.621814012527466 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 17.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 17 of size 185 built in 2.5938243865966797 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 18.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 18 of size 185 built in 2.65336275100708 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 19.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 19 of size 185 built in 2.628486156463623 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " #--- calculating kernel matrix when depth = 20.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 20 of size 185 built in 2.682689666748047 seconds ---\n", "[[ 1. 0.44444444 0.11111111 ..., 0.03030303 0.02439024\n", " 0.02040816]\n", " [ 0.44444444 1. 0.08333333 ..., 0.02777778 0.02272727\n", " 0.01923077]\n", " [ 0.11111111 0.08333333 1. ..., 0.17241379 0.13513514\n", " 0.11111111]\n", " ..., \n", " [ 0.03030303 0.02777778 0.17241379 ..., 1. 0.73684211\n", " 0.37037037]\n", " [ 0.02439024 0.02272727 0.13513514 ..., 0.73684211 1. 0.43859649]\n", " [ 0.02040816 0.01923077 0.11111111 ..., 0.37037037 0.43859649 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.075607\n", "With standard deviation: 0.672820\n", "\n", " Mean performance on test set: 22.869720\n", "With standard deviation: 7.944560\n", "\n", "\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 42.6459 6.56063 42.7871 0.675806 0.102753\n", " 1 39.1743 6.19537 38.8801 0.623999 0.183017\n", " 2 35.6042 4.53921 35.3483 0.727833 0.33236\n", " 3 30.1922 5.11032 28.0476 1.0778 0.540039\n", " 4 23.7515 7.80856 18.8786 1.7119 0.805467\n", " 5 23.4823 7.72712 16.3391 1.39769 1.0196\n", " 6 22.7454 8.02805 12.5238 1.0404 1.2963\n", " 7 22.8316 7.97837 11.3717 0.925446 1.54621\n", " 8 22.5861 8.06789 10.1321 0.52558 1.86582\n", " 9 22.7668 8.00571 10.0785 0.518149 2.18504\n", " 10 22.8697 7.94456 10.0756 0.67282 2.35276\n", " 11 22.8697 7.94456 10.0756 0.67282 2.62744\n", " 12 22.8697 7.94456 10.0756 0.67282 2.72091\n", " 13 22.8697 7.94456 10.0756 0.67282 2.69906\n", " 14 22.8697 7.94456 10.0756 0.67282 2.63283\n", " 15 22.8697 7.94456 10.0756 0.67282 2.6557\n", " 16 22.8697 7.94456 10.0756 0.67282 2.62181\n", " 17 22.8697 7.94456 10.0756 0.67282 2.59382\n", " 18 22.8697 7.94456 10.0756 0.67282 2.65336\n", " 19 22.8697 7.94456 10.0756 0.67282 2.62849\n", " 20 22.8697 7.94456 10.0756 0.67282 2.68269\n", "\n", " --- This is a regression problem ---\n", "\n", "\n", " #--- calculating kernel matrix when depth = 0.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- kernel matrix of path kernel up to 0 of size 185 built in 0.3893899917602539 seconds ---\n", "[[ 1. 0.75 0.5 ..., 0.16666667 0.16666667\n", " 0.16666667]\n", " [ 0.75 1. 0.4 ..., 0.15384615 0.15384615\n", " 0.15384615]\n", " [ 0.5 0.4 1. ..., 0.27272727 0.27272727\n", " 0.27272727]\n", " ..., \n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 12.207923\n", "With standard deviation: 0.700182\n", "\n", " Mean performance on test set: 12.682718\n", "With standard deviation: 2.748815\n", "\n", "\n", " #--- calculating kernel matrix when depth = 1.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 1 of size 185 built in 0.4729621410369873 seconds ---\n", "[[ 1. 0.7 0.16666667 ..., 0.05555556 0.05555556\n", " 0.05555556]\n", " [ 0.7 1. 0.13333333 ..., 0.05128205 0.05128205\n", " 0.05128205]\n", " [ 0.16666667 0.13333333 1. ..., 0.22580645 0.22580645\n", " 0.22580645]\n", " ..., \n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.279220\n", "With standard deviation: 0.914688\n", "\n", " Mean performance on test set: 12.609828\n", "With standard deviation: 2.372778\n", "\n", "\n", " #--- calculating kernel matrix when depth = 2.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 2 of size 185 built in 0.576836109161377 seconds ---\n", "[[ 1. 0.4375 0.125 ..., 0.03333333 0.03333333\n", " 0.03571429]\n", " [ 0.4375 1. 0.0952381 ..., 0.03076923 0.03076923\n", " 0.03278689]\n", " [ 0.125 0.0952381 1. ..., 0.16981132 0.16981132\n", " 0.18367347]\n", " ..., \n", " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n", " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n", " [ 0.03571429 0.03278689 0.18367347 ..., 0.9245283 0.9245283 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 2.588811\n", "With standard deviation: 0.557162\n", "\n", " Mean performance on test set: 8.060609\n", "With standard deviation: 2.470450\n", "\n", "\n", " #--- calculating kernel matrix when depth = 3.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 3 of size 185 built in 0.7169125080108643 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.02631579 0.02631579\n", " 0.02777778]\n", " [ 0.38888889 1. 0.08695652 ..., 0.02409639 0.02409639\n", " 0.02531646]\n", " [ 0.125 0.08695652 1. ..., 0.13043478 0.13043478\n", " 0.13846154]\n", " ..., \n", " [ 0.02631579 0.02409639 0.13043478 ..., 1. 0.94366197\n", " 0.83561644]\n", " [ 0.02631579 0.02409639 0.13043478 ..., 0.94366197 1. 0.78666667]\n", " [ 0.02777778 0.02531646 0.13846154 ..., 0.83561644 0.78666667 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.272670\n", "With standard deviation: 0.760432\n", "\n", " Mean performance on test set: 9.755135\n", "With standard deviation: 3.049170\n", "\n", "\n", " #--- calculating kernel matrix when depth = 4.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8342421054840088 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.02222222 0.02222222\n", " 0.02325581]\n", " [ 0.38888889 1. 0.08695652 ..., 0.02061856 0.02061856\n", " 0.02150538]\n", " [ 0.125 0.08695652 1. ..., 0.10843373 0.10843373\n", " 0.11392405]\n", " ..., \n", " [ 0.02222222 0.02061856 0.10843373 ..., 1. 0.82417582\n", " 0.67010309]\n", " [ 0.02222222 0.02061856 0.10843373 ..., 0.82417582 1. 0.70526316]\n", " [ 0.02325581 0.02150538 0.11392405 ..., 0.67010309 0.70526316 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.032293\n", "With standard deviation: 0.728380\n", "\n", " Mean performance on test set: 10.319167\n", "With standard deviation: 3.616673\n", "\n", "\n", " #--- calculating kernel matrix when depth = 5.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 5 of size 185 built in 0.9938209056854248 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01960784 0.01960784\n", " 0.02040816]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01834862 0.01834862\n", " 0.01904762]\n", " [ 0.125 0.08695652 1. ..., 0.09473684 0.09473684\n", " 0.0989011 ]\n", " ..., \n", " [ 0.01960784 0.01834862 0.09473684 ..., 1. 0.74311927\n", " 0.56302521]\n", " [ 0.01960784 0.01834862 0.09473684 ..., 0.74311927 1. 0.6173913 ]\n", " [ 0.02040816 0.01904762 0.0989011 ..., 0.56302521 0.6173913 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 0.923543\n", "With standard deviation: 0.660532\n", "\n", " Mean performance on test set: 10.659250\n", "With standard deviation: 4.120523\n", "\n", "\n", " #--- calculating kernel matrix when depth = 6.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 6 of size 185 built in 1.1753439903259277 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01785714 0.01785714\n", " 0.01851852]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01680672 0.01680672\n", " 0.0173913 ]\n", " [ 0.125 0.08695652 1. ..., 0.08571429 0.08571429\n", " 0.08910891]\n", " ..., \n", " [ 0.01785714 0.01680672 0.08571429 ..., 1. 0.68 0.48201439]\n", " [ 0.01785714 0.01680672 0.08571429 ..., 0.68 1. 0.54887218]\n", " [ 0.01851852 0.0173913 0.08910891 ..., 0.48201439 0.54887218 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 0.878589\n", "With standard deviation: 0.603598\n", "\n", " Mean performance on test set: 11.102521\n", "With standard deviation: 4.330554\n", "\n", "\n", " #--- calculating kernel matrix when depth = 7.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 7 of size 185 built in 1.4358420372009277 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01666667 0.01666667\n", " 0.01724138]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01574803 0.01574803\n", " 0.01626016]\n", " [ 0.125 0.08695652 1. ..., 0.07964602 0.07964602\n", " 0.08256881]\n", " ..., \n", " [ 0.01666667 0.01574803 0.07964602 ..., 1. 0.64963504\n", " 0.43225806]\n", " [ 0.01666667 0.01574803 0.07964602 ..., 0.64963504 1. 0.48993289]\n", " [ 0.01724138 0.01626016 0.08256881 ..., 0.43225806 0.48993289 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 0.944049\n", "With standard deviation: 0.694844\n", "\n", " Mean performance on test set: 11.352962\n", "With standard deviation: 4.305459\n", "\n", "\n", " #--- calculating kernel matrix when depth = 8.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 8 of size 185 built in 1.7005987167358398 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n", " 0.01639344]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01550388]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07826087]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.3964497 ]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.44785276]\n", " [ 0.01639344 0.01550388 0.07826087 ..., 0.3964497 0.44785276 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.033979\n", "With standard deviation: 0.775622\n", "\n", " Mean performance on test set: 11.298981\n", "With standard deviation: 4.349648\n", "\n", "\n", " #--- calculating kernel matrix when depth = 9.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- kernel matrix of path kernel up to 9 of size 185 built in 2.0194287300109863 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n", " 0.01587302]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01503759]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07563025]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.38728324]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43712575]\n", " [ 0.01587302 0.01503759 0.07563025 ..., 0.38728324 0.43712575 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.003187\n", "With standard deviation: 0.572070\n", "\n", " Mean performance on test set: 11.332669\n", "With standard deviation: 4.324120\n", "\n", "\n", " #--- calculating kernel matrix when depth = 10.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 10 of size 185 built in 2.243326187133789 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625 0.015625 ]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01481481]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07438017]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.38285714]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43195266]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.38285714 0.43195266 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.002272\n", "With standard deviation: 0.570937\n", "\n", " Mean performance on test set: 11.343515\n", "With standard deviation: 4.327265\n", "\n", "\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 12.6827 2.74882 12.2079 0.700182 0.38939\n", " 1 12.6098 2.37278 10.2792 0.914688 0.472962\n", " 2 8.06061 2.47045 2.58881 0.557162 0.576836\n", " 3 9.75514 3.04917 1.27267 0.760432 0.716913\n", " 4 10.3192 3.61667 1.03229 0.72838 0.834242\n", " 5 10.6593 4.12052 0.923543 0.660532 0.993821\n", " 6 11.1025 4.33055 0.878589 0.603598 1.17534\n", " 7 11.353 4.30546 0.944049 0.694844 1.43584\n", " 8 11.299 4.34965 1.03398 0.775622 1.7006\n", " 9 11.3327 4.32412 1.00319 0.57207 2.01943\n", " 10 11.3435 4.32726 1.00227 0.570937 2.24333\n", "\n", " --- This is a regression problem ---\n", "\n", "\n", " #--- calculating kernel matrix when depth = 0.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 0 of size 185 built in 0.3775763511657715 seconds ---\n", "[[ 1. 0.75 0.5 ..., 0.16666667 0.16666667\n", " 0.16666667]\n", " [ 0.75 1. 0.4 ..., 0.15384615 0.15384615\n", " 0.15384615]\n", " [ 0.5 0.4 1. ..., 0.27272727 0.27272727\n", " 0.27272727]\n", " ..., \n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]\n", " [ 0.16666667 0.15384615 0.27272727 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 12.120872\n", "With standard deviation: 0.500467\n", "\n", " Mean performance on test set: 12.579966\n", "With standard deviation: 2.732346\n", "\n", "\n", " #--- calculating kernel matrix when depth = 1.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 1 of size 185 built in 0.4563324451446533 seconds ---\n", "[[ 1. 0.7 0.16666667 ..., 0.05555556 0.05555556\n", " 0.05555556]\n", " [ 0.7 1. 0.13333333 ..., 0.05128205 0.05128205\n", " 0.05128205]\n", " [ 0.16666667 0.13333333 1. ..., 0.22580645 0.22580645\n", " 0.22580645]\n", " ..., \n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]\n", " [ 0.05555556 0.05128205 0.22580645 ..., 1. 1. 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 10.224322\n", "With standard deviation: 0.734261\n", "\n", " Mean performance on test set: 12.621509\n", "With standard deviation: 2.188664\n", "\n", "\n", " #--- calculating kernel matrix when depth = 2.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 2 of size 185 built in 0.5852782726287842 seconds ---\n", "[[ 1. 0.4375 0.125 ..., 0.03333333 0.03333333\n", " 0.03571429]\n", " [ 0.4375 1. 0.0952381 ..., 0.03076923 0.03076923\n", " 0.03278689]\n", " [ 0.125 0.0952381 1. ..., 0.16981132 0.16981132\n", " 0.18367347]\n", " ..., \n", " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n", " [ 0.03333333 0.03076923 0.16981132 ..., 1. 1. 0.9245283 ]\n", " [ 0.03571429 0.03278689 0.18367347 ..., 0.9245283 0.9245283 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 2.718851\n", "With standard deviation: 0.732922\n", "\n", " Mean performance on test set: 7.429032\n", "With standard deviation: 2.693953\n", "\n", "\n", " #--- calculating kernel matrix when depth = 3.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 3 of size 185 built in 0.7065560817718506 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.02631579 0.02631579\n", " 0.02777778]\n", " [ 0.38888889 1. 0.08695652 ..., 0.02409639 0.02409639\n", " 0.02531646]\n", " [ 0.125 0.08695652 1. ..., 0.13043478 0.13043478\n", " 0.13846154]\n", " ..., \n", " [ 0.02631579 0.02409639 0.13043478 ..., 1. 0.94366197\n", " 0.83561644]\n", " [ 0.02631579 0.02409639 0.13043478 ..., 0.94366197 1. 0.78666667]\n", " [ 0.02777778 0.02531646 0.13846154 ..., 0.83561644 0.78666667 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.540000\n", "With standard deviation: 1.138134\n", "\n", " Mean performance on test set: 9.024680\n", "With standard deviation: 2.508084\n", "\n", "\n", " #--- calculating kernel matrix when depth = 4.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 4 of size 185 built in 0.8479568958282471 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.02222222 0.02222222\n", " 0.02325581]\n", " [ 0.38888889 1. 0.08695652 ..., 0.02061856 0.02061856\n", " 0.02150538]\n", " [ 0.125 0.08695652 1. ..., 0.10843373 0.10843373\n", " 0.11392405]\n", " ..., \n", " [ 0.02222222 0.02061856 0.10843373 ..., 1. 0.82417582\n", " 0.67010309]\n", " [ 0.02222222 0.02061856 0.10843373 ..., 0.82417582 1. 0.70526316]\n", " [ 0.02325581 0.02150538 0.11392405 ..., 0.67010309 0.70526316 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.360291\n", "With standard deviation: 1.423990\n", "\n", " Mean performance on test set: 10.081112\n", "With standard deviation: 3.647700\n", "\n", "\n", " #--- calculating kernel matrix when depth = 5.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 5 of size 185 built in 1.0008597373962402 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01960784 0.01960784\n", " 0.02040816]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01834862 0.01834862\n", " 0.01904762]\n", " [ 0.125 0.08695652 1. ..., 0.09473684 0.09473684\n", " 0.0989011 ]\n", " ..., \n", " [ 0.01960784 0.01834862 0.09473684 ..., 1. 0.74311927\n", " 0.56302521]\n", " [ 0.01960784 0.01834862 0.09473684 ..., 0.74311927 1. 0.6173913 ]\n", " [ 0.02040816 0.01904762 0.0989011 ..., 0.56302521 0.6173913 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.085175\n", "With standard deviation: 1.062063\n", "\n", " Mean performance on test set: 11.300476\n", "With standard deviation: 4.441634\n", "\n", "\n", " #--- calculating kernel matrix when depth = 6.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", " --- kernel matrix of path kernel up to 6 of size 185 built in 1.1979196071624756 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01785714 0.01785714\n", " 0.01851852]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01680672 0.01680672\n", " 0.0173913 ]\n", " [ 0.125 0.08695652 1. ..., 0.08571429 0.08571429\n", " 0.08910891]\n", " ..., \n", " [ 0.01785714 0.01680672 0.08571429 ..., 1. 0.68 0.48201439]\n", " [ 0.01785714 0.01680672 0.08571429 ..., 0.68 1. 0.54887218]\n", " [ 0.01851852 0.0173913 0.08910891 ..., 0.48201439 0.54887218 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.064431\n", "With standard deviation: 1.001911\n", "\n", " Mean performance on test set: 12.186014\n", "With standard deviation: 4.888158\n", "\n", "\n", " #--- calculating kernel matrix when depth = 7.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 7 of size 185 built in 1.4372029304504395 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.01666667 0.01666667\n", " 0.01724138]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01574803 0.01574803\n", " 0.01626016]\n", " [ 0.125 0.08695652 1. ..., 0.07964602 0.07964602\n", " 0.08256881]\n", " ..., \n", " [ 0.01666667 0.01574803 0.07964602 ..., 1. 0.64963504\n", " 0.43225806]\n", " [ 0.01666667 0.01574803 0.07964602 ..., 0.64963504 1. 0.48993289]\n", " [ 0.01724138 0.01626016 0.08256881 ..., 0.43225806 0.48993289 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.199119\n", "With standard deviation: 1.340313\n", "\n", " Mean performance on test set: 12.753387\n", "With standard deviation: 5.145288\n", "\n", "\n", " #--- calculating kernel matrix when depth = 8.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 8 of size 185 built in 1.68448805809021 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n", " 0.01639344]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01550388]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07826087]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.3964497 ]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.44785276]\n", " [ 0.01639344 0.01550388 0.07826087 ..., 0.3964497 0.44785276 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.358221\n", "With standard deviation: 1.843147\n", "\n", " Mean performance on test set: 13.047098\n", "With standard deviation: 5.271835\n", "\n", "\n", " #--- calculating kernel matrix when depth = 9.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 9 of size 185 built in 1.9654510021209717 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625\n", " 0.01587302]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01503759]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07563025]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.38728324]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43712575]\n", " [ 0.01587302 0.01503759 0.07563025 ..., 0.38728324 0.43712575 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.360024\n", "With standard deviation: 1.848342\n", "\n", " Mean performance on test set: 13.178933\n", "With standard deviation: 5.277067\n", "\n", "\n", " #--- calculating kernel matrix when depth = 10.0 ---#\n", "\n", " Loading dataset from file...\n", "\n", " Calculating kernel matrix, this could take a while...\n", "\n", " --- kernel matrix of path kernel up to 10 of size 185 built in 2.2494258880615234 seconds ---\n", "[[ 1. 0.38888889 0.125 ..., 0.015625 0.015625 0.015625 ]\n", " [ 0.38888889 1. 0.08695652 ..., 0.01481481 0.01481481\n", " 0.01481481]\n", " [ 0.125 0.08695652 1. ..., 0.07438017 0.07438017\n", " 0.07438017]\n", " ..., \n", " [ 0.015625 0.01481481 0.07438017 ..., 1. 0.58169935\n", " 0.38285714]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.58169935 1. 0.43195266]\n", " [ 0.015625 0.01481481 0.07438017 ..., 0.38285714 0.43195266 1. ]]\n", "\n", " Saving kernel matrix to file...\n", "\n", " Mean performance on train set: 1.362078\n", "With standard deviation: 1.854262\n", "\n", " Mean performance on test set: 13.253773\n", "With standard deviation: 5.264247\n", "\n", "\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 12.58 2.73235 12.1209 0.500467 0.377576\n", " 1 12.6215 2.18866 10.2243 0.734261 0.456332\n", " 2 7.42903 2.69395 2.71885 0.732922 0.585278\n", " 3 9.02468 2.50808 1.54 1.13813 0.706556\n", " 4 10.0811 3.6477 1.36029 1.42399 0.847957\n", " 5 11.3005 4.44163 1.08518 1.06206 1.00086\n", " 6 12.186 4.88816 1.06443 1.00191 1.19792\n", " 7 12.7534 5.14529 1.19912 1.34031 1.4372\n", " 8 13.0471 5.27184 1.35822 1.84315 1.68449\n", " 9 13.1789 5.27707 1.36002 1.84834 1.96545\n", " 10 13.2538 5.26425 1.36208 1.85426 2.24943\n" ] } ], "source": [ "%load_ext line_profiler\n", "\n", "import sys\n", "sys.path.insert(0, \"../\")\n", "from pygraph.utils.utils import kernel_train_test\n", "from pygraph.kernels.untildPathKernel import untildpathkernel\n", "\n", "import numpy as np\n", "\n", "datafile = '../../../../datasets/acyclic/Acyclic/dataset_bps.ds'\n", "kernel_file_path = 'kernelmatrices_path_acyclic/'\n", "\n", "kernel_para = dict(node_label = 'atom', edge_label = 'bond_type', labeled = True, k_func = 'tanimoto')\n", "\n", "# kernel_train_test(datafile, kernel_file_path, treeletkernel, kernel_para, normalize = False)\n", "\n", "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n", " hyper_name = 'depth', hyper_range = np.linspace(0, 20, 21), normalize = True)\n", "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n", " hyper_name = 'depth', hyper_range = np.linspace(0, 20, 21), normalize = False)\n", "\n", "kernel_para['k_func'] = 'minmax'\n", "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n", " hyper_name = 'depth', hyper_range = np.linspace(0, 10, 11), normalize = True)\n", "kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, \\\n", " hyper_name = 'depth', hyper_range = np.linspace(0, 10, 11), normalize = False)\n", "\n", "# # kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, normalize = False)\n", "\n", "# kernel_para['depth'] = 10\n", "# %lprun -f untildpathkernel \\\n", "# kernel_train_test(datafile, kernel_file_path, untildpathkernel, kernel_para, normalize = False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# results\n", "\n", "# kernel Tanimoto with y normalization\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- ---------\n", " 0 41.6202 6.453 43.6169 2.13212 0.0904737\n", " 1 38.8446 6.44648 40.8329 3.44147 0.175414\n", " 2 35.2915 4.7813 35.7461 1.61134 0.344896\n", " 3 29.4845 3.90351 28.4646 3.00137 0.553939\n", " 4 22.6693 6.28053 19.2517 3.42893 0.770649\n", " 5 21.7956 5.5225 16.886 2.60519 1.01558\n", " 6 20.6049 5.49983 13.1097 2.58431 1.33302\n", " 7 20.3479 5.17631 12.0152 2.5928 1.60266\n", " 8 19.8228 5.13769 10.7981 2.13082 1.81218\n", " 9 19.8734 5.10369 10.7997 2.09549 2.21726\n", " 10 19.8708 5.09217 10.7787 2.10002 2.41006\n", " 11 19.8708 5.09217 10.7787 2.10002 2.74401\n", " 12 19.8708 5.09217 10.7787 2.10002 2.72344\n", " 13 19.8708 5.09217 10.7787 2.10002 2.61634\n", " 14 19.8708 5.09217 10.7787 2.10002 2.6295\n", " 15 19.8708 5.09217 10.7787 2.10002 2.66416\n", " 16 19.8708 5.09217 10.7787 2.10002 2.73013\n", " 17 19.8708 5.09217 10.7787 2.10002 2.63286\n", " 18 19.8708 5.09217 10.7787 2.10002 2.59294\n", " 19 19.8708 5.09217 10.7787 2.10002 2.63685\n", " 20 19.8708 5.09217 10.7787 2.10002 2.52734\n", "\n", "# kernel Tanimoto without y normalization\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 42.6459 6.56063 42.7871 0.675806 0.102753\n", " 1 39.1743 6.19537 38.8801 0.623999 0.183017\n", " 2 35.6042 4.53921 35.3483 0.727833 0.33236\n", " 3 30.1922 5.11032 28.0476 1.0778 0.540039\n", " 4 23.7515 7.80856 18.8786 1.7119 0.805467\n", " 5 23.4823 7.72712 16.3391 1.39769 1.0196\n", " 6 22.7454 8.02805 12.5238 1.0404 1.2963\n", " 7 22.8316 7.97837 11.3717 0.925446 1.54621\n", " 8 22.5861 8.06789 10.1321 0.52558 1.86582\n", " 9 22.7668 8.00571 10.0785 0.518149 2.18504\n", " 10 22.8697 7.94456 10.0756 0.67282 2.35276\n", " 11 22.8697 7.94456 10.0756 0.67282 2.62744\n", " 12 22.8697 7.94456 10.0756 0.67282 2.72091\n", " 13 22.8697 7.94456 10.0756 0.67282 2.69906\n", " 14 22.8697 7.94456 10.0756 0.67282 2.63283\n", " 15 22.8697 7.94456 10.0756 0.67282 2.6557\n", " 16 22.8697 7.94456 10.0756 0.67282 2.62181\n", " 17 22.8697 7.94456 10.0756 0.67282 2.59382\n", " 18 22.8697 7.94456 10.0756 0.67282 2.65336\n", " 19 22.8697 7.94456 10.0756 0.67282 2.62849\n", " 20 22.8697 7.94456 10.0756 0.67282 2.68269\n", " \n", "# kernel MinMax with y normalization \n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 12.6827 2.74882 12.2079 0.700182 0.38939\n", " 1 12.6098 2.37278 10.2792 0.914688 0.472962\n", " 2 8.06061 2.47045 2.58881 0.557162 0.576836\n", " 3 9.75514 3.04917 1.27267 0.760432 0.716913\n", " 4 10.3192 3.61667 1.03229 0.72838 0.834242\n", " 5 10.6593 4.12052 0.923543 0.660532 0.993821\n", " 6 11.1025 4.33055 0.878589 0.603598 1.17534\n", " 7 11.353 4.30546 0.944049 0.694844 1.43584\n", " 8 11.299 4.34965 1.03398 0.775622 1.7006\n", " 9 11.3327 4.32412 1.00319 0.57207 2.01943\n", " 10 11.3435 4.32726 1.00227 0.570937 2.24333\n", "\n", "# kernel MinMax without y normalization\n", " depth rmse_test std_test rmse_train std_train k_time\n", "------- ----------- ---------- ------------ ----------- --------\n", " 0 12.58 2.73235 12.1209 0.500467 0.377576\n", " 1 12.6215 2.18866 10.2243 0.734261 0.456332\n", " 2 7.42903 2.69395 2.71885 0.732922 0.585278\n", " 3 9.02468 2.50808 1.54 1.13813 0.706556\n", " 4 10.0811 3.6477 1.36029 1.42399 0.847957\n", " 5 11.3005 4.44163 1.08518 1.06206 1.00086\n", " 6 12.186 4.88816 1.06443 1.00191 1.19792\n", " 7 12.7534 5.14529 1.19912 1.34031 1.4372\n", " 8 13.0471 5.27184 1.35822 1.84315 1.68449\n", " 9 13.1789 5.27707 1.36002 1.84834 1.96545\n", " 10 13.2538 5.26425 1.36208 1.85426 2.24943" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }