File tree Expand file tree Collapse file tree 4 files changed +4
-14
lines changed Expand file tree Collapse file tree 4 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 7
7
from datetime import datetime
8
8
import numpy as np
9
9
from sklearn import linear_model
10
- from sklearn .utils .bench import total_seconds
11
10
12
11
13
12
if __name__ == '__main__' :
34
33
start = datetime .now ()
35
34
ridge = linear_model .Ridge (alpha = 1. )
36
35
ridge .fit (X , Y )
37
- time_ridge [i ] = total_seconds (datetime .now () - start )
36
+ time_ridge [i ] = (datetime .now () - start ). total_seconds ( )
38
37
39
38
start = datetime .now ()
40
39
ols = linear_model .LinearRegression ()
41
40
ols .fit (X , Y )
42
- time_ols [i ] = total_seconds (datetime .now () - start )
41
+ time_ols [i ] = (datetime .now () - start ). total_seconds ( )
43
42
44
43
start = datetime .now ()
45
44
lasso = linear_model .LassoLars ()
46
45
lasso .fit (X , Y )
47
- time_lasso [i ] = total_seconds (datetime .now () - start )
46
+ time_lasso [i ] = (datetime .now () - start ). total_seconds ( )
48
47
49
48
plt .figure ('scikit-learn GLM benchmark results' )
50
49
plt .xlabel ('Dimensions' )
Original file line number Diff line number Diff line change 16
16
import gc
17
17
from datetime import datetime
18
18
from sklearn .isotonic import isotonic_regression
19
- from sklearn .utils .bench import total_seconds
20
19
from scipy .special import expit
21
20
import matplotlib .pyplot as plt
22
21
import argparse
@@ -55,8 +54,7 @@ def bench_isotonic_regression(Y):
55
54
56
55
tstart = datetime .now ()
57
56
isotonic_regression (Y )
58
- delta = datetime .now () - tstart
59
- return total_seconds (delta )
57
+ return (datetime .now () - tstart ).total_seconds ()
60
58
61
59
62
60
if __name__ == '__main__' :
Original file line number Diff line number Diff line change @@ -173,12 +173,6 @@ Graph Routines
173
173
connectivity matrix is a ``scipy.sparse.csr_matrix ``.
174
174
175
175
176
- Benchmarking
177
- ------------
178
-
179
- - :func: `bench.total_seconds `: Used in ``benchmarks/bench_glm.py ``.
180
-
181
-
182
176
Testing Functions
183
177
=================
184
178
Original file line number Diff line number Diff line change @@ -1429,7 +1429,6 @@ Low-level methods
1429
1429
utils.arrayfuncs.min_pos
1430
1430
utils.as_float_array
1431
1431
utils.assert_all_finite
1432
- utils.bench.total_seconds
1433
1432
utils.check_X_y
1434
1433
utils.check_array
1435
1434
utils.check_consistent_length
You can’t perform that action at this time.
0 commit comments