In [1]:
import pandas as pd
import numpy as np
import seaborn as sns
import src.misc.paths as path

%matplotlib inline

import src.vector_gen.generateTimeInformationVector as gtiv
import src.vector_gen.generate_VectorY as gvy

training_files = "../../dataset/training/"
trajectories_file = "trajectories(table 5)_training.csv"
trajectories_df = pd.read_csv(training_files+trajectories_file)

prepare data


In [2]:
df_ti = gtiv.generate_timeInformation_df(trajectories_df)
df_y = gvy.generate_VectorY_df(trajectories_df)

df_ti


Out[2]:
weekday hour minute
2016-07-19 00:00:00 1 0 0
2016-07-19 02:00:00 1 2 0
2016-07-19 04:00:00 1 4 0
2016-07-19 06:00:00 1 6 0
2016-07-19 08:00:00 1 8 0
2016-07-19 10:00:00 1 10 0
2016-07-19 12:00:00 1 12 0
2016-07-19 14:00:00 1 14 0
2016-07-19 16:00:00 1 16 0
2016-07-19 18:00:00 1 18 0
2016-07-19 20:00:00 1 20 0
2016-07-19 22:00:00 1 22 0
2016-07-20 00:00:00 2 0 0
2016-07-20 02:00:00 2 2 0
2016-07-20 04:00:00 2 4 0
2016-07-20 06:00:00 2 6 0
2016-07-20 08:00:00 2 8 0
2016-07-20 10:00:00 2 10 0
2016-07-20 12:00:00 2 12 0
2016-07-20 14:00:00 2 14 0
2016-07-20 16:00:00 2 16 0
2016-07-20 18:00:00 2 18 0
2016-07-20 20:00:00 2 20 0
2016-07-20 22:00:00 2 22 0
2016-07-21 00:00:00 3 0 0
2016-07-21 02:00:00 3 2 0
2016-07-21 04:00:00 3 4 0
2016-07-21 06:00:00 3 6 0
2016-07-21 08:00:00 3 8 0
2016-07-21 10:00:00 3 10 0
... ... ... ...
2016-10-15 10:00:00 5 10 0
2016-10-15 12:00:00 5 12 0
2016-10-15 14:00:00 5 14 0
2016-10-15 16:00:00 5 16 0
2016-10-15 18:00:00 5 18 0
2016-10-15 20:00:00 5 20 0
2016-10-15 22:00:00 5 22 0
2016-10-16 00:00:00 6 0 0
2016-10-16 02:00:00 6 2 0
2016-10-16 04:00:00 6 4 0
2016-10-16 06:00:00 6 6 0
2016-10-16 08:00:00 6 8 0
2016-10-16 10:00:00 6 10 0
2016-10-16 12:00:00 6 12 0
2016-10-16 14:00:00 6 14 0
2016-10-16 16:00:00 6 16 0
2016-10-16 18:00:00 6 18 0
2016-10-16 20:00:00 6 20 0
2016-10-16 22:00:00 6 22 0
2016-10-17 00:00:00 0 0 0
2016-10-17 02:00:00 0 2 0
2016-10-17 04:00:00 0 4 0
2016-10-17 06:00:00 0 6 0
2016-10-17 08:00:00 0 8 0
2016-10-17 10:00:00 0 10 0
2016-10-17 12:00:00 0 12 0
2016-10-17 14:00:00 0 14 0
2016-10-17 16:00:00 0 16 0
2016-10-17 18:00:00 0 18 0
2016-10-17 20:00:00 0 20 0

1091 rows × 3 columns


In [3]:
df_y


Out[3]:
tw 0 1 ... 4 5
routes A2 A3 B1 B3 C1 C3 A2 A3 B1 B3 ... B1 B3 C1 C3 A2 A3 B1 B3 C1 C3
2016-07-19 00:00:00 46.02 60.06 18.62 70.85 38.50 27.91 58.05 64.30 79.76 148.79 ... 176.70 39.41 214.87 16.20 77.74 45.09 9.92 93.72 160.63 8.17
2016-07-19 02:00:00 37.09 35.27 15.58 67.81 8.36 17.12 42.64 77.61 10.38 25.51 ... 11.06 31.36 13.87 11.76 39.43 46.12 12.01 98.49 12.14 7.78
2016-07-19 04:00:00 48.13 45.88 9.91 96.67 15.55 9.84 62.11 40.29 94.06 53.15 ... 66.98 48.19 30.07 26.15 58.08 70.58 87.83 48.22 67.51 33.00
2016-07-19 06:00:00 46.36 124.66 170.09 145.94 160.38 42.83 48.59 89.85 64.27 127.35 ... 73.54 82.63 92.15 236.12 58.97 155.49 69.42 110.50 180.11 60.60
2016-07-19 08:00:00 81.60 137.38 97.06 125.76 151.39 120.73 80.21 165.48 128.75 141.33 ... 104.33 127.38 164.52 104.67 69.66 129.28 87.74 117.83 132.77 139.70
2016-07-19 10:00:00 78.31 99.04 132.68 98.92 200.92 139.70 59.41 129.30 170.59 113.00 ... 74.90 84.36 195.16 93.07 47.98 86.68 80.95 96.54 182.46 88.35
2016-07-19 12:00:00 60.17 108.74 145.29 144.87 142.74 91.15 49.53 95.43 71.36 136.36 ... 140.65 119.37 172.16 180.09 61.13 102.92 99.61 176.65 117.03 140.79
2016-07-19 14:00:00 65.11 96.92 179.98 159.46 147.60 174.84 74.71 101.41 160.78 129.48 ... 163.81 129.47 257.20 185.51 58.74 112.32 90.01 120.76 137.86 125.78
2016-07-19 16:00:00 59.64 126.61 78.76 116.07 144.70 183.07 51.97 95.45 105.64 152.50 ... 66.65 103.67 192.50 172.78 65.67 102.47 82.13 109.30 141.04 203.77
2016-07-19 18:00:00 85.11 99.14 77.42 108.30 202.21 134.43 50.57 109.12 382.03 91.94 ... 62.14 115.99 83.93 219.38 89.64 128.92 115.00 209.49 83.93 90.56
2016-07-19 20:00:00 87.94 113.02 128.65 112.25 164.91 72.64 44.09 105.55 59.01 84.75 ... 155.63 133.02 114.64 65.92 51.18 108.17 129.93 96.96 74.71 185.62
2016-07-19 22:00:00 46.09 141.25 35.65 149.31 83.33 51.67 91.85 87.91 37.17 100.55 ... 32.59 61.42 28.59 285.82 67.96 85.08 23.50 121.11 35.92 21.77
2016-07-20 00:00:00 46.02 81.05 18.62 50.16 38.50 27.91 37.89 62.65 16.13 45.35 ... 20.83 39.41 135.02 16.20 40.75 107.08 9.92 33.25 18.98 8.17
2016-07-20 02:00:00 49.12 35.27 15.58 28.74 8.36 17.12 18.68 82.09 10.38 127.48 ... 11.06 104.71 13.87 11.76 100.71 46.12 12.01 148.14 12.14 7.78
2016-07-20 04:00:00 105.65 144.06 9.91 113.72 15.55 9.84 64.32 77.24 30.23 129.63 ... 22.54 48.19 30.07 26.15 46.20 151.55 36.27 48.22 67.51 125.32
2016-07-20 06:00:00 44.10 97.48 122.68 112.36 74.69 42.83 59.87 102.50 67.35 386.44 ... 98.20 133.20 92.15 424.79 73.68 128.13 94.11 137.98 130.56 175.09
2016-07-20 08:00:00 61.01 140.36 212.31 182.66 237.40 155.16 332.16 192.68 81.16 127.68 ... 115.11 142.06 199.87 104.67 23.30 250.81 155.41 170.11 171.96 102.43
2016-07-20 10:00:00 341.79 175.94 107.35 103.82 228.74 221.42 70.14 118.92 91.98 146.52 ... 74.90 157.70 117.66 202.93 60.48 107.66 98.20 80.52 125.28 111.24
2016-07-20 12:00:00 53.99 105.16 76.36 111.79 187.53 91.15 49.55 109.57 91.31 47.27 ... 89.11 65.45 147.59 123.63 73.50 99.35 231.91 127.10 154.89 164.01
2016-07-20 14:00:00 66.64 115.73 155.33 95.36 147.60 203.20 57.33 112.98 159.89 110.72 ... 90.47 134.65 166.11 203.75 70.33 116.61 71.68 174.75 215.74 125.78
2016-07-20 16:00:00 67.11 87.68 144.83 130.69 105.20 159.47 82.79 126.26 80.05 98.28 ... 66.65 131.36 125.53 148.84 75.48 123.79 82.13 134.24 175.44 214.36
2016-07-20 18:00:00 67.89 114.30 77.42 101.55 213.84 200.78 85.11 102.69 69.72 113.77 ... 62.14 90.80 257.77 131.43 52.10 137.11 52.30 103.43 263.10 234.90
2016-07-20 20:00:00 57.61 116.09 115.93 91.33 205.59 72.64 52.58 113.43 59.01 156.44 ... 61.55 86.44 205.68 65.92 68.68 110.21 46.81 111.47 162.60 158.17
2016-07-20 22:00:00 55.45 108.71 121.78 91.52 150.18 185.89 44.94 88.03 37.17 62.19 ... 32.59 61.42 167.24 34.71 56.67 80.57 23.50 112.89 35.92 21.77
2016-07-21 00:00:00 39.21 82.98 18.62 85.00 38.50 27.91 36.43 95.15 16.13 45.35 ... 20.83 65.78 21.36 16.20 80.25 45.09 9.92 22.18 18.98 8.17
2016-07-21 02:00:00 45.19 35.27 15.58 28.74 8.36 17.12 28.59 35.20 10.38 25.51 ... 11.06 31.36 13.87 11.76 83.48 46.12 12.01 29.13 12.14 7.78
2016-07-21 04:00:00 51.53 90.69 9.91 23.75 15.55 9.84 49.89 40.29 93.61 393.05 ... 22.54 48.19 30.07 26.15 56.69 133.45 36.27 48.22 67.51 33.00
2016-07-21 06:00:00 63.18 86.80 56.34 166.81 218.35 42.83 87.03 94.82 64.27 136.67 ... 73.54 113.78 92.15 72.12 114.72 189.61 99.63 146.58 133.55 60.60
2016-07-21 08:00:00 116.07 160.08 151.02 107.11 125.38 64.31 125.10 151.10 108.87 111.23 ... 125.44 119.13 180.06 104.67 88.66 132.49 162.56 108.62 168.40 108.18
2016-07-21 10:00:00 68.50 130.22 151.15 103.82 131.04 100.98 64.06 115.15 91.98 107.04 ... 70.34 108.52 175.72 207.92 58.84 79.98 89.66 168.37 147.73 88.35
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2016-10-15 10:00:00 141.55 479.41 193.03 82.13 130.52 195.73 142.34 225.43 215.81 80.56 ... 102.47 99.52 183.99 243.18 51.78 110.14 126.93 125.04 193.78 178.96
2016-10-15 12:00:00 55.49 108.68 148.88 90.00 175.20 91.15 75.10 102.03 194.71 111.61 ... 131.88 123.81 311.30 211.62 76.85 107.19 322.43 94.48 345.66 210.76
2016-10-15 14:00:00 70.85 101.44 369.30 147.15 480.54 131.23 68.73 129.67 132.41 112.88 ... 99.66 72.51 226.76 200.01 64.57 105.97 166.30 131.37 220.01 195.49
2016-10-15 16:00:00 62.82 186.11 131.17 120.68 183.74 173.84 55.51 136.59 187.96 156.38 ... 118.43 143.56 288.68 201.31 56.20 131.52 208.65 116.47 156.18 176.67
2016-10-15 18:00:00 69.84 140.16 117.03 92.53 208.13 95.01 61.47 107.73 113.36 39.24 ... 62.14 104.38 174.08 79.10 54.73 116.60 121.98 76.71 83.93 187.67
2016-10-15 20:00:00 49.56 113.54 131.56 81.32 90.82 557.39 71.34 85.96 92.39 73.55 ... 61.55 75.68 160.54 127.78 61.11 85.04 152.00 81.70 181.06 57.90
2016-10-15 22:00:00 56.07 98.05 150.00 81.24 208.41 51.67 32.25 82.48 134.46 100.07 ... 164.11 137.85 28.59 127.32 59.24 91.96 88.84 94.80 142.51 21.77
2016-10-16 00:00:00 59.43 60.06 18.62 71.69 38.50 176.72 45.70 300.65 93.32 45.35 ... 20.83 53.37 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-16 02:00:00 91.74 35.27 15.58 12.09 8.36 17.12 36.26 35.20 10.38 25.51 ... 11.06 206.38 13.87 11.76 54.07 126.42 12.01 29.13 12.14 7.78
2016-10-16 04:00:00 45.65 28.72 9.91 23.75 15.55 9.84 42.17 40.29 30.23 35.97 ... 22.54 86.44 114.24 26.15 44.47 94.31 36.27 48.22 285.05 33.00
2016-10-16 06:00:00 44.35 107.90 56.34 62.56 74.69 42.83 43.37 97.01 64.27 90.34 ... 112.56 94.86 137.52 72.12 49.07 101.45 116.25 105.92 186.40 189.78
2016-10-16 08:00:00 65.10 114.11 112.75 93.91 166.49 64.31 78.61 135.07 102.82 98.29 ... 121.36 80.88 177.79 141.18 66.83 227.94 97.21 94.94 165.23 181.15
2016-10-16 10:00:00 72.15 171.94 103.33 54.65 210.89 124.70 70.30 132.77 124.10 79.78 ... 149.32 59.31 144.38 103.01 55.31 95.59 80.95 126.53 440.99 227.12
2016-10-16 12:00:00 64.06 93.59 134.29 100.55 266.24 152.97 54.81 95.45 143.35 102.87 ... 112.56 99.43 195.02 230.93 79.16 183.45 132.12 111.54 201.60 201.56
2016-10-16 14:00:00 52.68 175.09 149.55 103.92 253.72 190.71 60.43 118.46 91.03 128.19 ... 128.09 135.54 234.90 209.33 66.86 85.67 120.06 106.91 210.66 286.61
2016-10-16 16:00:00 72.75 168.21 133.51 103.95 264.98 235.16 71.52 164.68 172.85 97.74 ... 153.68 117.52 226.31 215.28 93.63 93.54 183.33 110.75 180.95 224.67
2016-10-16 18:00:00 63.15 135.56 117.24 110.04 241.96 141.09 70.38 128.98 69.72 104.61 ... 160.60 68.83 269.18 156.06 68.37 94.52 52.30 104.63 202.09 190.96
2016-10-16 20:00:00 64.10 123.63 120.15 87.52 164.39 153.81 54.89 104.32 112.66 90.29 ... 106.95 81.92 224.93 65.92 357.05 105.93 110.85 78.72 74.71 57.90
2016-10-16 22:00:00 64.01 103.64 35.65 106.78 183.47 51.67 58.27 105.03 37.17 62.19 ... 80.86 61.42 28.59 34.71 52.26 84.51 23.50 90.29 35.92 21.77
2016-10-17 00:00:00 59.61 89.41 95.71 70.85 38.50 27.91 40.03 77.48 16.13 125.27 ... 106.77 88.43 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-17 02:00:00 37.09 35.27 15.58 28.74 8.36 17.12 51.25 35.20 10.38 25.51 ... 11.06 93.78 13.87 11.76 47.24 46.12 12.01 29.13 12.14 7.78
2016-10-17 04:00:00 56.49 91.66 9.91 73.25 15.55 9.84 69.42 126.47 30.23 35.97 ... 22.54 48.19 30.07 26.15 45.24 72.77 135.14 113.93 67.51 33.00
2016-10-17 06:00:00 43.74 68.25 56.34 83.62 196.30 42.83 48.09 140.63 75.72 43.62 ... 73.54 69.52 224.46 72.12 72.16 171.10 136.97 110.83 168.88 60.60
2016-10-17 08:00:00 133.58 306.58 108.63 147.11 165.10 64.31 108.33 296.26 115.41 118.52 ... 108.23 149.29 151.34 104.67 53.21 128.11 122.42 120.32 265.43 218.18
2016-10-17 10:00:00 64.87 118.49 161.91 129.52 142.21 220.20 76.01 132.14 88.98 50.23 ... 102.55 102.44 153.59 93.07 44.09 98.61 100.05 109.67 172.90 88.35
2016-10-17 12:00:00 65.24 99.45 131.03 94.10 167.98 104.38 45.44 104.89 104.69 77.63 ... 111.03 84.63 218.76 169.18 64.32 93.51 134.56 81.00 165.84 149.21
2016-10-17 14:00:00 52.28 84.48 99.41 98.19 191.14 131.23 70.19 100.53 147.23 104.86 ... 138.69 82.67 134.58 124.07 71.70 131.03 76.92 126.84 483.07 125.78
2016-10-17 16:00:00 53.86 109.92 134.99 115.47 180.28 171.02 69.77 111.73 136.45 100.27 ... 130.78 118.25 170.14 122.02 53.69 125.55 177.36 102.55 132.85 107.45
2016-10-17 18:00:00 65.40 158.01 77.42 102.74 267.11 173.74 48.66 115.05 98.47 83.02 ... 62.14 91.64 83.93 79.10 65.93 86.11 99.04 96.84 188.23 187.43
2016-10-17 20:00:00 52.66 101.30 62.67 99.77 90.82 209.32 72.69 137.58 172.53 84.75 ... 61.55 61.96 121.61 159.44 39.55 100.03 46.81 73.88 74.71 57.90

1091 rows × 36 columns


In [4]:
df_all = df_ti.join(df_y)
df_all


C:\Anaconda3\lib\site-packages\pandas\tools\merge.py:205: UserWarning: merging between different levels can give an unintended result (1 levels on the left, 2 on the right)
  warnings.warn(msg, UserWarning)
Out[4]:
weekday hour minute (0, A2) (0, A3) (0, B1) (0, B3) (0, C1) (0, C3) (1, A2) ... (4, B1) (4, B3) (4, C1) (4, C3) (5, A2) (5, A3) (5, B1) (5, B3) (5, C1) (5, C3)
2016-07-19 00:00:00 1 0 0 46.02 60.06 18.62 70.85 38.50 27.91 58.05 ... 176.70 39.41 214.87 16.20 77.74 45.09 9.92 93.72 160.63 8.17
2016-07-19 02:00:00 1 2 0 37.09 35.27 15.58 67.81 8.36 17.12 42.64 ... 11.06 31.36 13.87 11.76 39.43 46.12 12.01 98.49 12.14 7.78
2016-07-19 04:00:00 1 4 0 48.13 45.88 9.91 96.67 15.55 9.84 62.11 ... 66.98 48.19 30.07 26.15 58.08 70.58 87.83 48.22 67.51 33.00
2016-07-19 06:00:00 1 6 0 46.36 124.66 170.09 145.94 160.38 42.83 48.59 ... 73.54 82.63 92.15 236.12 58.97 155.49 69.42 110.50 180.11 60.60
2016-07-19 08:00:00 1 8 0 81.60 137.38 97.06 125.76 151.39 120.73 80.21 ... 104.33 127.38 164.52 104.67 69.66 129.28 87.74 117.83 132.77 139.70
2016-07-19 10:00:00 1 10 0 78.31 99.04 132.68 98.92 200.92 139.70 59.41 ... 74.90 84.36 195.16 93.07 47.98 86.68 80.95 96.54 182.46 88.35
2016-07-19 12:00:00 1 12 0 60.17 108.74 145.29 144.87 142.74 91.15 49.53 ... 140.65 119.37 172.16 180.09 61.13 102.92 99.61 176.65 117.03 140.79
2016-07-19 14:00:00 1 14 0 65.11 96.92 179.98 159.46 147.60 174.84 74.71 ... 163.81 129.47 257.20 185.51 58.74 112.32 90.01 120.76 137.86 125.78
2016-07-19 16:00:00 1 16 0 59.64 126.61 78.76 116.07 144.70 183.07 51.97 ... 66.65 103.67 192.50 172.78 65.67 102.47 82.13 109.30 141.04 203.77
2016-07-19 18:00:00 1 18 0 85.11 99.14 77.42 108.30 202.21 134.43 50.57 ... 62.14 115.99 83.93 219.38 89.64 128.92 115.00 209.49 83.93 90.56
2016-07-19 20:00:00 1 20 0 87.94 113.02 128.65 112.25 164.91 72.64 44.09 ... 155.63 133.02 114.64 65.92 51.18 108.17 129.93 96.96 74.71 185.62
2016-07-19 22:00:00 1 22 0 46.09 141.25 35.65 149.31 83.33 51.67 91.85 ... 32.59 61.42 28.59 285.82 67.96 85.08 23.50 121.11 35.92 21.77
2016-07-20 00:00:00 2 0 0 46.02 81.05 18.62 50.16 38.50 27.91 37.89 ... 20.83 39.41 135.02 16.20 40.75 107.08 9.92 33.25 18.98 8.17
2016-07-20 02:00:00 2 2 0 49.12 35.27 15.58 28.74 8.36 17.12 18.68 ... 11.06 104.71 13.87 11.76 100.71 46.12 12.01 148.14 12.14 7.78
2016-07-20 04:00:00 2 4 0 105.65 144.06 9.91 113.72 15.55 9.84 64.32 ... 22.54 48.19 30.07 26.15 46.20 151.55 36.27 48.22 67.51 125.32
2016-07-20 06:00:00 2 6 0 44.10 97.48 122.68 112.36 74.69 42.83 59.87 ... 98.20 133.20 92.15 424.79 73.68 128.13 94.11 137.98 130.56 175.09
2016-07-20 08:00:00 2 8 0 61.01 140.36 212.31 182.66 237.40 155.16 332.16 ... 115.11 142.06 199.87 104.67 23.30 250.81 155.41 170.11 171.96 102.43
2016-07-20 10:00:00 2 10 0 341.79 175.94 107.35 103.82 228.74 221.42 70.14 ... 74.90 157.70 117.66 202.93 60.48 107.66 98.20 80.52 125.28 111.24
2016-07-20 12:00:00 2 12 0 53.99 105.16 76.36 111.79 187.53 91.15 49.55 ... 89.11 65.45 147.59 123.63 73.50 99.35 231.91 127.10 154.89 164.01
2016-07-20 14:00:00 2 14 0 66.64 115.73 155.33 95.36 147.60 203.20 57.33 ... 90.47 134.65 166.11 203.75 70.33 116.61 71.68 174.75 215.74 125.78
2016-07-20 16:00:00 2 16 0 67.11 87.68 144.83 130.69 105.20 159.47 82.79 ... 66.65 131.36 125.53 148.84 75.48 123.79 82.13 134.24 175.44 214.36
2016-07-20 18:00:00 2 18 0 67.89 114.30 77.42 101.55 213.84 200.78 85.11 ... 62.14 90.80 257.77 131.43 52.10 137.11 52.30 103.43 263.10 234.90
2016-07-20 20:00:00 2 20 0 57.61 116.09 115.93 91.33 205.59 72.64 52.58 ... 61.55 86.44 205.68 65.92 68.68 110.21 46.81 111.47 162.60 158.17
2016-07-20 22:00:00 2 22 0 55.45 108.71 121.78 91.52 150.18 185.89 44.94 ... 32.59 61.42 167.24 34.71 56.67 80.57 23.50 112.89 35.92 21.77
2016-07-21 00:00:00 3 0 0 39.21 82.98 18.62 85.00 38.50 27.91 36.43 ... 20.83 65.78 21.36 16.20 80.25 45.09 9.92 22.18 18.98 8.17
2016-07-21 02:00:00 3 2 0 45.19 35.27 15.58 28.74 8.36 17.12 28.59 ... 11.06 31.36 13.87 11.76 83.48 46.12 12.01 29.13 12.14 7.78
2016-07-21 04:00:00 3 4 0 51.53 90.69 9.91 23.75 15.55 9.84 49.89 ... 22.54 48.19 30.07 26.15 56.69 133.45 36.27 48.22 67.51 33.00
2016-07-21 06:00:00 3 6 0 63.18 86.80 56.34 166.81 218.35 42.83 87.03 ... 73.54 113.78 92.15 72.12 114.72 189.61 99.63 146.58 133.55 60.60
2016-07-21 08:00:00 3 8 0 116.07 160.08 151.02 107.11 125.38 64.31 125.10 ... 125.44 119.13 180.06 104.67 88.66 132.49 162.56 108.62 168.40 108.18
2016-07-21 10:00:00 3 10 0 68.50 130.22 151.15 103.82 131.04 100.98 64.06 ... 70.34 108.52 175.72 207.92 58.84 79.98 89.66 168.37 147.73 88.35
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2016-10-15 10:00:00 5 10 0 141.55 479.41 193.03 82.13 130.52 195.73 142.34 ... 102.47 99.52 183.99 243.18 51.78 110.14 126.93 125.04 193.78 178.96
2016-10-15 12:00:00 5 12 0 55.49 108.68 148.88 90.00 175.20 91.15 75.10 ... 131.88 123.81 311.30 211.62 76.85 107.19 322.43 94.48 345.66 210.76
2016-10-15 14:00:00 5 14 0 70.85 101.44 369.30 147.15 480.54 131.23 68.73 ... 99.66 72.51 226.76 200.01 64.57 105.97 166.30 131.37 220.01 195.49
2016-10-15 16:00:00 5 16 0 62.82 186.11 131.17 120.68 183.74 173.84 55.51 ... 118.43 143.56 288.68 201.31 56.20 131.52 208.65 116.47 156.18 176.67
2016-10-15 18:00:00 5 18 0 69.84 140.16 117.03 92.53 208.13 95.01 61.47 ... 62.14 104.38 174.08 79.10 54.73 116.60 121.98 76.71 83.93 187.67
2016-10-15 20:00:00 5 20 0 49.56 113.54 131.56 81.32 90.82 557.39 71.34 ... 61.55 75.68 160.54 127.78 61.11 85.04 152.00 81.70 181.06 57.90
2016-10-15 22:00:00 5 22 0 56.07 98.05 150.00 81.24 208.41 51.67 32.25 ... 164.11 137.85 28.59 127.32 59.24 91.96 88.84 94.80 142.51 21.77
2016-10-16 00:00:00 6 0 0 59.43 60.06 18.62 71.69 38.50 176.72 45.70 ... 20.83 53.37 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-16 02:00:00 6 2 0 91.74 35.27 15.58 12.09 8.36 17.12 36.26 ... 11.06 206.38 13.87 11.76 54.07 126.42 12.01 29.13 12.14 7.78
2016-10-16 04:00:00 6 4 0 45.65 28.72 9.91 23.75 15.55 9.84 42.17 ... 22.54 86.44 114.24 26.15 44.47 94.31 36.27 48.22 285.05 33.00
2016-10-16 06:00:00 6 6 0 44.35 107.90 56.34 62.56 74.69 42.83 43.37 ... 112.56 94.86 137.52 72.12 49.07 101.45 116.25 105.92 186.40 189.78
2016-10-16 08:00:00 6 8 0 65.10 114.11 112.75 93.91 166.49 64.31 78.61 ... 121.36 80.88 177.79 141.18 66.83 227.94 97.21 94.94 165.23 181.15
2016-10-16 10:00:00 6 10 0 72.15 171.94 103.33 54.65 210.89 124.70 70.30 ... 149.32 59.31 144.38 103.01 55.31 95.59 80.95 126.53 440.99 227.12
2016-10-16 12:00:00 6 12 0 64.06 93.59 134.29 100.55 266.24 152.97 54.81 ... 112.56 99.43 195.02 230.93 79.16 183.45 132.12 111.54 201.60 201.56
2016-10-16 14:00:00 6 14 0 52.68 175.09 149.55 103.92 253.72 190.71 60.43 ... 128.09 135.54 234.90 209.33 66.86 85.67 120.06 106.91 210.66 286.61
2016-10-16 16:00:00 6 16 0 72.75 168.21 133.51 103.95 264.98 235.16 71.52 ... 153.68 117.52 226.31 215.28 93.63 93.54 183.33 110.75 180.95 224.67
2016-10-16 18:00:00 6 18 0 63.15 135.56 117.24 110.04 241.96 141.09 70.38 ... 160.60 68.83 269.18 156.06 68.37 94.52 52.30 104.63 202.09 190.96
2016-10-16 20:00:00 6 20 0 64.10 123.63 120.15 87.52 164.39 153.81 54.89 ... 106.95 81.92 224.93 65.92 357.05 105.93 110.85 78.72 74.71 57.90
2016-10-16 22:00:00 6 22 0 64.01 103.64 35.65 106.78 183.47 51.67 58.27 ... 80.86 61.42 28.59 34.71 52.26 84.51 23.50 90.29 35.92 21.77
2016-10-17 00:00:00 0 0 0 59.61 89.41 95.71 70.85 38.50 27.91 40.03 ... 106.77 88.43 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-17 02:00:00 0 2 0 37.09 35.27 15.58 28.74 8.36 17.12 51.25 ... 11.06 93.78 13.87 11.76 47.24 46.12 12.01 29.13 12.14 7.78
2016-10-17 04:00:00 0 4 0 56.49 91.66 9.91 73.25 15.55 9.84 69.42 ... 22.54 48.19 30.07 26.15 45.24 72.77 135.14 113.93 67.51 33.00
2016-10-17 06:00:00 0 6 0 43.74 68.25 56.34 83.62 196.30 42.83 48.09 ... 73.54 69.52 224.46 72.12 72.16 171.10 136.97 110.83 168.88 60.60
2016-10-17 08:00:00 0 8 0 133.58 306.58 108.63 147.11 165.10 64.31 108.33 ... 108.23 149.29 151.34 104.67 53.21 128.11 122.42 120.32 265.43 218.18
2016-10-17 10:00:00 0 10 0 64.87 118.49 161.91 129.52 142.21 220.20 76.01 ... 102.55 102.44 153.59 93.07 44.09 98.61 100.05 109.67 172.90 88.35
2016-10-17 12:00:00 0 12 0 65.24 99.45 131.03 94.10 167.98 104.38 45.44 ... 111.03 84.63 218.76 169.18 64.32 93.51 134.56 81.00 165.84 149.21
2016-10-17 14:00:00 0 14 0 52.28 84.48 99.41 98.19 191.14 131.23 70.19 ... 138.69 82.67 134.58 124.07 71.70 131.03 76.92 126.84 483.07 125.78
2016-10-17 16:00:00 0 16 0 53.86 109.92 134.99 115.47 180.28 171.02 69.77 ... 130.78 118.25 170.14 122.02 53.69 125.55 177.36 102.55 132.85 107.45
2016-10-17 18:00:00 0 18 0 65.40 158.01 77.42 102.74 267.11 173.74 48.66 ... 62.14 91.64 83.93 79.10 65.93 86.11 99.04 96.84 188.23 187.43
2016-10-17 20:00:00 0 20 0 52.66 101.30 62.67 99.77 90.82 209.32 72.69 ... 61.55 61.96 121.61 159.44 39.55 100.03 46.81 73.88 74.71 57.90

