Mercurial > hg > nsaunier > traffic-intelligence
comparison python/utils.py @ 671:849f5f8bf4b9
corrected other missing imports
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 26 May 2015 11:40:32 +0200 |
| parents | f72ed51c6b65 |
| children | 5473b7460375 |
comparison
equal
deleted
inserted
replaced
| 670:f72ed51c6b65 | 671:849f5f8bf4b9 |
|---|---|
| 442 def findBestModel(data, dependentVariable, independentVariables, regressionType = 'ols', nProcesses = 1): | 442 def findBestModel(data, dependentVariable, independentVariables, regressionType = 'ols', nProcesses = 1): |
| 443 '''Generates all possible model with the independentVariables | 443 '''Generates all possible model with the independentVariables |
| 444 and runs them, saving the results in experiments | 444 and runs them, saving the results in experiments |
| 445 with multiprocess option''' | 445 with multiprocess option''' |
| 446 from pandas import concat | 446 from pandas import concat |
| 447 from multiprocessing import Pool | |
| 447 experiments = generateExperiments(independentVariables) | 448 experiments = generateExperiments(independentVariables) |
| 448 nModels = len(experiments) | 449 nModels = len(experiments) |
| 449 print("Running {} models with {} processes".format(nModels, nProcesses)) | 450 print("Running {} models with {} processes".format(nModels, nProcesses)) |
| 450 if nProcesses == 1: | 451 if nProcesses == 1: |
| 451 return runModels(experiments, data, dependentVariable, independentVariables, regressionType) | 452 return runModels(experiments, data, dependentVariable, independentVariables, regressionType) |
