Skip to content

Instantly share code, notes, and snippets.

@glemaitre
Last active February 7, 2017 22:31
Show Gist options
  • Save glemaitre/0f4a555df28169f477a3628c086a41dc to your computer and use it in GitHub Desktop.
Save glemaitre/0f4a555df28169f477a3628c086a41dc to your computer and use it in GitHub Desktop.

Test script

from __future__ import division, print_function                                                 
                                                                                                
import platform                                                                                 
import sys                                                                                      
                                                                                                
from time import time                                                                           
                                                                                                
import numpy                                                                                    
import scipy                                                                                    
                                                                                                
import sklearn                                                                                  
from sklearn.datasets import fetch_covtype                                                      
from sklearn.ensemble import RandomForestClassifier                                             
                                                                                                
print(platform.platform())                                                                      
print("Python", sys.version)                                                                    
print("NumPy", numpy.__version__)                                                               
print("SciPy", scipy.__version__)                                                               
print("Scikit-Learn", sklearn.__version__)                                                      
                                                                                                
RND_SEED = 42                                                                                   
                                                                                                
# fetch data                                                                                    
data = fetch_covtype()                                                                          
                                                                                                
# create a random forest instance                                                               
clf = RandomForestClassifier(n_estimators=100, max_depth=10)                                    
                                                                                                
start = time()                                                                                  
clf.fit(data.data, data.target)                                                                 
end = time() - start                                                                            
                                                                                                
print('Time to fit {}'.format(end))

run #1

Linux-3.19.0-80-generic-x86_64-with-debian-jessie-sid
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
NumPy 1.11.2
SciPy 0.18.1
Cython 0.25.2
Scikit-Learn 0.17.1
No handlers could be found for logger "root"
Time to fit 79.1812839508 s

run #2

Linux-3.19.0-80-generic-x86_64-with-debian-jessie-sid
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
NumPy 1.11.2
SciPy 0.18.1
Scikit-Learn 0.18.1
Time to fit 73.2800579071 s

run #3

Linux-3.19.0-80-generic-x86_64-with-debian-jessie-sid
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
NumPy 1.8.2
SciPy 0.13.3
Cython 0.20.1
Scikit-Learn 0.17.1
Time to fit 79.2866439819 s

run #4

Linux-3.19.0-80-generic-x86_64-with-debian-jessie-sid
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
NumPy 1.8.2
SciPy 0.13.3
Cython 0.20.1
Scikit-Learn 0.18.1
Time to fit 75.6733729839 s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment