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

  1. 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.

  2. 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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -