Skip to content

Commit

Permalink
Made some timing experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sm00thix committed Nov 9, 2023
1 parent a958567 commit e3a1115
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 1 deletion.
10 changes: 9 additions & 1 deletion time_pls.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
time = cross_val_cpu_pls(pls, X, Y, n_splits, fit_params, n_jobs=n_jobs, verbose=1)
print(f"Time: {time}")

try:
with open("timings/timings.csv", "x") as f:
f.write("model,n_components,n_splits,n,m,k,time\n")
f.write(f"{model},{n_components},{n_splits},{n},{m},{k},{time}\n")
except FileExistsError:
with open("timings/timings.csv", "a") as f:
f.write(f"{model},{n_components},{n_splits},{n},{m},{k},{time}\n")

# Freeze values:
# 1. n_components = 30
# 2. n_splits = {1, LOOCV} # The overhead of JIT-compilation is already negligible at 1e4 samples.
Expand All @@ -103,7 +111,7 @@
# 5. k = {1, 10}

# Dynamic values:
# 1. n_components = {10, 20, 50, 100, 200, 500, 1000}
# 1. n_components = {10, 20, 30, 50, 100, 200, 500, 1000}
# 1. n = {1e1, 1e2, 1e3, 1e4, 1e5, 1e6}
# 3. m = {20, 50, 100, 500, 1000, 5000, 10000}

