Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alan-turing-institute / MLJTuning.jl / 78

11 Mar 2020 - 4:26 coverage: 80.455% (-3.2%) from 83.613%
78

Pull #19

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
bump to 0.2.0 and bump [compat] MLJBase = "^0.12"
Pull Request #19: Update to MLJBase 0.12.0

177 of 220 relevant lines covered (80.45%)

205.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/tuning_strategy_interface.jl
1
abstract type TuningStrategy <: MLJBase.MLJType end
2
MLJBase.show_as_constructed(::Type{<:TuningStrategy}) = true
!
3

4
# for initialization of state (compulsory)
UNCOV
5
setup(tuning::TuningStrategy, model, range, verbosity) = range
!
6

7
# for building each element of the history:
8
result(tuning::TuningStrategy, history, e) =
2,770×
9
    (measure=e.measure, measurement=e.measurement)
10

11
# for generating batches of new models and updating the state (but not
12
# history):
13
function models! end
14

15
# for extracting the optimal model (and its performance) from the
16
# history:
17
function best(tuning::TuningStrategy, history)
18
   measurements = [h[2].measurement[1] for h in history]
369×
19
   measure = first(history)[2].measure[1]
20
   if orientation(measure) == :score
147×
21
       measurements = -measurements
22
   end
23
   best_index = argmin(measurements)
1,152×
24
   return history[best_index]
123×
25
end
26

27
# for selecting what to report to the user apart from the optimal
28
# model:
29
tuning_report(tuning::TuningStrategy, history, state) = (history=history,)
64×
30

31
# for declaring the default number of models to evaluate:
32
default_n(tuning::TuningStrategy, range) = 10
!
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2023 Coveralls, Inc