python - How can I speed up my program created in Jupyter Notebook? -
i have python program created in jupter notebook. due datasize , optimization algo used, 4-fold custom cross validation within range takes 30 minutes finish.
my computer's environment: cpu i5 3.3 ghz, 8 gb ddr3 ram, ssd.
i'm wondering
if possible deploy server , may make speed little bit quicker? (the data file 30mb, think possible both upload data , program). , may others want use program.
can speed cross validation? it's kind manual process. use
sklearn.cross_validation.kfold
extract train , test set. loop through each fold build model , test result. i'm not sure if possible encapsulate model building method , perform cross validation in parrallel?
1: there couple paid hpc servers such amazon, off topic so.
2: iteration of cross validation can done in parallel.
as cross validations not connected, suggest this:
import multiprocessing def validation_function(args): do_validation ... ... p = multiprocessing.pool(processes=multiprocessing.cpu_count()) _ in p.imap_unordered(validation_function, args): pass
Comments
Post a Comment