In [2]:
import pandas as pd
import numpy as np
properties = pd.read_csv('../matrix_properties/processed_properties.csv', header=0, index_col=0)
properties


Out[2]:
rows cols min_nnz_row row_var col_var diag_var nnz frob_norm symm_frob_norm antisymm_frob_norm ... diag_avg diag_sign diag_nnz lower_bw upper_bw row_log_val_spread col_log_val_spread symm matrix matrix_id
0 14214 14214 1 2.749350e+06 2.452810e+06 1.406880e+10 259688 9.828360e+06 9.807560e+06 6.391140e+05 ... 5.254030e+04 3 14214 3002 3002 10.583400 10.576700 0 airfoil_2d.mtx 19887524238821882
1 7980 7980 1 4.502720e+06 2.335100e+06 1.150730e+04 430909 5.856960e+05 4.105800e+05 4.176880e+05 ... 8.093520e+01 2 7980 7614 7614 65.962898 67.929703 0 GT01R.mtx -5775540644877232367
2 903 903 1 8.311720e+10 9.781740e+10 1.974110e+06 11766 1.922430e+07 1.359310e+07 1.359410e+07 ... 1.640130e+02 2 903 18 17 25.935200 27.098801 0 DK01R.mtx -5986948858364213259
3 100 100 1 2.000250e+07 2.000250e+07 4.651510e+07 708 9.165920e+04 8.124290e+04 4.243820e+04 ... 1.220200e+03 3 66 90 93 74.442703 74.442703 0 rotor1.mtx 8484898116850689434
4 791 791 1 2.981690e+08 3.005250e+08 2.935790e+06 10685 4.707840e+06 3.329280e+06 3.328610e+06 ... 1.061870e+02 3 681 721 721 53.458698 53.458698 0 rotor2.mtx -6072360429082770149
5 120 120 1 1.109260e+02 1.109430e+02 3.478940e+02 870 2.757220e+02 2.755630e+02 9.353130e+00 ... 7.147120e+00 3 80 86 85 34.471699 35.962101 0 robot.mtx 7994235322272888217
6 22560 22560 1 8.883250e+04 7.075190e+04 1.845490e+07 1014951 1.226680e+06 1.011760e+06 6.936030e+05 ... 1.229920e+03 3 19201 22497 22501 23.743601 24.376101 0 rim.mtx 4823531754514349391
7 7320 7320 1 2.482930e+04 2.484160e+04 2.410580e+02 324772 1.251230e+05 8.847830e+04 8.847190e+04 ... 9.736560e+00 3 6241 7268 7272 20.894100 22.074301 0 goodwin.mtx -6779958172899380421
8 6747 6747 1 4.350050e+13 4.349980e+13 1.728470e-04 29195 4.489870e+09 3.174820e+09 3.174820e+09 ... 1.630510e-04 3 7 5499 6746 150.746994 152.011993 0 bayer03.mtx -2948657301607606973
9 7 7 2 1.661810e-01 2.857140e-01 1.591840e+00 15 3.068660e+00 2.776390e+00 1.307030e+00 ... 8.571430e-01 3 6 6 3 2.112280 2.112280 0 b1_ss.mtx -1112158721073983879
10 4008 4008 1 7.542010e-03 4.990020e-04 0.000000e+00 8188 7.535000e+01 6.962960e+01 2.879830e+01 ... 1.000000e+00 2 4008 3880 3971 4.000000 4.000000 0 poli.mtx 4976962171922655578
11 1089 1089 1 7.780530e+05 7.780550e+05 2.953070e-06 4144 2.913530e+04 2.060170e+04 2.060170e+04 ... 5.205090e-05 -1 2 929 1087 11.617300 10.347200 0 b_dyn.mtx 228925959793543907
12 3008 3008 1 1.230070e+14 2.070240e+14 8.276200e-09 20715 8.872200e+08 6.273590e+08 6.273590e+08 ... 1.659000e-06 1 2 2745 2941 59.491600 59.491600 0 bayer06.mtx -6898831756602135984
13 3268 3268 1 1.132270e+21 1.905750e+21 7.627280e-02 20712 2.805640e+12 1.983880e+12 1.983880e+12 ... 4.828860e-03 -1 2 3008 2941 49.660000 47.505501 0 bayer05.mtx 3532213595034724768
14 57735 57735 1 2.749710e+05 2.749710e+05 3.464220e-15 275094 1.474390e+05 1.042550e+05 1.042550e+05 ... 3.464100e-10 3 2 49670 57733 60.287800 59.190498 0 bayer01.mtx -2506944807671163731
15 33833 33833 1 7.081190e-03 5.911390e-05 2.919400e-05 73249 2.432730e+02 2.156500e+02 1.125900e+02 ... 9.998240e-01 2 33833 8250 33784 5.000000 5.000000 0 poli4.mtx 7180988505657274579
16 15575 15575 1 2.142630e-02 1.284110e-04 0.000000e+00 33033 1.648220e+02 1.461970e+02 7.610990e+01 ... 1.000000e+00 2 15575 15446 15574 4.000000 4.000000 0 poli_large.mtx 8145206048026237316
17 13935 13935 1 1.139130e+06 1.139130e+06 1.293110e-09 63307 1.295600e+05 9.161240e+04 9.161240e+04 ... 3.053410e-07 3 4 11975 13934 30.473000 30.473000 0 bayer02.mtx 4680606340196338140
18 87 87 1 1.465180e+02 7.136470e+01 4.452630e-04 230 1.245600e+02 8.807760e+01 8.807740e+01 ... 2.384870e-03 1 4 77 86 21.470600 21.470600 0 d_dyn.mtx 403929735680113531
19 53 53 2 2.404250e+07 1.155140e+07 4.741500e+02 144 3.935890e+04 2.783070e+04 2.783120e+04 ... 3.053440e+00 3 4 45 13 4.819540 8.017200 0 d_ss.mtx -4994494029901138806
20 3008 3008 1 1.404990e+16 2.364630e+16 9.453090e-07 20698 9.482060e+09 6.704830e+09 6.704830e+09 ... 1.773050e-05 1 2 2745 2941 127.699997 127.699997 0 bayer08.mtx 6535804989228705154
21 2904 2904 1 8.268680e+08 8.358930e+08 3.442970e+08 58142 2.204220e+06 1.711550e+06 1.388950e+06 ... 3.667160e+02 1 27 2827 1545 38.847099 38.847099 0 meg1.mtx -8372607300412374109
22 3083 3083 1 4.768310e+14 4.768290e+14 4.369010e-04 11767 3.428560e+09 2.424360e+09 2.424360e+09 ... 3.801520e-04 3 4 2857 3082 47.450500 47.450500 0 bayer09.mtx 512144867597512972
23 1089 1089 1 1.836550e+07 2.753140e+07 9.174300e-04 3895 7.771520e+05 5.495290e+05 5.495290e+05 ... 9.182740e-04 1 1 929 1087 5.309360 6.000000 0 b2_ss.mtx 6412634430590477265
24 3268 3268 1 1.132270e+21 1.905750e+21 7.627280e-02 20963 2.805640e+12 1.983880e+12 1.983880e+12 ... 4.828860e-03 -1 2 3008 2941 113.339996 111.080002 0 bayer07.mtx -9220398378778986880
25 16955 16955 1 1.449360e-02 1.179590e-04 2.912610e-05 37849 1.704120e+02 1.516500e+02 7.773260e+01 ... 9.999140e-01 2 16955 16917 16871 4.000000 4.000000 0 poli3.mtx 5589165627329254470
26 1 1 1 0.000000e+00 0.000000e+00 0.000000e+00 1 1.000000e+00 1.000000e+00 0.000000e+00 ... 1.000000e+00 2 1 0 0 0.000000 0.000000 1 bayer10_b.mtx 7931573722526867494
27 13436 13436 1 1.488540e+04 7.444420e+03 6.036500e-08 71594 5.114850e+04 3.616750e+04 3.616750e+04 ... 3.328370e-06 3 3 11773 13435 69.938599 69.938599 0 bayer10.mtx -6472350556156066994
28 20545 20545 1 5.558830e+14 5.558790e+14 0.000000e+00 85537 7.541860e+09 5.332900e+09 5.332900e+09 ... 0.000000e+00 0 0 20446 20544 257.191010 255.404007 0 bayer04.mtx -7309986263285849987
29 1 1 1 0.000000e+00 0.000000e+00 0.000000e+00 1 1.000000e+00 1.000000e+00 0.000000e+00 ... 1.000000e+00 2 1 0 0 0.000000 0.000000 1 bayer04_b.mtx 3436031720737404110
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1798 27607 27607 1 5.772350e+02 6.496450e+02 1.873080e+04 96601 1.676230e+05 1.196150e+05 1.174290e+05 ... 5.697050e+00 1 13807 20707 0 6.582200 4.633730 0 brainpc2.mtx -5962327591105203323
1799 466316 466316 1 3.382860e+13 3.494290e+10 3.270160e-03 890091 6.165520e+09 4.359680e+09 4.359680e+09 ... 6.004620e-02 1 279785 373055 0 3.542510 9.106020 0 boyd2.mtx -6219492332827592286
1800 93279 93279 1 2.562260e+15 3.111880e+13 9.213670e+06 652246 2.741910e+10 1.938830e+10 1.938830e+10 ... 2.435970e+03 1 93261 93269 0 8.048050 8.426350 0 boyd1.mtx -4703796495520041217
1801 10001 10001 1 2.499000e+03 2.499250e+03 2.496250e+03 30000 5.012980e+03 5.010860e+03 1.457530e+02 ... 3.499230e+00 2 10001 10000 0 1.079180 4.301010 0 bloweybq.mtx 4103207892035863752
1802 30003 30003 0 1.481390e-01 2.333210e-04 8.888890e-05 60000 2.645670e+02 1.870820e+02 1.870720e+02 ... 6.666670e-03 1 10001 20003 0 8.301030 8.000000 0 bloweybl.mtx 1354757437240894202
1803 30004 30004 1 1.481390e-01 9.545170e-04 3.919450e+00 80005 5.351540e+02 4.810310e+02 2.345180e+02 ... 1.399820e+00 1 10001 20004 0 8.301030 8.623250 0 bloweya.mtx 6659129546962774885
1804 60012 60012 1 7.412410e-02 1.481520e-01 9.076990e-03 340022 5.492040e+02 3.893840e+02 3.873050e+02 ... 1.335080e-01 1 40011 40012 0 1.000000 1.000000 0 blockqp1.mtx -2055351098719201812
1805 35543 35543 1 1.766700e+12 1.766700e+12 3.689610e+14 77829 3.699320e+09 3.699320e+09 1.585650e+02 ... 4.007900e+06 1 27543 29215 0 0.000000 8.398970 0 aug3dcqp.mtx 4958691810767147470
1806 24300 24300 0 2.469140e-04 8.230450e-05 0.000000e+00 34992 1.870610e+02 1.322720e+02 1.322720e+02 ... 0.000000e+00 0 0 18468 0 0.000000 0.000000 0 aug3d.mtx -8690730350871121349
1807 30200 30200 0 1.324500e-04 6.622520e-05 0.000000e+00 40000 2.000000e+02 1.414210e+02 1.414210e+02 ... 0.000000e+00 0 0 20299 0 0.000000 0.000000 0 aug2dc.mtx 2699054602099232318
1808 29008 29008 0 1.378930e-04 6.894650e-05 0.000000e+00 38416 1.960000e+02 1.385930e+02 1.385930e+02 ... 0.000000e+00 0 0 19404 0 0.000000 0.000000 0 aug2d.mtx -2311456528724938366
1809 60008 60008 0 2.742370e-02 1.713200e-03 8.333560e-03 145004 5.202770e+02 3.686380e+02 3.671430e+02 ... 1.000000e-01 1 35004 60006 0 6.873120 6.000000 0 a5esindl.mtx -1895390943572275392
1810 80016 80016 0 2.109930e-02 2.473770e-03 8.750250e-03 196115 6.410830e+02 4.541410e+02 4.524860e+02 ... 1.000000e-01 1 45008 75014 0 6.448550 6.000000 0 a2nnsnsl.mtx -1070851686136332952
1811 80016 80016 0 2.085350e-02 2.519930e-03 8.750250e-03 200021 6.954430e+02 4.925140e+02 4.909890e+02 ... 1.000000e-01 1 45008 75014 0 6.873120 6.000000 0 a0nsdsil.mtx -2741829842424024218
1812 46835 46835 1 9.032010e+10 2.461370e+11 1.873940e+11 2329092 6.812270e+08 4.786920e+08 4.846900e+08 ... 1.539050e+04 3 41218 25141 25141 18.611099 17.506701 0 rma10.mtx -3606479407315589713
1813 60000 60000 1 2.088330e-02 2.095000e-02 1.165850e+01 410077 3.036420e+03 3.007460e+03 4.183760e+02 ... 1.166920e+01 2 60000 59925 0 1.544070 1.544070 0 Andrews.mtx 6206985400869139941
1814 226451 226451 1 1.213120e+16 1.420150e+16 1.235180e+19 1349261 3.269480e+12 3.005100e+12 1.287980e+12 ... 4.494600e+09 2 226451 12344 0 2.927370 3.385780 0 CurlCurl_1.mtx -1575928157154417033
1815 11083 11083 1 6.313620e+16 5.672150e+16 2.814940e+18 62213 2.664030e+11 2.444310e+11 1.059430e+11 ... 1.250270e+09 2 11083 1748 0 3.223760 3.326850 0 CurlCurl_0.mtx 704373375320501965
1816 181343 181343 6 5.520120e+20 5.520120e+20 6.078740e+09 6869939 1.698180e+13 1.200790e+13 1.200790e+13 ... 2.992270e+03 2 181343 159843 121355 120.976997 115.703003 0 ohne2.mtx 8453664841203720248
1817 113076 113076 6 5.452800e+18 3.460660e+19 1.672080e+11 2129496 6.063660e+12 4.287650e+12 4.287650e+12 ... 8.517740e+03 2 113076 111594 76329 281.941986 279.345001 0 barrier2-2.mtx 8461741746710260096
1818 113076 113076 6 5.452800e+18 3.460660e+19 1.672080e+11 2129496 6.063660e+12 4.287650e+12 4.287650e+12 ... 8.517690e+03 2 113076 111594 76329 281.941986 279.345001 0 barrier2-3.mtx 1842672857101724570
1819 155924 155924 1 5.424710e+18 2.763470e+18 8.785790e+08 2094873 6.302790e+12 4.456750e+12 4.456750e+12 ... 7.964070e+03 3 155924 154381 104472 25.198900 29.062300 0 para-10.mtx -4622644049196758065
1820 113076 113076 6 5.452800e+18 3.460660e+19 1.672090e+11 2129496 6.063660e+12 4.287650e+12 4.287650e+12 ... 8.528410e+03 2 113076 111594 76329 281.941986 279.345001 0 barrier2-1.mtx -7384853776931222406
1821 115625 115625 1 8.606500e+18 4.381060e+18 1.962510e+09 2158759 6.767000e+12 4.784990e+12 4.784990e+12 ... 6.572750e+03 1 115603 114098 77472 281.941986 279.345001 0 barrier2-10.mtx 8669050514685049437
1822 155924 155924 1 1.084980e+20 5.430160e+19 8.852570e+08 2094873 1.328090e+13 9.391001e+12 9.391001e+12 ... 7.979070e+03 3 155924 154381 104472 25.198900 29.062300 0 para-8.mtx 3948219689851812507
1823 155924 155924 1 5.424710e+18 2.763470e+18 8.677630e+08 2094873 6.050260e+12 4.278180e+12 4.278180e+12 ... 7.931000e+03 3 155924 154381 104472 25.198900 29.062300 0 para-5.mtx -2128797342745014508
1824 155924 155924 1 5.424710e+18 2.763470e+18 8.677590e+08 2094873 6.050260e+12 4.278180e+12 4.278180e+12 ... 7.930480e+03 3 155924 154381 104472 25.198900 29.062300 0 para-6.mtx 708491703606896587
1825 155924 155924 1 1.633810e+19 8.189550e+18 8.816070e+08 2094873 7.609600e+12 5.380800e+12 5.380800e+12 ... 7.970920e+03 3 155924 154381 104472 25.198900 29.062300 0 para-9.mtx 6244953154999307277
1826 68121 68121 9 2.481400e+12 2.348690e+12 9.594780e+06 5377761 8.390890e+08 5.933260e+08 5.933250e+08 ... 3.884920e+01 3 68121 1048 68120 34.379601 34.379601 0 Chebyshev4.mtx -8619091565349370147
1827 445315 445315 3 1.961380e-06 1.951300e-06 9.836500e-03 7479343 4.610660e+02 4.606180e+02 2.033570e+01 ... 6.777220e-01 2 445315 206333 206333 1.937690 1.937690 0 cage13.mtx 6114002583951231462