Expand Down
118 changes: 118 additions & 0 deletions timings/timings.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
model,n_components,n_splits,n,m,k,time
sk,10,1,10000,500,1,0.19273439201060683
sk,10,10000,10000,500,1,481.8888097489835
sk,10,1,10000,500,10,0.6096877630043309
sk,10,10000,10000,500,10,3083.1409927269997
sk,20,1,10000,500,1,0.383961057000306
sk,30,1,10000,500,1,0.538925515000301
sk,50,1,10000,500,1,0.8993592769993484
sk,100,1,10000,500,1,1.7544596559991987
sk,200,1,10000,500,1,3.4300453200003176
sk,500,1,10000,500,1,8.231237813999542
sk,20,1,10000,500,10,1.2046825039997202
sk,30,1,10000,500,10,1.7152136909999172
sk,50,1,10000,500,10,2.5382029529991996
sk,100,1,10000,500,10,4.446280705999925
sk,200,1,10000,500,10,8.997756613000092
sk,500,1,10000,500,10,26.541843658999824
sk,30,1,10,500,1,0.0027361649999875226
sk,30,1,100,500,1,0.009425168000234407
sk,30,1,1000,500,1,0.049496089999593096
sk,30,1,10000,500,1,0.5260668050004824
sk,30,1,100000,500,1,4.879484715999752
sk,30,1,1000000,500,1,43.23828121799943
sk,30,1,10,500,10,0.005154452999704517
sk,30,1,100,500,10,0.04722639000010531
sk,30,1,1000,500,10,0.22319066199997906
sk,30,1,10000,500,10,1.568664624000121
sk,30,1,100000,500,10,59.655239371999414
sk,30,1,1000000,500,10,636.2466903430004
sk,30,1,10000,30,1,0.03232301800017012
sk,30,1,10000,50,1,0.05948806400010653
sk,30,1,10000,100,1,0.098399309999877
sk,30,1,10000,500,1,0.503990841999439
sk,30,1,10000,1000,1,1.0616326409999601
sk,30,1,10000,5000,1,4.715606132000175
sk,30,1,10000,10000,1,7.55188517500028
sk,30,1,10000,30,10,0.10395021400017868
sk,30,1,10000,50,10,0.31709428099929937
sk,30,1,10000,100,10,0.3963616490000277
sk,30,1,10000,500,10,1.6708524519999628
sk,30,1,10000,1000,10,10.25260551700012
sk,30,1,10000,5000,10,122.55457919299988
sk,30,1,10000,10000,10,291.9931363270007
np1,10,1,10000,500,1,0.02829229299823055
np1,20,1,10000,500,1,0.025495142999716336
np1,30,1,10000,500,1,0.03573968899945612
np1,50,1,10000,500,1,0.057505740001943195
np1,100,1,10000,500,1,0.11449231099686585
np1,200,1,10000,500,1,0.26500373399903765
np1,500,1,10000,500,1,1.077820430000429
np1,30,1,10,500,1,0.0035715200028789695
np1,30,1,100,500,1,0.006363390999467811
np1,30,1,1000,500,1,0.009307193002314307
np1,30,1,10000,500,1,0.03354567700080224
np1,30,1,100000,500,1,0.8221006140011013
np1,30,1,1000000,500,1,8.44086087300093
np1,30,1,10000,30,1,0.00863133999882848
np1,30,1,10000,50,1,0.012853928998083575
np1,30,1,10000,100,1,0.014647433999925852
np1,30,1,10000,500,1,0.0354511840014311
np1,30,1,10000,1000,1,0.10847483099860256
np1,30,1,10000,5000,1,0.7698168780007109
np1,30,1,10000,10000,1,1.5100300060003065
np1,10,1,10000,500,10,0.028714912001305493
np1,20,1,10000,500,10,0.028550800001539756
np1,30,1,10000,500,10,0.04005221999977948
np1,50,1,10000,500,10,0.05554433799989056
np1,100,1,10000,500,10,0.11898328399911406
np1,200,1,10000,500,10,0.2757587380001496
np1,500,1,10000,500,10,1.080385589000798
np1,30,1,10,500,10,0.004644275999453384
np1,30,1,100,500,10,0.008309045999340015
np1,30,1,1000,500,10,0.011847425997984828
np1,30,1,10000,500,10,0.03908856699854368
np1,30,1,100000,500,10,0.8213651980004215
np1,30,1,1000000,500,10,8.418709229001252
np1,30,1,10000,30,10,0.013260746000014478
np1,30,1,10000,50,10,0.02961625599709805
np1,30,1,10000,100,10,0.024874249000276905
np1,30,1,10000,500,10,0.03835980800067773
np1,30,1,10000,1000,10,0.11690236999857007
np1,30,1,10000,5000,10,0.7834515440008545
np1,30,1,10000,10000,10,1.5617745100025786
np2,10,1,10000,500,1,0.06693687100050738
jax1,10,1,10000,500,1,2.850088137998682
jax2,10,1,10000,500,1,2.4174978740011284
diffjax1,10,1,10000,500,1,2.488450716002262
diffjax2,10,1,10000,500,1,2.3965144389985653
np2,20,1,10000,500,1,0.07027839900183608
jax1,20,1,10000,500,1,3.256795921999583
jax2,20,1,10000,500,1,3.063774940001167
diffjax1,20,1,10000,500,1,3.2046105150002404
diffjax2,20,1,10000,500,1,3.0997328519988514
np2,30,1,10000,500,1,0.07769091299996944
jax1,30,1,10000,500,1,4.127460686999257
jax2,30,1,10000,500,1,3.8130472550001286
diffjax1,30,1,10000,500,1,4.099335901999439
diffjax2,30,1,10000,500,1,3.7981624040003226
np2,50,1,10000,500,1,0.07905295599994133
jax1,50,1,10000,500,1,5.888724919001106
jax2,50,1,10000,500,1,5.242987173998699
diffjax1,50,1,10000,500,1,5.947335015000135
diffjax2,50,1,10000,500,1,5.3286497320004855
np2,100,1,10000,500,1,0.10478619800051092
np2,200,1,10000,500,1,0.193939386997954
np2,500,1,10000,500,1,0.787515349999012
jax1,100,1,10000,500,1,11.4029962229979
jax1,200,1,10000,500,1,25.6140492409977
jax1,500,1,10000,500,1,108.06587946400032
jax2,100,1,10000,500,1,9.864700633999746
jax2,200,1,10000,500,1,21.71426913200048
jax2,500,1,10000,500,1,93.59749507300148
diffjax1,100,1,10000,500,1,11.364623696998024
diffjax1,200,1,10000,500,1,25.757944255998154
diffjax1,500,1,10000,500,1,110.90607149599964
diffjax2,100,1,10000,500,1,9.760836130000826
diffjax2,200,1,10000,500,1,21.620848131999082
diffjax2,500,1,10000,500,1,92.68657545600217

0 comments on commit e3a1115

Please sign in to comment.