We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 922fc4c commit 33559daCopy full SHA for 33559da
examples/ml_benchmarks.py
@@ -14,8 +14,10 @@
14
15
import random
16
import time
17
+from collections.abc import Callable
18
from dataclasses import dataclass
19
from statistics import mean
20
+from typing import Any
21
22
from machine_learning.gaussian_naive_bayes import GaussianNaiveBayes
23
from machine_learning.gradient_boosting_regressor import GradientBoostingRegressor
@@ -31,7 +33,7 @@ class TimingResult:
31
33
predict_seconds: float
32
34
35
-def _time_call(callable_obj) -> float:
36
+def _time_call(callable_obj: Callable[[], Any]) -> float:
37
start = time.perf_counter()
38
callable_obj()
39
return time.perf_counter() - start
@@ -159,4 +161,4 @@ def main() -> None:
159
161
160
162
163
if __name__ == "__main__":
- main()
164
+ main()
0 commit comments