1828 rows × 37 columns


In [3]:
time_files = ['../processed_timings/system_specific/bridges_all_np_timings_processed.csv',
            '../processed_timings/system_specific/comet_all_np_timings_processed.csv',
            '../processed_timings/system_specific/laptop_all_np_timings_processed.csv',
            '../processed_timings/system_specific/summit_all_np_timings_processed.csv',
            '../processed_timings/system_specific/stampede_all_np_timings_processed.csv']
times_array = []
for t in time_files:
    times_array.append(pd.read_csv(t, header=0, index_col=0))
combined_times = pd.concat(times_array)
combined_times = combined_times.drop(labels=['system', 'solver', 'prec', 'status',
                                            'new_time', 'good_or_bad', 'resid', 'iters'],
                                         axis=1)
combined_times = combined_times.drop_duplicates()
combined_times


Out[3]:
np matrix time system_id solver_id prec_id status_id matrix_id
0 1 saylr3.mtx 0.600685 1 0 0 0 5054133946684947129
1 1 saylr3.mtx 0.000000 1 0 1 -1 5054133946684947129
2 1 saylr3.mtx 0.204453 1 0 2 0 5054133946684947129
3 1 saylr3.mtx 0.000000 1 0 3 -1 5054133946684947129
4 1 saylr3.mtx 0.000000 1 0 4 -1 5054133946684947129
5 1 saylr3.mtx 0.000000 1 1 0 -1 5054133946684947129
6 1 saylr3.mtx 0.000000 1 1 1 -1 5054133946684947129
7 1 saylr3.mtx 0.000000 1 1 2 -1 5054133946684947129
8 1 saylr3.mtx 0.000000 1 1 3 -1 5054133946684947129
9 1 saylr3.mtx 0.000000 1 1 4 -1 5054133946684947129
10 1 saylr3.mtx 0.342844 1 2 0 0 5054133946684947129
11 1 saylr3.mtx 0.399248 1 2 1 0 5054133946684947129
12 1 saylr3.mtx 0.449968 1 2 2 0 5054133946684947129
13 1 saylr3.mtx 0.382935 1 2 3 0 5054133946684947129
14 1 saylr3.mtx 0.367520 1 2 4 0 5054133946684947129
15 1 saylr3.mtx 0.000000 1 3 0 -1 5054133946684947129
16 1 saylr3.mtx 0.000000 1 3 1 -1 5054133946684947129
17 1 saylr3.mtx 0.000000 1 3 2 -1 5054133946684947129
18 1 saylr3.mtx 0.000000 1 3 3 -1 5054133946684947129
19 1 saylr3.mtx 0.000000 1 3 4 -1 5054133946684947129
20 1 saylr3.mtx 0.000000 1 5 0 -1 5054133946684947129
21 1 saylr3.mtx 0.000000 1 5 1 -1 5054133946684947129
22 1 saylr3.mtx 0.000000 1 5 2 -1 5054133946684947129
23 1 saylr3.mtx 0.000000 1 5 3 -1 5054133946684947129
24 1 saylr3.mtx 2.203410 1 5 4 0 5054133946684947129
25 1 saylr3.mtx 0.289455 1 7 0 1 5054133946684947129
26 1 saylr3.mtx 1.423180 1 7 1 0 5054133946684947129
27 1 saylr3.mtx 0.546993 1 7 2 1 5054133946684947129
28 1 saylr3.mtx 0.621376 1 7 3 1 5054133946684947129
29 1 saylr3.mtx 0.766375 1 7 4 0 5054133946684947129
... ... ... ... ... ... ... ... ...
154730 16 Long_Coup_dt6.mtx 0.000000 4 0 3 -1 4669152869610276719
154731 16 Long_Coup_dt6.mtx 0.000000 4 0 4 -1 4669152869610276719
154732 16 Long_Coup_dt6.mtx 654.088000 4 1 0 0 4669152869610276719
154733 16 Long_Coup_dt6.mtx 645.579000 4 1 1 0 4669152869610276719
154734 16 Long_Coup_dt6.mtx 340.486000 4 1 2 0 4669152869610276719
154735 16 Long_Coup_dt6.mtx 346.561000 4 1 3 0 4669152869610276719
154736 16 Long_Coup_dt6.mtx 328.603000 4 1 4 0 4669152869610276719
154737 16 Long_Coup_dt6.mtx 179.970000 4 2 0 0 4669152869610276719
154738 16 Long_Coup_dt6.mtx 179.707000 4 2 1 0 4669152869610276719
154739 16 Long_Coup_dt6.mtx 179.425000 4 2 2 0 4669152869610276719
154740 16 Long_Coup_dt6.mtx 179.626000 4 2 3 0 4669152869610276719
154741 16 Long_Coup_dt6.mtx 179.135000 4 2 4 0 4669152869610276719
154742 16 Long_Coup_dt6.mtx 0.000000 4 3 0 -1 4669152869610276719
154743 16 Long_Coup_dt6.mtx 0.000000 4 3 1 -1 4669152869610276719
154744 16 Long_Coup_dt6.mtx 0.000000 4 3 2 -1 4669152869610276719
154745 16 Long_Coup_dt6.mtx 0.000000 4 3 3 -1 4669152869610276719
154746 16 Long_Coup_dt6.mtx 163.753000 4 3 4 0 4669152869610276719
154747 16 Long_Coup_dt6.mtx 668.360000 4 5 0 0 4669152869610276719
154748 16 Long_Coup_dt6.mtx 660.046000 4 5 1 0 4669152869610276719
154749 16 Long_Coup_dt6.mtx 356.546000 4 5 2 0 4669152869610276719
154750 16 Long_Coup_dt6.mtx 361.895000 4 5 3 0 4669152869610276719
154751 16 Long_Coup_dt6.mtx 345.075000 4 5 4 0 4669152869610276719
154752 16 Long_Coup_dt6.mtx 499.504000 4 7 0 0 4669152869610276719
154753 16 Long_Coup_dt6.mtx 286.282000 4 7 1 1 4669152869610276719
154754 16 Long_Coup_dt6.mtx 690.989000 4 7 2 0 4669152869610276719
154755 16 Long_Coup_dt6.mtx 704.186000 4 7 3 0 4669152869610276719
154756 16 Long_Coup_dt6.mtx 678.474000 4 7 4 0 4669152869610276719
154757 16 Long_Coup_dt6.mtx 1534.040000 4 8 0 0 4669152869610276719
154758 16 Long_Coup_dt6.mtx 1527.980000 4 8 1 0 4669152869610276719
154759 16 Long_Coup_dt6.mtx 1369.830000 4 8 2 0 4669152869610276719

888388 rows × 8 columns


In [4]:
systems_info = pd.read_csv('../systems_info/systems_info.csv')
systems_info.system_id = systems_info.system_id.astype(int)
systems_info = systems_info.drop(labels=['system'], axis=1)
systems_info


Out[4]:
system_id HPL_Tflops StarDGEMM_Gflops SingleDGEMM_Gflops PTRANS_GBs MPIRandomAccess_LCG_GUPs MPIRandomAccess_GUPs StarRandomAccess_LCG_GUPs SingleRandomAccess_LCG_GUPs StarRandomAccess_GUPs ... MemProc core_count cpu_freq bogo_mips l1_cache l2_cache l3_cache memory_size memory_freq memory_type
0 1 0.215951 19.8070 33.0807 3.572530 0.068807 0.070039 0.012859 0.062631 0.012878 ... 1024 28 2300 4604.72 32 256 35840 128 2133 4
1 2 0.376918 18.4259 21.2062 4.021470 0.064392 0.063713 0.033345 0.064879 0.033404 ... 512 24 2500 4988.09 32 256 30720 128 2133 4
2 4 0.294586 21.5235 23.0727 4.715230 0.049452 0.057151 0.022889 0.037296 0.023092 ... 1024 16 2700 5399.28 32 256 20480 32 1600 3
3 3 0.532640 28.3834 34.2565 10.894900 0.098583 0.097365 0.033419 0.071782 0.033502 ... 1024 24 2500 4992.81 32 256 30720 128 2133 4
4 5 0.035807 11.0092 15.5630 0.850288 0.004999 0.005397 0.026699 0.060432 0.022879 ... 1024 4 2200 4389.76 32 256 3072 8 1600 3