1091 rows × 39 columns

Features


In [5]:
feature_cols = ['hour', 'minute', 'weekday']
y_cols = [('0', 'A2'), ('0', 'A3'),
       ('0', 'B1'), ('0', 'B3'), ('0', 'C1'), ('0', 'C3'), ('1', 'A2'),
       ('1', 'A3'), ('1', 'B1'), ('1', 'B3'), ('1', 'C1'), ('1', 'C3'),
       ('2', 'A2'), ('2', 'A3'), ('2', 'B1'), ('2', 'B3'), ('2', 'C1'),
       ('2', 'C3'), ('3', 'A2'), ('3', 'A3'), ('3', 'B1'), ('3', 'B3'),
       ('3', 'C1'), ('3', 'C3'), ('4', 'A2'), ('4', 'A3'), ('4', 'B1'),
       ('4', 'B3'), ('4', 'C1'), ('4', 'C3'), ('5', 'A2'), ('5', 'A3'),
       ('5', 'B1'), ('5', 'B3'), ('5', 'C1'), ('5', 'C3')]

plots


In [6]:
sns.pairplot(df_all, x_vars=feature_cols, y_vars=y_cols, size=6, aspect=1.3, kind='reg')


Out[6]:
<seaborn.axisgrid.PairGrid at 0x26198616080>

split train and test


In [7]:
# not working!?!?!
#import src.misc.split_train_valid as split
#training, validation, testing = split.split_dataset(df_all, train = 0.9, validation = 0.000001)

In [8]:
#from sklearn.model_selection import train_test_split
#x_train, x_test, y_train, y_test = train_test_split(df[feature_cols], df['avg_travel_time'], test_size=0.2, random_state=42)

# k-fold cross validation
# 13 weeks

In [9]:
7*12


Out[9]:
84

from sklearn.model_selection import KFold

split per week

splits=[] kf = KFold(n_splits=5, random_state=None, shuffle=False) for train_idxs, test_idxs in kf.split(df_all): splits.append((df_all.iloc[train_idxs], df_all.iloc[test_idxs])) print(len(train_idxs), len(test_idxs))

a = splits[0][0] a


In [10]:
# split
train_weeks = 12 # of 13
train_rows = train_weeks*7*12

train = df_all[:train_rows]
test = df_all[train_rows:]

# define
x_train = train[feature_cols]
y_train = train[y_cols]
x_test = test[feature_cols]
y_test = test[y_cols]

In [11]:
y_test


Out[11]:
(0, A2) (0, A3) (0, B1) (0, B3) (0, C1) (0, C3) (1, A2) (1, A3) (1, B1) (1, B3) ... (4, B1) (4, B3) (4, C1) (4, C3) (5, A2) (5, A3) (5, B1) (5, B3) (5, C1) (5, C3)
2016-10-11 00:00:00 52.28 60.06 18.62 50.16 38.50 27.91 37.07 107.80 16.13 103.27 ... 20.83 39.41 21.36 16.20 27.07 45.09 69.89 94.61 18.98 8.17
2016-10-11 02:00:00 37.09 35.27 15.58 28.74 8.36 17.12 52.36 35.20 10.38 75.56 ... 11.06 31.36 13.87 11.76 53.40 46.12 99.88 29.13 12.14 7.78
2016-10-11 04:00:00 38.38 45.88 9.91 23.75 15.55 9.84 53.69 40.29 30.23 35.97 ... 22.54 48.19 164.07 156.45 41.32 77.45 90.51 48.22 206.02 33.00
2016-10-11 06:00:00 44.41 97.47 125.78 62.56 74.69 42.83 32.56 127.90 96.05 71.58 ... 127.86 143.01 158.56 72.12 50.97 137.73 134.92 110.76 173.09 190.27
2016-10-11 08:00:00 68.09 146.16 86.56 142.52 158.31 64.31 75.02 168.43 127.10 93.00 ... 120.29 104.09 129.01 202.18 70.26 121.44 93.94 133.37 166.25 117.08
2016-10-11 10:00:00 58.42 134.14 128.12 133.50 241.20 100.98 59.50 122.61 96.85 231.31 ... 97.47 93.11 202.58 93.07 72.78 96.14 102.81 102.93 145.38 132.98
2016-10-11 12:00:00 62.17 168.92 140.94 81.62 159.03 206.08 67.42 105.85 134.51 129.76 ... 101.64 106.02 188.35 123.63 61.31 122.76 106.54 103.98 198.28 132.72
2016-10-11 14:00:00 63.76 84.14 131.75 160.78 198.61 159.13 70.16 104.73 106.43 110.78 ... 120.09 113.49 177.20 124.07 80.86 112.35 107.40 124.56 186.99 151.44
2016-10-11 16:00:00 66.96 102.97 85.30 97.92 151.63 143.58 85.57 100.22 93.09 130.13 ... 111.53 103.08 193.29 183.23 67.00 146.57 254.55 76.11 230.08 218.23
2016-10-11 18:00:00 48.92 112.86 204.27 113.66 250.10 95.01 121.45 280.83 126.37 64.97 ... 128.57 129.44 160.61 79.10 77.23 115.81 128.59 102.91 170.00 207.18
2016-10-11 20:00:00 88.02 98.23 108.57 95.91 153.19 72.64 53.83 104.47 93.71 84.75 ... 61.55 268.29 161.02 122.44 74.66 91.72 350.79 120.55 201.53 218.45
2016-10-11 22:00:00 54.76 95.40 148.41 86.69 162.99 51.67 48.85 97.33 37.17 86.00 ... 32.59 136.46 137.63 34.71 50.05 62.06 23.50 39.47 35.92 111.98
2016-10-12 00:00:00 53.89 55.96 18.62 83.32 38.50 27.91 69.38 64.30 16.13 45.35 ... 20.83 39.41 21.36 16.20 27.07 67.30 9.92 22.18 18.98 8.17
2016-10-12 02:00:00 35.75 35.27 15.58 28.74 8.36 17.12 57.34 89.27 10.38 105.41 ... 11.06 83.37 13.87 11.76 60.73 46.12 12.01 29.13 12.14 7.78
2016-10-12 04:00:00 41.58 82.20 9.91 23.75 15.55 9.84 42.86 40.29 30.23 35.97 ... 97.33 87.31 188.20 26.15 58.03 99.03 36.27 48.22 67.51 33.00
2016-10-12 06:00:00 49.68 93.64 100.25 84.28 74.69 42.83 45.53 135.08 64.27 98.94 ... 73.54 73.71 92.15 110.15 63.15 138.92 69.42 153.30 143.44 60.60
2016-10-12 08:00:00 86.16 171.63 117.33 84.05 146.38 175.34 83.28 189.11 184.11 156.47 ... 132.43 168.48 116.31 104.67 65.32 143.11 87.74 156.67 194.99 215.89
2016-10-12 10:00:00 94.91 131.99 107.56 104.83 121.63 209.00 58.60 99.85 106.44 117.59 ... 64.19 76.81 242.19 140.85 57.23 111.28 104.02 110.46 176.85 88.35
2016-10-12 12:00:00 55.71 81.89 120.83 92.75 180.54 174.42 61.98 100.87 82.99 26.74 ... 132.50 103.32 142.53 176.53 64.27 112.77 85.15 103.29 139.48 160.53
2016-10-12 14:00:00 71.25 105.32 113.41 92.04 172.53 115.48 62.77 109.13 142.55 87.21 ... 96.16 81.32 221.58 218.83 50.12 99.73 143.76 95.90 151.01 141.39
2016-10-12 16:00:00 60.51 97.40 126.86 86.15 153.51 170.92 57.58 83.99 111.50 111.87 ... 66.65 93.10 172.73 148.58 78.55 114.99 110.97 103.29 171.72 196.05
2016-10-12 18:00:00 81.69 113.32 127.47 160.28 186.11 146.06 52.32 112.96 132.60 87.50 ... 62.14 102.74 169.59 203.03 67.94 101.71 52.30 51.49 196.28 90.56
2016-10-12 20:00:00 76.01 100.00 89.78 82.10 183.10 72.64 57.85 110.36 130.23 113.44 ... 96.42 97.17 162.05 65.92 66.46 89.55 46.81 98.05 74.71 57.90
2016-10-12 22:00:00 58.35 112.08 35.65 68.51 156.96 51.67 35.44 46.24 96.12 71.62 ... 99.06 80.30 112.53 34.71 42.57 56.12 23.50 121.04 35.92 21.77
2016-10-13 00:00:00 74.92 60.06 18.62 50.16 38.50 27.91 46.58 91.02 16.13 45.35 ... 20.83 39.41 21.36 16.20 50.53 45.09 94.23 22.18 18.98 97.82
2016-10-13 02:00:00 129.60 93.48 15.58 28.74 145.63 17.12 52.09 95.52 10.38 25.51 ... 68.08 31.36 13.87 11.76 73.72 46.12 12.01 29.13 12.14 7.78
2016-10-13 04:00:00 54.43 73.95 9.91 23.75 142.71 9.84 57.76 106.28 100.69 35.97 ... 22.54 107.66 30.07 26.15 37.66 87.00 36.27 95.92 67.51 33.00
2016-10-13 06:00:00 54.31 121.44 119.71 62.56 127.55 42.83 77.89 92.64 138.09 83.66 ... 140.66 16.85 92.15 119.28 87.81 114.64 102.54 106.15 214.35 212.35
2016-10-13 08:00:00 82.59 176.52 117.33 113.20 169.92 194.72 85.20 105.61 119.43 82.62 ... 109.39 67.84 176.34 104.67 67.78 96.76 146.40 107.55 152.02 187.55
2016-10-13 10:00:00 65.09 105.11 137.43 82.42 182.90 159.94 61.71 119.30 121.10 117.33 ... 178.25 110.95 149.97 93.07 53.17 144.99 107.04 104.34 134.46 137.87
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2016-10-15 10:00:00 141.55 479.41 193.03 82.13 130.52 195.73 142.34 225.43 215.81 80.56 ... 102.47 99.52 183.99 243.18 51.78 110.14 126.93 125.04 193.78 178.96
2016-10-15 12:00:00 55.49 108.68 148.88 90.00 175.20 91.15 75.10 102.03 194.71 111.61 ... 131.88 123.81 311.30 211.62 76.85 107.19 322.43 94.48 345.66 210.76
2016-10-15 14:00:00 70.85 101.44 369.30 147.15 480.54 131.23 68.73 129.67 132.41 112.88 ... 99.66 72.51 226.76 200.01 64.57 105.97 166.30 131.37 220.01 195.49
2016-10-15 16:00:00 62.82 186.11 131.17 120.68 183.74 173.84 55.51 136.59 187.96 156.38 ... 118.43 143.56 288.68 201.31 56.20 131.52 208.65 116.47 156.18 176.67
2016-10-15 18:00:00 69.84 140.16 117.03 92.53 208.13 95.01 61.47 107.73 113.36 39.24 ... 62.14 104.38 174.08 79.10 54.73 116.60 121.98 76.71 83.93 187.67
2016-10-15 20:00:00 49.56 113.54 131.56 81.32 90.82 557.39 71.34 85.96 92.39 73.55 ... 61.55 75.68 160.54 127.78 61.11 85.04 152.00 81.70 181.06 57.90
2016-10-15 22:00:00 56.07 98.05 150.00 81.24 208.41 51.67 32.25 82.48 134.46 100.07 ... 164.11 137.85 28.59 127.32 59.24 91.96 88.84 94.80 142.51 21.77
2016-10-16 00:00:00 59.43 60.06 18.62 71.69 38.50 176.72 45.70 300.65 93.32 45.35 ... 20.83 53.37 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-16 02:00:00 91.74 35.27 15.58 12.09 8.36 17.12 36.26 35.20 10.38 25.51 ... 11.06 206.38 13.87 11.76 54.07 126.42 12.01 29.13 12.14 7.78
2016-10-16 04:00:00 45.65 28.72 9.91 23.75 15.55 9.84 42.17 40.29 30.23 35.97 ... 22.54 86.44 114.24 26.15 44.47 94.31 36.27 48.22 285.05 33.00
2016-10-16 06:00:00 44.35 107.90 56.34 62.56 74.69 42.83 43.37 97.01 64.27 90.34 ... 112.56 94.86 137.52 72.12 49.07 101.45 116.25 105.92 186.40 189.78
2016-10-16 08:00:00 65.10 114.11 112.75 93.91 166.49 64.31 78.61 135.07 102.82 98.29 ... 121.36 80.88 177.79 141.18 66.83 227.94 97.21 94.94 165.23 181.15
2016-10-16 10:00:00 72.15 171.94 103.33 54.65 210.89 124.70 70.30 132.77 124.10 79.78 ... 149.32 59.31 144.38 103.01 55.31 95.59 80.95 126.53 440.99 227.12
2016-10-16 12:00:00 64.06 93.59 134.29 100.55 266.24 152.97 54.81 95.45 143.35 102.87 ... 112.56 99.43 195.02 230.93 79.16 183.45 132.12 111.54 201.60 201.56
2016-10-16 14:00:00 52.68 175.09 149.55 103.92 253.72 190.71 60.43 118.46 91.03 128.19 ... 128.09 135.54 234.90 209.33 66.86 85.67 120.06 106.91 210.66 286.61
2016-10-16 16:00:00 72.75 168.21 133.51 103.95 264.98 235.16 71.52 164.68 172.85 97.74 ... 153.68 117.52 226.31 215.28 93.63 93.54 183.33 110.75 180.95 224.67
2016-10-16 18:00:00 63.15 135.56 117.24 110.04 241.96 141.09 70.38 128.98 69.72 104.61 ... 160.60 68.83 269.18 156.06 68.37 94.52 52.30 104.63 202.09 190.96
2016-10-16 20:00:00 64.10 123.63 120.15 87.52 164.39 153.81 54.89 104.32 112.66 90.29 ... 106.95 81.92 224.93 65.92 357.05 105.93 110.85 78.72 74.71 57.90
2016-10-16 22:00:00 64.01 103.64 35.65 106.78 183.47 51.67 58.27 105.03 37.17 62.19 ... 80.86 61.42 28.59 34.71 52.26 84.51 23.50 90.29 35.92 21.77
2016-10-17 00:00:00 59.61 89.41 95.71 70.85 38.50 27.91 40.03 77.48 16.13 125.27 ... 106.77 88.43 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-17 02:00:00 37.09 35.27 15.58 28.74 8.36 17.12 51.25 35.20 10.38 25.51 ... 11.06 93.78 13.87 11.76 47.24 46.12 12.01 29.13 12.14 7.78
2016-10-17 04:00:00 56.49 91.66 9.91 73.25 15.55 9.84 69.42 126.47 30.23 35.97 ... 22.54 48.19 30.07 26.15 45.24 72.77 135.14 113.93 67.51 33.00
2016-10-17 06:00:00 43.74 68.25 56.34 83.62 196.30 42.83 48.09 140.63 75.72 43.62 ... 73.54 69.52 224.46 72.12 72.16 171.10 136.97 110.83 168.88 60.60
2016-10-17 08:00:00 133.58 306.58 108.63 147.11 165.10 64.31 108.33 296.26 115.41 118.52 ... 108.23 149.29 151.34 104.67 53.21 128.11 122.42 120.32 265.43 218.18
2016-10-17 10:00:00 64.87 118.49 161.91 129.52 142.21 220.20 76.01 132.14 88.98 50.23 ... 102.55 102.44 153.59 93.07 44.09 98.61 100.05 109.67 172.90 88.35
2016-10-17 12:00:00 65.24 99.45 131.03 94.10 167.98 104.38 45.44 104.89 104.69 77.63 ... 111.03 84.63 218.76 169.18 64.32 93.51 134.56 81.00 165.84 149.21
2016-10-17 14:00:00 52.28 84.48 99.41 98.19 191.14 131.23 70.19 100.53 147.23 104.86 ... 138.69 82.67 134.58 124.07 71.70 131.03 76.92 126.84 483.07 125.78
2016-10-17 16:00:00 53.86 109.92 134.99 115.47 180.28 171.02 69.77 111.73 136.45 100.27 ... 130.78 118.25 170.14 122.02 53.69 125.55 177.36 102.55 132.85 107.45
2016-10-17 18:00:00 65.40 158.01 77.42 102.74 267.11 173.74 48.66 115.05 98.47 83.02 ... 62.14 91.64 83.93 79.10 65.93 86.11 99.04 96.84 188.23 187.43
2016-10-17 20:00:00 52.66 101.30 62.67 99.77 90.82 209.32 72.69 137.58 172.53 84.75 ... 61.55 61.96 121.61 159.44 39.55 100.03 46.81 73.88 74.71 57.90

83 rows × 36 columns


In [12]:
x_test


Out[12]:
hour minute weekday
2016-10-11 00:00:00 0 0 1
2016-10-11 02:00:00 2 0 1
2016-10-11 04:00:00 4 0 1
2016-10-11 06:00:00 6 0 1
2016-10-11 08:00:00 8 0 1
2016-10-11 10:00:00 10 0 1
2016-10-11 12:00:00 12 0 1
2016-10-11 14:00:00 14 0 1
2016-10-11 16:00:00 16 0 1
2016-10-11 18:00:00 18 0 1
2016-10-11 20:00:00 20 0 1
2016-10-11 22:00:00 22 0 1
2016-10-12 00:00:00 0 0 2
2016-10-12 02:00:00 2 0 2
2016-10-12 04:00:00 4 0 2
2016-10-12 06:00:00 6 0 2
2016-10-12 08:00:00 8 0 2
2016-10-12 10:00:00 10 0 2
2016-10-12 12:00:00 12 0 2
2016-10-12 14:00:00 14 0 2
2016-10-12 16:00:00 16 0 2
2016-10-12 18:00:00 18 0 2
2016-10-12 20:00:00 20 0 2
2016-10-12 22:00:00 22 0 2
2016-10-13 00:00:00 0 0 3
2016-10-13 02:00:00 2 0 3
2016-10-13 04:00:00 4 0 3
2016-10-13 06:00:00 6 0 3
2016-10-13 08:00:00 8 0 3
2016-10-13 10:00:00 10 0 3
... ... ... ...
2016-10-15 10:00:00 10 0 5
2016-10-15 12:00:00 12 0 5
2016-10-15 14:00:00 14 0 5
2016-10-15 16:00:00 16 0 5
2016-10-15 18:00:00 18 0 5
2016-10-15 20:00:00 20 0 5
2016-10-15 22:00:00 22 0 5
2016-10-16 00:00:00 0 0 6
2016-10-16 02:00:00 2 0 6
2016-10-16 04:00:00 4 0 6
2016-10-16 06:00:00 6 0 6
2016-10-16 08:00:00 8 0 6
2016-10-16 10:00:00 10 0 6
2016-10-16 12:00:00 12 0 6
2016-10-16 14:00:00 14 0 6
2016-10-16 16:00:00 16 0 6
2016-10-16 18:00:00 18 0 6
2016-10-16 20:00:00 20 0 6
2016-10-16 22:00:00 22 0 6
2016-10-17 00:00:00 0 0 0
2016-10-17 02:00:00 2 0 0
2016-10-17 04:00:00 4 0 0
2016-10-17 06:00:00 6 0 0
2016-10-17 08:00:00 8 0 0
2016-10-17 10:00:00 10 0 0
2016-10-17 12:00:00 12 0 0
2016-10-17 14:00:00 14 0 0
2016-10-17 16:00:00 16 0 0
2016-10-17 18:00:00 18 0 0
2016-10-17 20:00:00 20 0 0

83 rows × 3 columns

train model


In [16]:
from sklearn.externals import joblib
from sklearn import svm
from sklearn.multioutput import MultiOutputRegressor

clf = svm.SVR(C=30, epsilon=0.005, cache_size=2000)

regr_multi_svr = MultiOutputRegressor(clf, n_jobs=-1)

regr_multi_svr.fit(x_train, y_train)

# load
regr_multi_svr = joblib.load('regr_multi_svr_timeInformation.pkl')

save models


In [ ]:
from sklearn.externals import joblib

#joblib.dump(regr_multi_svr, 'regr_multi_svr_timeInformation.pkl')

evaluate


In [17]:
y_test_predict = regr_multi_svr.predict(x_test)

y_test_predict_df = pd.DataFrame(y_test_predict, columns=y_cols)
y_test_predict_df.head()


Out[17]:
(0, A2) (0, A3) (0, B1) (0, B3) (0, C1) (0, C3) (1, A2) (1, A3) (1, B1) (1, B3) ... (4, B1) (4, B3) (4, C1) (4, C3) (5, A2) (5, A3) (5, B1) (5, B3) (5, C1) (5, C3)
0 46.025391 60.064694 18.624742 50.165473 38.504617 27.914778 41.904651 82.014838 16.135032 52.339146 ... 20.834479 39.415504 21.364780 16.204721 27.074640 57.165415 9.924544 22.184935 18.974734 8.164814
1 37.101425 35.275227 15.584786 28.744548 8.354545 17.125012 42.644986 35.204763 10.374562 25.514648 ... 11.054890 31.364840 13.864653 11.754970 47.235217 52.984261 12.014673 29.134891 12.134626 7.774778
2 48.704799 45.884741 9.915024 23.754957 15.554647 9.834902 51.954573 40.295065 30.234905 35.974643 ... 22.544770 55.532948 30.064732 26.144735 52.045095 85.816422 36.274551 71.509276 68.082869 33.005233
3 48.215322 94.074957 68.922185 77.114709 74.694871 42.834633 56.207525 104.935183 64.274967 86.365208 ... 92.301355 86.172414 92.154937 72.124704 62.645088 129.905189 69.425345 113.054598 145.755387 60.594503
4 81.604858 136.554499 97.055292 109.397514 151.384817 87.912526 76.735156 133.515126 81.164844 107.894640 ... 104.305255 127.415765 162.299043 120.937280 70.104845 132.455018 95.014935 115.304689 134.879393 108.184905

