Guest User

Untitled

a guest
Apr 14th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.67 KB | None | 0 0
  1. normal fitting:
  2.  
  3.     Line #    Mem usage    Increment   Line Contents
  4.     ================================================
  5.     17   28.004 MiB    0.000 MiB   @profile
  6.     18                             def normal_fit():
  7.     19   28.777 MiB    0.773 MiB    X = random.random((1000,100))
  8.     20   28.781 MiB    0.004 MiB    Y = random.random(1000) < 0.5
  9.     21   28.785 MiB    0.004 MiB    rfc = RFC(n_estimators=100,n_jobs=1)
  10.     22   28.785 MiB    0.000 MiB    rfc.n_classes_ = 2
  11.     23   28.785 MiB    0.000 MiB    rfc.classes_ = array([False, True],dtype=bool)
  12.     24   28.785 MiB    0.000 MiB    rfc.n_outputs_ = 1
  13.     25   28.785 MiB    0.000 MiB    rfc.n_features_ = 100
  14.     26   28.785 MiB    0.000 MiB    rfc.bootstrap = False
  15.     27   37.668 MiB    8.883 MiB    rfc.fit(X,Y)
  16.  
  17. custom fitting:
  18.  
  19.     Line #    Mem usage    Increment   Line Contents
  20.     ================================================
  21.      4   28.004 MiB    0.000 MiB   @profile
  22.      5                             def custom_fit():
  23.      6   28.777 MiB    0.773 MiB    X = random.random((1000,100))
  24.      7   28.781 MiB    0.004 MiB    Y = random.random(1000) < 0.5
  25.      8   28.785 MiB    0.004 MiB    rfc = RFC(n_estimators=100,n_jobs=1)
  26.      9   28.785 MiB    0.000 MiB    rfc.n_classes_ = 2
  27.     10   28.785 MiB    0.000 MiB    rfc.classes_ = array([False, True],dtype=bool)
  28.     11   28.785 MiB    0.000 MiB    rfc.n_outputs_ = 1
  29.     12   28.785 MiB    0.000 MiB    rfc.n_features_ = 100
  30.     13   73.266 MiB   44.480 MiB    for i in range(rfc.n_estimators):
  31.     14   72.820 MiB   -0.445 MiB        rfc._make_estimator()
  32.     15   73.262 MiB    0.441 MiB        rfc.estimators_[-1].fit(X,Y,check_input=False)
Advertisement
Add Comment
Please, Sign In to add comment