5 rows × 42 columns


In [15]:
pts = pd.merge(properties, combined_times, on='matrix_id')
pts = pd.merge(systems_info, pts, on='system_id')
pts = pts.dropna()

pts = pts.drop(
        labels=['matrix_y', 'matrix_x'], axis=1)
pts.to_csv('./pts.csv')

In [6]:
# Makes label for error
lbl_error = []
i = 0
for row in pts.itertuples():
    if getattr(row, "status_id") == -1:
        lbl_error.append(1)
    else:
        lbl_error.append(0)
lbl_error


Out[6]:
[0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1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,
 1,
 1,
 0,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 ...]

In [7]:
df = pd.DataFrame(lbl_error)
df.to_csv('lbl_error.csv')

In [8]:
sum(lbl_error)


Out[8]:
357726

In [9]:
# Makes label for convergence
lbl_converged = []
i = 0
for row in pts.itertuples():
    if getattr(row, "status_id") == 1:
        lbl_converged.append(1)
    else:
        lbl_converged.append(0)
lbl_converged


Out[9]:
[1,
 1,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 1,
 0,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 1,
 1,
 1,
 1,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 1,
 0,
 1,
 1,
 1,
 0,
 1,
 1,
 1,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 1,
 0,
 1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,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 1,
 1,
 0,
 1,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 0,
 ...]