5 rows × 36 columns


In [18]:
regr_multi_svr.score(x_test, y_test)


Out[18]:
0.24468351252499834

In [16]:
from sklearn import metrics

print(metrics.mean_absolute_error(y_test_predict, y_test))
print(metrics.mean_squared_error(y_test_predict, y_test))

import src.misc.evaluation as ev
mymape = ev.mape(y_test_predict, y_test)
print(np.mean(np.array(mymape)))


28.10626237
2815.47733885
0.209518459546

In [21]:
y_test_predict_df


Out[21]:
(0, A2) (0, A3) (0, B1) (0, B3) (0, C1) (0, C3) (1, A2) (1, A3) (1, B1) (1, B3) ... (4, B1) (4, B3) (4, C1) (4, C3) (5, A2) (5, A3) (5, B1) (5, B3) (5, C1) (5, C3)
0 46.025391 60.064694 18.624742 50.165473 38.504617 27.914778 41.904651 82.014838 16.135032 52.339146 ... 20.834479 39.415504 21.364780 16.204721 27.074640 57.165415 9.924544 22.184935 18.974734 8.164814
1 37.101425 35.275227 15.584786 28.744548 8.354545 17.125012 42.644986 35.204763 10.374562 25.514648 ... 11.054890 31.364840 13.864653 11.754970 47.235217 52.984261 12.014673 29.134891 12.134626 7.774778
2 48.704799 45.884741 9.915024 23.754957 15.554647 9.834902 51.954573 40.295065 30.234905 35.974643 ... 22.544770 55.532948 30.064732 26.144735 52.045095 85.816422 36.274551 71.509276 68.082869 33.005233
3 48.215322 94.074957 68.922185 77.114709 74.694871 42.834633 56.207525 104.935183 64.274967 86.365208 ... 92.301355 86.172414 92.154937 72.124704 62.645088 129.905189 69.425345 113.054598 145.755387 60.594503
4 81.604858 136.554499 97.055292 109.397514 151.384817 87.912526 76.735156 133.515126 81.164844 107.894640 ... 104.305255 127.415765 162.299043 120.937280 70.104845 132.455018 95.014935 115.304689 134.879393 108.184905
5 68.993439 122.081918 109.327471 114.807154 142.535469 105.851533 62.504984 113.284961 91.985390 120.555214 ... 84.164574 95.344585 151.727357 102.335383 55.064656 102.595495 86.684865 98.605718 148.320280 88.354910
6 55.655196 101.992542 91.995231 110.554613 162.010270 114.055235 51.095199 97.935420 100.332704 107.985303 ... 91.935764 108.854934 160.261135 165.984759 64.735347 107.054865 88.492043 112.934960 139.445309 140.795178
7 63.334766 109.774921 105.575227 114.413915 148.930540 158.215337 62.964668 111.864695 110.484878 119.564614 ... 118.184549 111.812451 148.833140 169.315326 67.065795 106.848756 79.985546 103.305180 142.607235 125.784836
8 70.746158 107.182945 78.765416 104.145482 144.064874 151.613248 64.884916 107.275413 97.816438 117.144607 ... 91.606676 107.874585 133.402992 115.541559 64.983969 112.414810 97.864816 109.295274 141.045427 137.850112
9 77.004578 112.625191 79.000318 103.114660 117.725286 122.439355 64.734764 115.915125 69.724952 106.597333 ... 62.145180 87.025073 83.934783 79.104497 64.455441 125.554888 53.770227 98.988292 83.934881 90.565054
10 63.614880 102.015266 70.775148 94.535185 112.312762 72.644880 61.804983 108.464743 59.015292 84.805397 ... 61.555227 96.465117 114.645229 65.924986 57.207917 108.165024 61.912438 93.425915 74.715357 57.904818
11 51.225106 86.324892 35.654856 84.704855 83.335388 51.674728 53.800341 83.134981 37.174551 62.195326 ... 32.594541 61.424897 28.594864 34.714613 46.085206 73.290642 23.504744 39.475235 35.925177 21.764510
12 49.584614 81.055274 18.625159 50.164889 38.505351 27.915378 36.992307 76.908283 16.135421 45.355154 ... 20.835234 39.414876 21.365125 16.205312 31.575289 63.233290 9.925451 22.185260 18.985227 8.175474
13 41.355195 35.274918 15.585320 30.787789 8.364990 17.125379 48.796134 48.444677 10.385421 25.515463 ... 11.065291 31.365518 13.875188 11.765294 55.892589 71.914699 12.015331 29.135331 12.145089 7.785468
14 52.970179 65.325386 9.915331 23.755225 15.555098 9.845418 53.045438 40.294837 30.234734 35.975274 ... 22.545403 63.291368 30.075238 26.155439 47.386777 72.394721 36.275322 48.226566 67.514960 33.004484
15 49.534719 97.474518 56.344684 83.668421 74.695357 42.835475 54.835595 114.574240 67.073634 93.754599 ... 85.763817 83.344656 98.556053 74.016930 71.944663 128.134602 74.375057 100.784990 144.464940 60.605062
16 72.617758 136.554904 99.484938 104.165037 136.856553 82.542852 75.794773 138.807675 81.165346 111.235267 ... 95.515022 130.034694 157.695375 104.675011 67.996004 125.045355 106.544937 111.124933 159.994874 127.849263
17 67.385324 111.104999 105.994964 103.825230 148.514437 100.985162 64.795157 112.645226 91.985003 116.374720 ... 81.455069 96.205046 145.205162 106.703818 55.324827 107.664921 92.026552 103.144797 156.812001 101.093687
18 56.974593 104.195002 83.065400 101.635101 158.114999 139.499196 54.754767 104.934540 98.404628 102.264822 ... 89.114869 115.307646 158.185322 158.537415 62.554916 121.760928 88.008576 110.595377 156.076103 157.136539
19 66.645235 111.710031 112.104555 111.134979 147.605403 162.494731 58.935355 112.985259 101.205469 117.825140 ... 106.824804 111.185402 149.834797 171.899244 64.875107 111.114957 71.685023 98.188766 152.785094 141.845178
20 67.115119 109.497847 104.037521 107.244999 145.479019 167.178236 68.425839 110.775073 89.454764 115.155395 ... 90.694507 110.340233 128.333047 117.268930 69.940688 111.871112 92.587263 105.772118 132.854572 139.875426
21 70.994125 110.884505 77.425046 109.185142 117.724687 100.269691 57.675597 116.931996 69.725416 109.154861 ... 62.144880 92.822543 84.971006 80.391325 64.327087 123.445196 52.305063 96.254937 83.935265 90.564640
22 59.284715 106.864612 62.675521 100.318451 106.440094 72.645380 60.814167 113.435140 59.014985 101.665005 ... 69.719909 97.695542 114.644638 65.924708 54.564609 108.165326 50.814643 79.320990 75.589786 57.905292
23 55.444763 81.725219 35.655237 87.725062 83.334776 51.675442 54.729272 84.614628 37.175226 62.194761 ... 32.595235 63.761270 28.595428 34.715442 44.862038 71.805369 23.505204 39.474772 37.215361 21.775418
24 46.648841 77.504886 18.624723 60.421678 38.504791 27.904955 36.435454 71.080652 16.134768 48.607499 ... 20.834766 39.415434 21.354775 16.194886 29.064741 45.094698 9.924829 22.174634 18.974665 8.164526
25 45.185066 35.275218 15.584673 28.745364 8.354652 17.114634 43.726452 36.717018 10.384953 25.514681 ... 11.064970 31.364879 13.864677 11.764672 56.324845 61.594460 12.014611 29.134650 12.134787 7.774679
26 51.535358 77.283107 9.914728 23.754860 15.544654 9.834649 49.865008 40.295340 35.220229 35.974798 ... 22.544853 69.541150 30.074919 26.144973 48.445314 76.284725 36.274887 48.224661 67.515389 33.005273
27 47.635354 97.135466 56.344610 75.800649 74.694603 42.834913 52.034843 105.464922 82.011465 92.035385 ... 83.905368 96.374734 93.050446 72.125168 74.362352 134.464741 87.334568 105.936959 159.908733 60.604499
28 68.534961 136.721263 114.695801 102.223900 128.055340 64.315173 78.575355 145.434186 104.574878 111.234575 ... 89.266186 127.779991 155.772324 104.675362 71.414890 113.884766 118.056829 110.234645 165.050611 126.385215
29 67.474508 102.135249 109.805268 103.824862 163.284855 100.985072 69.408111 111.284925 118.215337 112.665346 ... 88.404827 99.744804 152.662904 93.075009 55.264846 105.487531 89.665462 105.485378 151.585032 104.835962
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
53 73.032505 107.665043 106.594851 109.725506 163.211901 138.255109 70.935393 117.975378 105.189091 108.944627 ... 94.387241 96.204805 159.385023 133.506646 64.135029 105.094771 106.025399 100.545129 155.953277 98.882930
54 59.554562 103.126635 98.935309 90.104433 153.294743 91.154642 57.485018 102.585003 105.617535 106.215013 ... 112.804675 112.491368 182.785362 159.366191 61.825069 98.075002 103.487501 111.625261 170.784937 162.846374
55 66.269198 109.145429 128.349289 122.074684 165.626622 160.716551 64.224927 113.055182 133.404558 108.015223 ... 97.235388 118.755701 174.003541 127.149821 65.054777 105.644720 109.484727 117.233157 171.125017 158.728937
56 70.393641 108.926722 89.341654 124.289497 141.907311 173.135367 62.285127 125.343577 108.324710 109.584919 ... 66.654609 107.684448 139.195682 128.754968 65.445053 120.155532 93.324642 106.681421 160.084888 131.485298
57 60.645342 105.424755 110.571680 110.384710 168.805121 114.380712 64.174947 115.924718 79.236132 105.535167 ... 62.144764 109.474846 84.827335 79.105254 67.064900 106.514962 52.304836 105.145425 83.934722 112.588119
58 55.556121 107.445303 62.675359 106.865088 90.825303 90.789404 57.085045 104.835265 85.994812 94.064162 ... 84.335401 93.384779 114.645204 84.545570 52.045324 108.175015 46.815227 93.614818 74.714681 57.904886
59 54.785383 89.635143 35.654809 84.361907 92.652082 51.674908 50.555442 82.624705 37.175133 83.794792 ... 32.594844 81.134668 28.584719 34.714553 42.987497 62.065241 23.494662 39.474690 35.924746 21.774950
60 50.614687 75.485041 18.624704 55.677646 38.505330 27.914880 44.323843 73.404906 16.134993 45.354795 ... 20.835390 39.415009 21.365299 16.205237 41.034936 57.767224 9.925383 22.184696 18.985465 8.175352
61 37.534726 35.275203 15.585126 28.745363 8.364690 17.125338 38.660836 35.204597 10.384849 25.515236 ... 11.065226 31.364997 13.875243 11.764490 47.245257 59.839814 12.015332 29.134665 12.145083 7.785375
62 51.524920 45.884862 9.915299 23.754955 15.554841 9.844960 49.874950 52.977101 30.234884 37.296780 ... 22.544629 48.195340 30.075086 26.154707 50.834684 93.074961 36.274569 48.224762 67.514862 33.004837
63 39.044760 86.804848 56.345426 79.914840 120.289586 42.834681 54.504722 107.265339 64.275477 83.665016 ... 90.614957 86.075032 159.725197 72.125059 63.058138 102.962373 72.725212 105.925104 133.554964 105.398942
64 64.335179 111.924812 105.005254 104.175058 155.644863 104.664897 62.268121 110.625146 110.814981 103.514453 ... 116.855125 113.514661 162.274896 143.387552 71.035229 124.824870 87.745051 99.595293 166.085152 150.864836
65 66.644772 111.347177 89.804972 103.824748 141.945024 150.309832 69.154986 115.144917 100.864789 107.045245 ... 74.904652 96.204799 155.635380 136.907155 60.175168 101.395019 93.394985 99.744928 149.965057 88.355201
66 50.855001 114.695272 96.954677 95.715021 148.265072 111.044639 62.802585 105.701067 98.404919 97.610986 ... 110.614652 106.214843 172.784934 145.835351 59.344863 107.044753 85.155044 110.835747 163.144807 182.144705
67 65.395145 110.175155 111.296905 122.214670 149.774760 160.814933 60.695597 102.814950 101.205284 107.595471 ... 90.475042 103.254891 157.983222 137.874525 60.414776 106.014720 96.839506 102.655030 158.304921 147.667969
68 66.485014 110.715048 78.764526 107.244528 129.255446 152.836551 64.514997 112.644913 97.091447 106.495049 ... 66.655450 100.495393 128.545170 125.517941 61.274922 117.145022 82.135065 107.975148 174.415294 123.934849
69 59.974717 110.605082 106.224954 102.735052 150.645246 95.014845 62.195225 111.855992 89.034654 119.644985 ... 62.145292 88.254581 83.934847 79.104948 66.215371 102.145371 52.304683 96.834839 83.934611 96.445045
70 54.894737 102.005396 62.675122 94.534771 97.684344 114.113797 55.449772 112.214650 70.691577 94.664702 ... 67.760254 86.434777 114.644783 65.924976 54.064772 108.164702 65.659562 79.155029 74.714939 57.905063
71 53.745157 86.294591 35.655010 68.855382 118.882101 51.675237 53.804992 83.635983 37.174622 73.365314 ... 32.595212 89.672200 28.594671 34.715083 41.334913 72.714854 23.504659 51.564165 35.925155 21.775120
72 46.015113 60.065164 18.625188 76.124626 38.505032 27.914674 47.840922 86.145141 16.135024 45.354981 ... 20.835015 39.414921 21.365231 16.204966 27.075138 45.094928 9.924949 22.185209 18.984933 8.175031
73 37.095429 54.117722 15.584808 28.745154 8.365033 17.125034 40.319679 35.204708 10.384559 25.514644 ... 11.065210 31.364924 13.874806 11.765251 47.504932 46.124933 12.015407 29.135299 12.144986 7.785287
74 51.525115 56.730948 9.915137 34.541980 15.554885 9.845044 50.990002 56.830737 41.318366 35.974936 ... 22.545307 67.144830 30.075085 26.155105 63.205232 115.214623 36.274990 67.794843 87.233600 33.004865
75 44.394920 94.284847 82.344714 62.565303 74.695437 42.834630 55.594971 102.494648 64.274584 83.664868 ... 95.494670 103.894997 92.154808 76.436185 69.624817 144.174416 86.025044 117.455064 145.799208 60.605094
76 92.823365 146.384773 97.064847 109.754664 157.488364 64.314579 84.154736 125.954923 89.375127 106.855252 ... 104.945847 132.592230 149.254877 154.094643 74.712049 130.355339 106.845268 118.984924 132.774966 108.184630
77 76.724647 138.489339 109.235110 121.304800 145.644770 100.984980 68.764906 115.725405 121.705096 118.164630 ... 99.831104 110.955385 142.964856 93.074945 59.387698 103.475045 80.955218 103.724942 128.405173 137.045391
78 60.214728 103.295394 90.506080 96.244852 155.714878 96.015422 61.004914 109.635000 106.064677 112.164699 ... 89.115208 106.644820 153.954620 123.634960 61.705111 107.044927 91.495201 109.545266 139.444645 140.794600
79 55.134878 101.255281 109.356330 100.915506 147.604864 137.164627 66.474923 115.555159 101.205155 95.725061 ... 100.059361 107.584778 145.364910 171.154907 64.755409 106.171717 76.218193 110.664661 137.865085 125.785347
80 65.474796 102.924898 89.674694 106.855186 154.495339 146.464684 60.814823 105.444977 80.495167 103.225000 ... 66.654759 100.495331 128.894661 103.154815 62.214965 118.194789 82.134654 106.505071 135.485175 107.454883
81 61.955219 110.884853 77.424737 107.495292 117.724926 143.267696 68.984999 109.865925 69.725257 107.094692 ... 78.105965 86.275298 83.934611 79.105254 63.534928 118.534889 52.304910 104.665270 83.935387 90.564895
82 62.315414 106.174799 62.675070 94.534711 90.825337 72.645120 57.474683 106.685298 59.014808 84.754844 ... 61.554743 90.110303 115.895968 65.924942 53.055015 108.165369 46.814974 81.245272 74.714989 57.905387

83 rows × 36 columns


In [40]:
y_test


Out[40]:
(0, A2) (0, A3) (0, B1) (0, B3) (0, C1) (0, C3) (1, A2) (1, A3) (1, B1) (1, B3) ... (4, B1) (4, B3) (4, C1) (4, C3) (5, A2) (5, A3) (5, B1) (5, B3) (5, C1) (5, C3)
2016-10-11 00:00:00 52.28 60.06 18.62 50.16 38.50 27.91 37.07 107.80 16.13 103.27 ... 20.83 39.41 21.36 16.20 27.07 45.09 69.89 94.61 18.98 8.17
2016-10-11 02:00:00 37.09 35.27 15.58 28.74 8.36 17.12 52.36 35.20 10.38 75.56 ... 11.06 31.36 13.87 11.76 53.40 46.12 99.88 29.13 12.14 7.78
2016-10-11 04:00:00 38.38 45.88 9.91 23.75 15.55 9.84 53.69 40.29 30.23 35.97 ... 22.54 48.19 164.07 156.45 41.32 77.45 90.51 48.22 206.02 33.00
2016-10-11 06:00:00 44.41 97.47 125.78 62.56 74.69 42.83 32.56 127.90 96.05 71.58 ... 127.86 143.01 158.56 72.12 50.97 137.73 134.92 110.76 173.09 190.27
2016-10-11 08:00:00 68.09 146.16 86.56 142.52 158.31 64.31 75.02 168.43 127.10 93.00 ... 120.29 104.09 129.01 202.18 70.26 121.44 93.94 133.37 166.25 117.08
2016-10-11 10:00:00 58.42 134.14 128.12 133.50 241.20 100.98 59.50 122.61 96.85 231.31 ... 97.47 93.11 202.58 93.07 72.78 96.14 102.81 102.93 145.38 132.98
2016-10-11 12:00:00 62.17 168.92 140.94 81.62 159.03 206.08 67.42 105.85 134.51 129.76 ... 101.64 106.02 188.35 123.63 61.31 122.76 106.54 103.98 198.28 132.72
2016-10-11 14:00:00 63.76 84.14 131.75 160.78 198.61 159.13 70.16 104.73 106.43 110.78 ... 120.09 113.49 177.20 124.07 80.86 112.35 107.40 124.56 186.99 151.44
2016-10-11 16:00:00 66.96 102.97 85.30 97.92 151.63 143.58 85.57 100.22 93.09 130.13 ... 111.53 103.08 193.29 183.23 67.00 146.57 254.55 76.11 230.08 218.23
2016-10-11 18:00:00 48.92 112.86 204.27 113.66 250.10 95.01 121.45 280.83 126.37 64.97 ... 128.57 129.44 160.61 79.10 77.23 115.81 128.59 102.91 170.00 207.18
2016-10-11 20:00:00 88.02 98.23 108.57 95.91 153.19 72.64 53.83 104.47 93.71 84.75 ... 61.55 268.29 161.02 122.44 74.66 91.72 350.79 120.55 201.53 218.45
2016-10-11 22:00:00 54.76 95.40 148.41 86.69 162.99 51.67 48.85 97.33 37.17 86.00 ... 32.59 136.46 137.63 34.71 50.05 62.06 23.50 39.47 35.92 111.98
2016-10-12 00:00:00 53.89 55.96 18.62 83.32 38.50 27.91 69.38 64.30 16.13 45.35 ... 20.83 39.41 21.36 16.20 27.07 67.30 9.92 22.18 18.98 8.17
2016-10-12 02:00:00 35.75 35.27 15.58 28.74 8.36 17.12 57.34 89.27 10.38 105.41 ... 11.06 83.37 13.87 11.76 60.73 46.12 12.01 29.13 12.14 7.78
2016-10-12 04:00:00 41.58 82.20 9.91 23.75 15.55 9.84 42.86 40.29 30.23 35.97 ... 97.33 87.31 188.20 26.15 58.03 99.03 36.27 48.22 67.51 33.00
2016-10-12 06:00:00 49.68 93.64 100.25 84.28 74.69 42.83 45.53 135.08 64.27 98.94 ... 73.54 73.71 92.15 110.15 63.15 138.92 69.42 153.30 143.44 60.60
2016-10-12 08:00:00 86.16 171.63 117.33 84.05 146.38 175.34 83.28 189.11 184.11 156.47 ... 132.43 168.48 116.31 104.67 65.32 143.11 87.74 156.67 194.99 215.89
2016-10-12 10:00:00 94.91 131.99 107.56 104.83 121.63 209.00 58.60 99.85 106.44 117.59 ... 64.19 76.81 242.19 140.85 57.23 111.28 104.02 110.46 176.85 88.35
2016-10-12 12:00:00 55.71 81.89 120.83 92.75 180.54 174.42 61.98 100.87 82.99 26.74 ... 132.50 103.32 142.53 176.53 64.27 112.77 85.15 103.29 139.48 160.53
2016-10-12 14:00:00 71.25 105.32 113.41 92.04 172.53 115.48 62.77 109.13 142.55 87.21 ... 96.16 81.32 221.58 218.83 50.12 99.73 143.76 95.90 151.01 141.39
2016-10-12 16:00:00 60.51 97.40 126.86 86.15 153.51 170.92 57.58 83.99 111.50 111.87 ... 66.65 93.10 172.73 148.58 78.55 114.99 110.97 103.29 171.72 196.05
2016-10-12 18:00:00 81.69 113.32 127.47 160.28 186.11 146.06 52.32 112.96 132.60 87.50 ... 62.14 102.74 169.59 203.03 67.94 101.71 52.30 51.49 196.28 90.56
2016-10-12 20:00:00 76.01 100.00 89.78 82.10 183.10 72.64 57.85 110.36 130.23 113.44 ... 96.42 97.17 162.05 65.92 66.46 89.55 46.81 98.05 74.71 57.90
2016-10-12 22:00:00 58.35 112.08 35.65 68.51 156.96 51.67 35.44 46.24 96.12 71.62 ... 99.06 80.30 112.53 34.71 42.57 56.12 23.50 121.04 35.92 21.77
2016-10-13 00:00:00 74.92 60.06 18.62 50.16 38.50 27.91 46.58 91.02 16.13 45.35 ... 20.83 39.41 21.36 16.20 50.53 45.09 94.23 22.18 18.98 97.82
2016-10-13 02:00:00 129.60 93.48 15.58 28.74 145.63 17.12 52.09 95.52 10.38 25.51 ... 68.08 31.36 13.87 11.76 73.72 46.12 12.01 29.13 12.14 7.78
2016-10-13 04:00:00 54.43 73.95 9.91 23.75 142.71 9.84 57.76 106.28 100.69 35.97 ... 22.54 107.66 30.07 26.15 37.66 87.00 36.27 95.92 67.51 33.00
2016-10-13 06:00:00 54.31 121.44 119.71 62.56 127.55 42.83 77.89 92.64 138.09 83.66 ... 140.66 16.85 92.15 119.28 87.81 114.64 102.54 106.15 214.35 212.35
2016-10-13 08:00:00 82.59 176.52 117.33 113.20 169.92 194.72 85.20 105.61 119.43 82.62 ... 109.39 67.84 176.34 104.67 67.78 96.76 146.40 107.55 152.02 187.55
2016-10-13 10:00:00 65.09 105.11 137.43 82.42 182.90 159.94 61.71 119.30 121.10 117.33 ... 178.25 110.95 149.97 93.07 53.17 144.99 107.04 104.34 134.46 137.87
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2016-10-15 10:00:00 141.55 479.41 193.03 82.13 130.52 195.73 142.34 225.43 215.81 80.56 ... 102.47 99.52 183.99 243.18 51.78 110.14 126.93 125.04 193.78 178.96
2016-10-15 12:00:00 55.49 108.68 148.88 90.00 175.20 91.15 75.10 102.03 194.71 111.61 ... 131.88 123.81 311.30 211.62 76.85 107.19 322.43 94.48 345.66 210.76
2016-10-15 14:00:00 70.85 101.44 369.30 147.15 480.54 131.23 68.73 129.67 132.41 112.88 ... 99.66 72.51 226.76 200.01 64.57 105.97 166.30 131.37 220.01 195.49
2016-10-15 16:00:00 62.82 186.11 131.17 120.68 183.74 173.84 55.51 136.59 187.96 156.38 ... 118.43 143.56 288.68 201.31 56.20 131.52 208.65 116.47 156.18 176.67
2016-10-15 18:00:00 69.84 140.16 117.03 92.53 208.13 95.01 61.47 107.73 113.36 39.24 ... 62.14 104.38 174.08 79.10 54.73 116.60 121.98 76.71 83.93 187.67
2016-10-15 20:00:00 49.56 113.54 131.56 81.32 90.82 557.39 71.34 85.96 92.39 73.55 ... 61.55 75.68 160.54 127.78 61.11 85.04 152.00 81.70 181.06 57.90
2016-10-15 22:00:00 56.07 98.05 150.00 81.24 208.41 51.67 32.25 82.48 134.46 100.07 ... 164.11 137.85 28.59 127.32 59.24 91.96 88.84 94.80 142.51 21.77
2016-10-16 00:00:00 59.43 60.06 18.62 71.69 38.50 176.72 45.70 300.65 93.32 45.35 ... 20.83 53.37 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-16 02:00:00 91.74 35.27 15.58 12.09 8.36 17.12 36.26 35.20 10.38 25.51 ... 11.06 206.38 13.87 11.76 54.07 126.42 12.01 29.13 12.14 7.78
2016-10-16 04:00:00 45.65 28.72 9.91 23.75 15.55 9.84 42.17 40.29 30.23 35.97 ... 22.54 86.44 114.24 26.15 44.47 94.31 36.27 48.22 285.05 33.00
2016-10-16 06:00:00 44.35 107.90 56.34 62.56 74.69 42.83 43.37 97.01 64.27 90.34 ... 112.56 94.86 137.52 72.12 49.07 101.45 116.25 105.92 186.40 189.78
2016-10-16 08:00:00 65.10 114.11 112.75 93.91 166.49 64.31 78.61 135.07 102.82 98.29 ... 121.36 80.88 177.79 141.18 66.83 227.94 97.21 94.94 165.23 181.15
2016-10-16 10:00:00 72.15 171.94 103.33 54.65 210.89 124.70 70.30 132.77 124.10 79.78 ... 149.32 59.31 144.38 103.01 55.31 95.59 80.95 126.53 440.99 227.12
2016-10-16 12:00:00 64.06 93.59 134.29 100.55 266.24 152.97 54.81 95.45 143.35 102.87 ... 112.56 99.43 195.02 230.93 79.16 183.45 132.12 111.54 201.60 201.56
2016-10-16 14:00:00 52.68 175.09 149.55 103.92 253.72 190.71 60.43 118.46 91.03 128.19 ... 128.09 135.54 234.90 209.33 66.86 85.67 120.06 106.91 210.66 286.61
2016-10-16 16:00:00 72.75 168.21 133.51 103.95 264.98 235.16 71.52 164.68 172.85 97.74 ... 153.68 117.52 226.31 215.28 93.63 93.54 183.33 110.75 180.95 224.67
2016-10-16 18:00:00 63.15 135.56 117.24 110.04 241.96 141.09 70.38 128.98 69.72 104.61 ... 160.60 68.83 269.18 156.06 68.37 94.52 52.30 104.63 202.09 190.96
2016-10-16 20:00:00 64.10 123.63 120.15 87.52 164.39 153.81 54.89 104.32 112.66 90.29 ... 106.95 81.92 224.93 65.92 357.05 105.93 110.85 78.72 74.71 57.90
2016-10-16 22:00:00 64.01 103.64 35.65 106.78 183.47 51.67 58.27 105.03 37.17 62.19 ... 80.86 61.42 28.59 34.71 52.26 84.51 23.50 90.29 35.92 21.77
2016-10-17 00:00:00 59.61 89.41 95.71 70.85 38.50 27.91 40.03 77.48 16.13 125.27 ... 106.77 88.43 21.36 16.20 27.07 45.09 9.92 22.18 18.98 8.17
2016-10-17 02:00:00 37.09 35.27 15.58 28.74 8.36 17.12 51.25 35.20 10.38 25.51 ... 11.06 93.78 13.87 11.76 47.24 46.12 12.01 29.13 12.14 7.78
2016-10-17 04:00:00 56.49 91.66 9.91 73.25 15.55 9.84 69.42 126.47 30.23 35.97 ... 22.54 48.19 30.07 26.15 45.24 72.77 135.14 113.93 67.51 33.00
2016-10-17 06:00:00 43.74 68.25 56.34 83.62 196.30 42.83 48.09 140.63 75.72 43.62 ... 73.54 69.52 224.46 72.12 72.16 171.10 136.97 110.83 168.88 60.60
2016-10-17 08:00:00 133.58 306.58 108.63 147.11 165.10 64.31 108.33 296.26 115.41 118.52 ... 108.23 149.29 151.34 104.67 53.21 128.11 122.42 120.32 265.43 218.18
2016-10-17 10:00:00 64.87 118.49 161.91 129.52 142.21 220.20 76.01 132.14 88.98 50.23 ... 102.55 102.44 153.59 93.07 44.09 98.61 100.05 109.67 172.90 88.35
2016-10-17 12:00:00 65.24 99.45 131.03 94.10 167.98 104.38 45.44 104.89 104.69 77.63 ... 111.03 84.63 218.76 169.18 64.32 93.51 134.56 81.00 165.84 149.21
2016-10-17 14:00:00 52.28 84.48 99.41 98.19 191.14 131.23 70.19 100.53 147.23 104.86 ... 138.69 82.67 134.58 124.07 71.70 131.03 76.92 126.84 483.07 125.78
2016-10-17 16:00:00 53.86 109.92 134.99 115.47 180.28 171.02 69.77 111.73 136.45 100.27 ... 130.78 118.25 170.14 122.02 53.69 125.55 177.36 102.55 132.85 107.45
2016-10-17 18:00:00 65.40 158.01 77.42 102.74 267.11 173.74 48.66 115.05 98.47 83.02 ... 62.14 91.64 83.93 79.10 65.93 86.11 99.04 96.84 188.23 187.43
2016-10-17 20:00:00 52.66 101.30 62.67 99.77 90.82 209.32 72.69 137.58 172.53 84.75 ... 61.55 61.96 121.61 159.44 39.55 100.03 46.81 73.88 74.71 57.90

83 rows × 36 columns


In [46]:
#plot
import matplotlib.pyplot as plt
alpha=0.8
lw=0.7

fig, ax = plt.subplots(figsize = (26,8))

x_a = [pd.to_datetime(d) for d in y_test.index.values]

ax.scatter(np.array(x_a), y_test['0','A2'], color='green', label='y_test', s=0.8)

#ax.plot(x_a, y_test_predict_df['0','A2'], color='red', label='y_pred_rbf', alpha=alpha, lw=lw)
#plt.plot(x_a, y_test_predict_df['1','A2'], color='blue', label='y_pred_sigmoid', alpha=alpha, lw=lw)
#ax.plot(res.index.values, res['y_pred_lin'], color='orange', label='y_pred_lin', alpha=alpha, lw=lw)
#plt.plot(res.index.values, res['y_pred'], color='darkorange', label='y_pred_rbf')
ax.set_title('SVN on TimeInformation with rbf and linear kernel')
ax.set_xlabel('index(route,dayofweek,hour,minute)')
ax.set_ylabel('avg_travel_time')
ax.set_ylim(0,200)
ax.set_xlim(0)

ax.legend(shadow=True, fancybox=True)

#fig.legend()

'''
I also want to share my recent results. Maybe it helps or inspire someone.

SVN on TimeInformation with rbf and linear kernel.
Trained on the first 8 weeks and tested with the remaining data. (not shuffled)

'''


Out[46]:
'\nI also want to share my recent results. Maybe it helps or inspire someone.\n\nSVN on TimeInformation with rbf and linear kernel.\nTrained on the first 8 weeks and tested with the remaining data. (not shuffled)\n\n'
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
C:\Anaconda3\lib\site-packages\IPython\core\formatters.py in __call__(self, obj)
    305                 pass
    306             else:
--> 307                 return printer(obj)
    308             # Finally look for special method names
    309             method = get_real_method(obj, self.print_method)

C:\Anaconda3\lib\site-packages\IPython\core\pylabtools.py in <lambda>(fig)
    225 
    226     if 'png' in formats:
--> 227         png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
    228     if 'retina' in formats or 'png2x' in formats:
    229         png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))

C:\Anaconda3\lib\site-packages\IPython\core\pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
    117 
    118     bytes_io = BytesIO()
--> 119     fig.canvas.print_figure(bytes_io, **kw)
    120     data = bytes_io.getvalue()
    121     if fmt == 'svg':

C:\Anaconda3\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
   2178                     orientation=orientation,
   2179                     dryrun=True,
-> 2180                     **kwargs)
   2181                 renderer = self.figure._cachedRenderer
   2182                 bbox_inches = self.figure.get_tightbbox(renderer)

C:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
    525 
    526     def print_png(self, filename_or_obj, *args, **kwargs):
--> 527         FigureCanvasAgg.draw(self)
    528         renderer = self.get_renderer()
    529         original_dpi = renderer.dpi

C:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py in draw(self)
    472 
    473         try:
--> 474             self.figure.draw(self.renderer)
    475         finally:
    476             RendererAgg.lock.release()

C:\Anaconda3\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     60     def draw_wrapper(artist, renderer, *args, **kwargs):
     61         before(artist, renderer)
---> 62         draw(artist, renderer, *args, **kwargs)
     63         after(artist, renderer)
     64 

C:\Anaconda3\lib\site-packages\matplotlib\figure.py in draw(self, renderer)
   1157         dsu.sort(key=itemgetter(0))
   1158         for zorder, a, func, args in dsu:
-> 1159             func(*args)
   1160 
   1161         renderer.close_group('figure')

C:\Anaconda3\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     60     def draw_wrapper(artist, renderer, *args, **kwargs):
     61         before(artist, renderer)
---> 62         draw(artist, renderer, *args, **kwargs)
     63         after(artist, renderer)
     64 

C:\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in draw(self, renderer, inframe)
   2317 
   2318         for zorder, a in dsu:
-> 2319             a.draw(renderer)
   2320 
   2321         renderer.close_group('axes')

C:\Anaconda3\lib\site-packages\matplotlib\artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     60     def draw_wrapper(artist, renderer, *args, **kwargs):
     61         before(artist, renderer)
---> 62         draw(artist, renderer, *args, **kwargs)
     63         after(artist, renderer)
     64 

C:\Anaconda3\lib\site-packages\matplotlib\axis.py in draw(self, renderer, *args, **kwargs)
   1106         renderer.open_group(__name__)
   1107 
-> 1108         ticks_to_draw = self._update_ticks(renderer)
   1109         ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
   1110                                                                 renderer)

C:\Anaconda3\lib\site-packages\matplotlib\axis.py in _update_ticks(self, renderer)
    949 
    950         interval = self.get_view_interval()
--> 951         tick_tups = [t for t in self.iter_ticks()]
    952         if self._smart_bounds:
    953             # handle inverted limits

C:\Anaconda3\lib\site-packages\matplotlib\axis.py in <listcomp>(.0)
    949 
    950         interval = self.get_view_interval()
--> 951         tick_tups = [t for t in self.iter_ticks()]
    952         if self._smart_bounds:
    953             # handle inverted limits

C:\Anaconda3\lib\site-packages\matplotlib\axis.py in iter_ticks(self)
    892         Iterate through all of the major and minor ticks.
    893         """
--> 894         majorLocs = self.major.locator()
    895         majorTicks = self.get_major_ticks(len(majorLocs))
    896         self.major.formatter.set_locs(majorLocs)

C:\Anaconda3\lib\site-packages\matplotlib\dates.py in __call__(self)
   1005     def __call__(self):
   1006         'Return the locations of the ticks'
-> 1007         self.refresh()
   1008         return self._locator()
   1009 

C:\Anaconda3\lib\site-packages\matplotlib\dates.py in refresh(self)
   1025     def refresh(self):
   1026         'Refresh internal information based on current limits.'
-> 1027         dmin, dmax = self.viewlim_to_dt()
   1028         self._locator = self.get_locator(dmin, dmax)
   1029 

C:\Anaconda3\lib\site-packages\matplotlib\dates.py in viewlim_to_dt(self)
    769             vmin, vmax = vmax, vmin
    770 
--> 771         return num2date(vmin, self.tz), num2date(vmax, self.tz)
    772 
    773     def _get_unit(self):

C:\Anaconda3\lib\site-packages\matplotlib\dates.py in num2date(x, tz)
    417         tz = _get_rc_timezone()
    418     if not cbook.iterable(x):
--> 419         return _from_ordinalf(x, tz)
    420     else:
    421         x = np.asarray(x)

C:\Anaconda3\lib\site-packages\matplotlib\dates.py in _from_ordinalf(x, tz)
    269 
    270     ix = int(x)
--> 271     dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
    272 
    273     remainder = float(x) - ix

ValueError: ordinal must be >= 1
<matplotlib.figure.Figure at 0x2d28f1806a0>

SVN Parameter Finding


In [17]:
from sklearn.multioutput import MultiOutputRegressor
from sklearn.svm import SVR
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler

pipe_svr = Pipeline([ ('reg', MultiOutputRegressor(SVR()))])

grid_param_svr = {
    'reg__estimator__C': np.arange(20, 40.0, 2.0), 
    "reg__estimator__epsilon": [0.0, 0.0001, 0.001, 0.0025, 0.005]
}

gs_svr = (GridSearchCV(estimator=pipe_svr, 
                      param_grid=grid_param_svr, 
                      cv=2,
                      scoring = 'neg_mean_squared_error',
                      n_jobs = -1))

gs_svr = gs_svr.fit(x_train,y_train)

In [18]:
print(gs_svr.best_estimator_)
print(gs_svr.best_params_)
pd.DataFrame(gs_svr.cv_results_).sort_values('rank_test_score')


Pipeline(steps=[('reg', MultiOutputRegressor(estimator=SVR(C=30.0, cache_size=200, coef0=0.0, degree=3, epsilon=0.005, gamma='auto',
  kernel='rbf', max_iter=-1, shrinking=True, tol=0.001, verbose=False),
           n_jobs=1))])
{'reg__estimator__C': 30.0, 'reg__estimator__epsilon': 0.005}
Out[18]:
mean_fit_time mean_score_time mean_test_score mean_train_score param_reg__estimator__C param_reg__estimator__epsilon params rank_test_score split0_test_score split0_train_score split1_test_score split1_train_score std_fit_time std_score_time std_test_score std_train_score
29 1.485690 0.272784 -2922.220954 -2480.605715 30 0.005 {'reg__estimator__C': 30.0, 'reg__estimator__e... 1 -2527.670003 -2652.004460 -3316.771905 -2309.206970 0.099013 0.041755 394.550951 171.398745
34 1.551198 0.237281 -2922.250148 -2477.496665 32 0.005 {'reg__estimator__C': 32.0, 'reg__estimator__e... 2 -2529.336965 -2650.288076 -3315.163331 -2304.705255 0.112514 0.009751 392.913183 172.791411
28 1.529694 0.239030 -2922.260523 -2480.642198 30 0.0025 {'reg__estimator__C': 30.0, 'reg__estimator__e... 3 -2527.693491 -2652.033039 -3316.827555 -2309.251356 0.142018 0.000500 394.567032 171.390842
27 1.503191 0.232280 -2922.283798 -2480.663840 30 0.001 {'reg__estimator__C': 30.0, 'reg__estimator__e... 4 -2527.707637 -2652.050136 -3316.859959 -2309.277545 0.127516 0.010751 394.576161 171.386296
33 1.550447 0.239530 -2922.290200 -2477.533470 32 0.0025 {'reg__estimator__C': 32.0, 'reg__estimator__e... 5 -2529.361020 -2650.317342 -3315.219381 -2304.749598 0.114764 0.004500 392.929181 172.783872
26 1.492940 0.230529 -2922.297897 -2480.677186 30 0.0001 {'reg__estimator__C': 30.0, 'reg__estimator__e... 6 -2527.715912 -2652.060650 -3316.879882 -2309.293721 0.114264 0.008001 394.581985 171.383464
25 1.485939 0.236280 -2922.299018 -2480.678231 30 0 {'reg__estimator__C': 30.0, 'reg__estimator__e... 7 -2527.717053 -2652.061656 -3316.880983 -2309.294806 0.111264 0.002250 394.581965 171.383425
32 1.543446 0.234030 -2922.314287 -2477.555871 32 0.001 {'reg__estimator__C': 32.0, 'reg__estimator__e... 8 -2529.375446 -2650.335371 -3315.253128 -2304.776371 0.135767 0.003501 392.938841 172.779500
31 1.527663 0.235530 -2922.328628 -2477.569152 32 0.0001 {'reg__estimator__C': 32.0, 'reg__estimator__e... 9 -2529.383768 -2650.345625 -3315.273489 -2304.792680 0.113545 0.004500 392.944861 172.776472
30 1.517932 0.233279 -2922.329924 -2477.570385 32 0 {'reg__estimator__C': 32.0, 'reg__estimator__e... 10 -2529.384688 -2650.346807 -3315.275159 -2304.793964 0.109775 0.009751 392.945235 172.776422
39 1.538695 0.241531 -2922.428757 -2474.470755 34 0.005 {'reg__estimator__C': 34.0, 'reg__estimator__e... 11 -2531.156279 -2648.703374 -3313.701234 -2300.238136 0.082010 0.013002 391.272477 174.232619
38 1.647959 0.235031 -2922.468659 -2474.507695 34 0.0025 {'reg__estimator__C': 34.0, 'reg__estimator__e... 12 -2531.179223 -2648.733059 -3313.758096 -2300.282332 0.094262 0.008001 391.289437 174.225364
24 1.436183 0.233559 -2922.486241 -2483.822648 28 0.005 {'reg__estimator__C': 28.0, 'reg__estimator__e... 13 -2526.396716 -2653.732867 -3318.575766 -2313.912429 0.090511 0.008472 396.089525 169.910219
37 1.840234 0.250532 -2922.492544 -2474.529870 34 0.001 {'reg__estimator__C': 34.0, 'reg__estimator__e... 14 -2531.192858 -2648.750877 -3313.792229 -2300.308863 0.050006 0.020503 391.299686 174.221007
36 1.901242 0.319290 -2922.506824 -2474.543165 34 0.0001 {'reg__estimator__C': 34.0, 'reg__estimator__e... 15 -2531.201134 -2648.761782 -3313.812513 -2300.324548 0.256032 0.023253 391.305690 174.218617
35 1.740721 0.283036 -2922.507810 -2474.544616 34 0 {'reg__estimator__C': 34.0, 'reg__estimator__e... 16 -2531.202019 -2648.763231 -3313.813602 -2300.326001 0.281036 0.042006 391.305791 174.218615
23 1.445184 0.234030 -2922.524273 -2483.858376 28 0.0025 {'reg__estimator__C': 28.0, 'reg__estimator__e... 17 -2526.419464 -2653.760405 -3318.629081 -2313.956348 0.093511 0.007501 396.104809 169.902028
22 1.445184 0.231029 -2922.547090 -2483.879641 28 0.001 {'reg__estimator__C': 28.0, 'reg__estimator__e... 18 -2526.433084 -2653.776709 -3318.661097 -2313.982573 0.115515 0.009501 396.114007 169.897068
21 1.458436 0.231279 -2922.560784 -2483.892621 28 0.0001 {'reg__estimator__C': 28.0, 'reg__estimator__e... 19 -2526.441594 -2653.787026 -3318.679974 -2313.998215 0.112764 0.009751 396.119190 169.894406
20 1.479938 0.234280 -2922.561817 -2483.893677 28 0 {'reg__estimator__C': 28.0, 'reg__estimator__e... 20 -2526.441944 -2653.787696 -3318.681691 -2313.999657 0.096762 0.011752 396.119873 169.894019
4 1.369674 0.235030 -2922.576964 -2501.003380 20 0.005 {'reg__estimator__C': 20.0, 'reg__estimator__e... 21 -2518.327669 -2664.562041 -3326.826260 -2337.444720 0.077010 0.008501 404.249296 163.558660
3 1.378675 0.235780 -2922.613474 -2501.036167 20 0.0025 {'reg__estimator__C': 20.0, 'reg__estimator__e... 22 -2518.351570 -2664.586302 -3326.875378 -2337.486032 0.087011 0.007751 404.261904 163.550135
2 1.437433 0.236280 -2922.635927 -2501.055226 20 0.001 {'reg__estimator__C': 20.0, 'reg__estimator__e... 23 -2518.366839 -2664.600637 -3326.905016 -2337.509815 0.117764 0.006251 404.269089 163.545411
1 1.380423 0.255533 -2922.649332 -2501.066675 20 0.0001 {'reg__estimator__C': 20.0, 'reg__estimator__e... 24 -2518.375936 -2664.609066 -3326.922728 -2337.524285 0.135770 0.023503 404.273396 163.542391
0 1.334910 0.236528 -2922.650265 -2501.068039 20 0 {'reg__estimator__C': 20.0, 'reg__estimator__e... 25 -2518.376522 -2664.610350 -3326.924007 -2337.525728 0.117264 0.007499 404.273743 163.542311
9 1.552448 0.242531 -2922.729474 -2495.621751 22 0.005 {'reg__estimator__C': 22.0, 'reg__estimator__e... 26 -2520.954031 -2660.929315 -3324.504917 -2330.314187 0.169772 0.007001 401.775443 165.307564
8 1.459436 0.266284 -2922.766063 -2495.654513 22 0.0025 {'reg__estimator__C': 22.0, 'reg__estimator__e... 27 -2520.974673 -2660.953746 -3324.557453 -2330.355280 0.144269 0.034754 401.791390 165.299233
14 1.393427 0.233780 -2922.784942 -2491.000473 24 0.005 {'reg__estimator__C': 24.0, 'reg__estimator__e... 28 -2523.202437 -2657.790614 -3322.367447 -2324.210331 0.092262 0.002751 399.582505 166.790141
7 1.477188 0.275035 -2922.787694 -2495.674030 22 0.001 {'reg__estimator__C': 22.0, 'reg__estimator__e... 29 -2520.986974 -2660.968406 -3324.588413 -2330.379654 0.123516 0.015001 401.800720 165.294376
6 1.445934 0.248531 -2922.800721 -2495.685808 22 0.0001 {'reg__estimator__C': 22.0, 'reg__estimator__e... 30 -2520.994938 -2660.977325 -3324.606504 -2330.394291 0.128267 0.009001 401.805783 165.291517
5 1.433182 0.260783 -2922.802200 -2495.687124 22 0 {'reg__estimator__C': 22.0, 'reg__estimator__e... 31 -2520.995615 -2660.978197 -3324.608785 -2330.396051 0.163021 0.007751 401.806585 165.291073
19 1.434932 0.238781 -2922.819758 -2487.206387 26 0.005 {'reg__estimator__C': 26.0, 'reg__estimator__e... 32 -2525.244688 -2655.653781 -3320.394827 -2318.758993 0.110264 0.003251 397.575069 168.447394
13 1.413430 0.235780 -2922.823325 -2491.034265 24 0.0025 {'reg__estimator__C': 24.0, 'reg__estimator__e... 33 -2523.225694 -2657.815670 -3322.420956 -2324.252860 0.109764 0.015252 399.597631 166.781405
12 1.437933 0.233280 -2922.845921 -2491.053893 24 0.001 {'reg__estimator__C': 24.0, 'reg__estimator__e... 34 -2523.239482 -2657.829934 -3322.452360 -2324.277852 0.120765 0.005750 399.606439 166.776041
18 1.419180 0.234530 -2922.857742 -2487.242072 26 0.0025 {'reg__estimator__C': 26.0, 'reg__estimator__e... 35 -2525.268214 -2655.681745 -3320.447269 -2318.802398 0.097512 0.009501 397.589527 168.439673
11 1.543447 0.234030 -2922.859941 -2491.066405 24 0.0001 {'reg__estimator__C': 24.0, 'reg__estimator__e... 36 -2523.248000 -2657.839317 -3322.471882 -2324.293492 0.005251 0.013002 399.611941 166.772912
10 1.645459 0.259533 -2922.860664 -2491.067512 24 0 {'reg__estimator__C': 24.0, 'reg__estimator__e... 37 -2523.248374 -2657.840053 -3322.472954 -2324.294971 0.122765 0.018502 399.612290 166.772541
44 1.617956 0.237780 -2922.868469 -2471.777091 36 0.005 {'reg__estimator__C': 36.0, 'reg__estimator__e... 38 -2533.010302 -2647.325517 -3312.726637 -2296.228666 0.072759 0.004751 389.858167 175.548426
17 1.461686 0.237280 -2922.880223 -2487.263324 26 0.001 {'reg__estimator__C': 26.0, 'reg__estimator__e... 39 -2525.282151 -2655.698421 -3320.478296 -2318.828226 0.113015 0.013252 397.598072 168.435098
16 1.445934 0.231780 -2922.893958 -2487.275871 26 0.0001 {'reg__estimator__C': 26.0, 'reg__estimator__e... 40 -2525.290718 -2655.708272 -3320.497198 -2318.843470 0.109764 0.009251 397.603240 168.432401
15 1.459185 0.236281 -2922.895368 -2487.277457 26 0 {'reg__estimator__C': 26.0, 'reg__estimator__e... 41 -2525.291578 -2655.709770 -3320.499159 -2318.845144 0.114515 0.012751 397.603791 168.432313
43 1.710968 0.248031 -2922.910206 -2471.815296 36 0.0025 {'reg__estimator__C': 36.0, 'reg__estimator__e... 42 -2533.034911 -2647.357099 -3312.785500 -2296.273492 0.112764 0.008501 389.875295 175.541804
42 1.679964 0.283786 -2922.935222 -2471.838465 36 0.001 {'reg__estimator__C': 36.0, 'reg__estimator__e... 43 -2533.049619 -2647.375952 -3312.820825 -2296.300979 0.147769 0.017253 389.885603 175.537486
41 1.630207 0.235780 -2922.950431 -2471.852202 36 0.0001 {'reg__estimator__C': 36.0, 'reg__estimator__e... 44 -2533.059003 -2647.387408 -3312.841859 -2296.316997 0.196025 0.012251 389.891428 175.535206
40 1.581451 0.230029 -2922.951992 -2471.853659 36 0 {'reg__estimator__C': 36.0, 'reg__estimator__e... 45 -2533.060214 -2647.388566 -3312.843770 -2296.318753 0.110264 0.010501 389.891778 175.534906
49 1.501185 0.228527 -2923.442900 -2469.325554 38 0.005 {'reg__estimator__C': 38.0, 'reg__estimator__e... 46 -2534.889341 -2646.032059 -3311.996459 -2292.619049 0.079003 0.009503 388.553559 176.706505
48 1.572700 0.231280 -2923.484318 -2469.364222 38 0.0025 {'reg__estimator__C': 38.0, 'reg__estimator__e... 47 -2534.913190 -2646.063852 -3312.055446 -2292.664591 0.147519 0.010751 388.571128 176.699630
47 1.582951 0.251283 -2923.508755 -2469.387697 38 0.001 {'reg__estimator__C': 38.0, 'reg__estimator__e... 48 -2534.927033 -2646.083087 -3312.090478 -2292.692306 0.122265 0.024253 388.581722 176.695391
46 1.593953 0.233030 -2923.523707 -2469.401689 38 0.0001 {'reg__estimator__C': 38.0, 'reg__estimator__e... 49 -2534.935914 -2646.094574 -3312.111500 -2292.708805 0.126766 0.013002 388.587793 176.692885
45 1.639959 0.248531 -2923.525213 -2469.402923 38 0 {'reg__estimator__C': 38.0, 'reg__estimator__e... 50 -2534.937177 -2646.095736 -3312.113249 -2292.710109 0.096762 0.018502 388.588036 176.692814