8000 MAINT Removes total_seconds completely in benchmarks (#12969) · baluyotraf/scikit-learn@a7b8b9e · GitHub
[go: up one dir, main page]

Skip to content

Commit a7b8b9e

Browse files
thomasjpfanrth
authored andcommitted
MAINT Removes total_seconds completely in benchmarks (scikit-learn#12969)
1 parent 98baafb commit a7b8b9e

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

benchmarks/bench_glm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from datetime import datetime
88
import numpy as np
99
from sklearn import linear_model
10-
from sklearn.utils.bench import total_seconds
1110

1211

1312
if __name__ == '__main__':
@@ -34,17 +33,17 @@
3433
start = datetime.now()
3534
ridge = linear_model.Ridge(alpha=1.)
3635
ridge.fit(X, Y)
37-
time_ridge[i] = total_seconds(datetime.now() - start)
36+
time_ridge[i] = (datetime.now() - start).total_seconds()
3837

3938
start = datetime.now()
4039
ols = linear_model.LinearRegression()
4140
ols.fit(X, Y)
42-
time_ols[i] = total_seconds(datetime.now() - start)
41+
time_ols[i] = (datetime.now() - start).total_seconds()
4342

4443
start = datetime.now()
4544
lasso = linear_model.LassoLars()
4645
lasso.fit(X, Y)
47-
time_lasso[i] = total_seconds(datetime.now() - start)
46+
time_lasso[i] = (datetime.now() - start).total_seconds()
4847

4948
plt.figure('scikit-learn GLM benchmark results')
5049
plt.xlabel('Dimensions')

benchmarks/bench_isotonic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import gc
1717
from datetime import datetime
1818
from sklearn.isotonic import isotonic_regression
19-
from sklearn.utils.bench import total_seconds
2019
from scipy.special import expit
2120
import matplotlib.pyplot as plt
2221
import argparse
@@ -55,8 +54,7 @@ def bench_isotonic_regression(Y):
5554

5655
tstart = datetime.now()
5756
isotonic_regression(Y)
58-
delta = datetime.now() - tstart
59-
return total_seconds(delta)
57+
return (datetime.now() - tstart).total_seconds()
6058

6159

6260
if __name__ == '__main__':

doc/developers/utilities.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ Graph Routines
173173
connectivity matrix is a ``scipy.sparse.csr_matrix``.
174174

175175

176-
Benchmarking
177-
------------
178-
179-
- :func:`bench.total_seconds`: Used in ``benchmarks/bench_glm.py``.
180-
181-
182176
Testing Functions
183177
=================
184178

doc/modules/classes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,6 @@ Low-level methods
14291429
utils.arrayfuncs.min_pos
14301430
utils.as_float_array
14311431
utils.assert_all_finite
1432-
utils.bench.total_seconds
14331432
utils.check_X_y
14341433
utils.check_array
14351434
utils.check_consistent_length

0 commit comments

Comments
 (0)
0