In [10]:
df = pd.DataFrame(lbl_converged)
df.to_csv('lbl_converged.csv')

In [11]:
sum(lbl_converged)


Out[11]:
178625

In [12]:
grouped = pts.groupby(['matrix_id', 'system_id', 'np','status_id'])
best_times = grouped['time'].aggregate(np.min)
best_times


Out[12]:
matrix_id             system_id  np  status_id
-9220398378778986880  1          1   -1           0.000000
                                      0           0.001208
                                      1           0.003747
                                 4   -1           0.000000
                                      0           0.001924
                                      1           0.003638
                                 8   -1           0.000000
                                      0           0.003103
                                      1           0.003491
                                 12  -1           0.000000
                                      0           0.001993
                                      1           0.002882
                                 16  -1           0.000000
                                      0           0.002217
                                      1           0.002161
                                 20  -1           0.000000
                                      0           0.002137
                                      1           0.001936
                                 24  -1           0.000000
                                      0           0.001817
                                      1           0.002501
                                 28  -1           0.000000
                                      0           0.002242
                                      1           0.002258
                      2          1   -1           0.000000
                                      0           0.001496
                                      1           0.003189
                                 4   -1           0.000000
                                      0           0.001669
                                      1           0.003030
                                                    ...   
 9178332285683709663  3          4    1           0.035270
                                 8   -1           0.000000
                                      0           0.016036
                                 12  -1           0.000000
                                      0           0.028514
                                      1           0.022753
                                 16  -1           0.000000
                                      0           0.029460
                                      1           0.023905
                                 20  -1           0.000000
                                      0           0.042022
                                      1           0.003153
                                 24  -1           0.000000
                                      0           0.023668
                                      1           0.025705
                      4          1   -1           0.000000
                                      0           0.049797
                                      1           0.089729
                                 4   -1           0.000000
                                      0           0.033262
                                      1           0.039500
                                 8   -1           0.000000
                                      0           0.019256
                                      1           0.026732
                                 12  -1           0.000000
                                      0           0.018739
                                      1           0.023621
                                 16  -1           0.000000
                                      0           0.019606
                                      1           0.034243
Name: time, dtype: float64

In [ ]:
# Finds the best times for each specific combination of np and sys
lbl_best_at_specific_sys_and_np = []
i = 0
for row in pts.itertuples():
    cur_matrix_id = getattr(row, 'matrix_id')
    cur_system_id = getattr(row, 'system_id')
    cur_np = getattr(row, 'np')
    cur_status_id = getattr(row, 'status_id')
    try:
        if best_times[cur_matrix_id][cur_system_id][cur_np][1] == getattr(row, 'time'):
            lbl_best_at_specific_sys_and_np.append(1)
        else:
            lbl_best_at_specific_sys_and_np.append(0)
    except KeyError:
        lbl_best_at_specific_sys_and_np.append(0)

lbl_best_at_specific_sys_and_np

In [ ]:
df = pd.DataFrame(lbl_best_at_specific_sys_and_np)
df.to_csv('lbl_best_at_specific_sys_and_np.csv')

In [ ]:
np.sum(lbl_best_at_specific_sys_and_np)

In [ ]:
grouped = pts.groupby(['matrix_id', 'np','status_id'])
best_times = grouped['time'].aggregate(np.min)
best_times

In [ ]:
# Finds the best times for each specific np, regardless of system
lbl_best_at_specific_np = []
i = 0
for row in pts.itertuples():
    cur_matrix_id = getattr(row, 'matrix_id')
    cur_np = getattr(row, 'np')
    cur_status_id = getattr(row, 'status_id')
    try:
        if best_times[cur_matrix_id][cur_np][1] == getattr(row, 'time'):
            lbl_best_at_specific_np.append(1)
        else:
            lbl_best_at_specific_np.append(0)
    except KeyError:
        lbl_best_at_specific_np.append(0)

lbl_best_at_specific_np

In [ ]:
df = pd.DataFrame(lbl_best_at_specific_np)
df.to_csv('lbl_best_at_specific_np.csv')

In [ ]:
np.sum(lbl_best_at_specific_np)

In [ ]:
pts.count

In [ ]:
grouped = pts.groupby(['matrix_id', 'system_id','status_id'])
best_times = grouped['time'].aggregate(np.min)
best_times.count

In [ ]:
# Finds the best times for each specific system, regardless of np
lbl_best_at_specific_sys = []
i = 0
for row in pts.itertuples():
    cur_matrix_id = getattr(row, 'matrix_id')
    cur_sys = getattr(row, 'system_id')
    cur_status_id = getattr(row, 'status_id')
    try:
        if best_times[cur_matrix_id][cur_sys][1] == getattr(row, 'time'):
            lbl_best_at_specific_sys.append(1)
        else:
            lbl_best_at_specific_sys.append(0)
    except KeyError:
        lbl_best_at_specific_sys.append(0)

lbl_best_at_specific_sys

In [ ]:
df = pd.DataFrame(lbl_best_at_specific_sys)
df.to_csv('lbl_best_at_specific_sys.csv')

In [ ]:
sum(lbl_best_at_specific_sys)

In [ ]:
grouped = pts.groupby(['matrix_id', 'status_id'])
best_times = grouped['time'].aggregate(np.min)
best_times.count

In [ ]:
# Finds the best overall
lbl_best_overall = []
i = 0
for row in pts.itertuples():
    cur_matrix_id = getattr(row, 'matrix_id')
    try:
        if best_times[cur_matrix_id][1] == getattr(row, 'time'):
            lbl_best_overall.append(1)
        else:
            lbl_best_overall.append(0)
    except KeyError:
        lbl_best_overall.append(0)

lbl_best_overall

In [ ]:
sum(lbl_best_overall)

In [ ]:
df = pd.DataFrame(lbl_best_overall)
df.to_csv('lbl_best_overall.csv')

In [ ]:
all_labels = pd.read_csv('./labels.csv', index_col=0)

In [ ]:
all_labels_array = all_labels.as_matrix()
all_labels_array

In [ ]:
pts = pts.drop(['matrix_x', 'matrix_y', 'status_id', 'system_id', 'time'], axis=1)

In [ ]:
X = pts.as_matrix()
y = all_labels_array

In [ ]:
X[1]

In [ ]:
y[1]

In [ ]:
all_labels

In [ ]:
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.model_selection import StratifiedShuffleSplit

In [ ]:
from sklearn.externals import joblib
classifier = OneVsRestClassifier(LinearSVC(), n_jobs=6)
classifier = classifier.fit(X,y)
joblib.dump(classifier, 'classifier.pkl')

In [ ]:
classifier = Pipeline([('clf', OneVsRestClassifier(LinearSVC(), n_jobs=6))])
sss = StratifiedShuffleSplit(n_splits=3, random_state=0)
i = 0
for train_index, test_index in sss.split(X, y):
    X_train, X_test = X[train_index], X[test_index]
    y_train, y_test = y[train_index], y[test_index]
    classifier.fit(X_train, y_train)
    joblib.dump(classifier, 'classifier-' + str(i) + '.pkl')
    i+=1

In [ ]:
pts.to_csv('./pts.csv')