• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alan-turing-institute / MLJTuning.jl / 325

19 Jul 2020 - 23:25 coverage: 89.082% (+1.3%) from 87.744%
325

Pull #62

travis-ci-com

web-flow
Merge c5a9aa22e into 284c50c01
Pull Request #62: Allow specification rows=... in learning curve()

20 of 20 new or added lines in 1 file covered. (100.0%)

4 existing lines in 3 files now uncovered.

359 of 403 relevant lines covered (89.08%)

821.93 hits per line

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

77.78
/src/tuning_strategy_interface.jl
1
## TYPES TO BE SUBTYPED
2

3
abstract type TuningStrategy <: MLJBase.MLJType end
4
MLJBase.show_as_constructed(::Type{<:TuningStrategy}) = true
!
5

6

7
## METHODS TO BE IMPLEMENTED
8

9
# for initialization of state (compulsory)
UNCOV
10
setup(tuning::TuningStrategy, model, range, verbosity) = range
!
11

12
# for building each element of the history:
13
result(tuning::TuningStrategy, history, state, e, metadata) =
7,161×
14
    (measure=e.measure, measurement=e.measurement)
15

16
# for generating batches of new models and updating the state (but not
17
# history):
18
function models! end
19

20
# for extracting the optimal model (and its performance) from the
21
# history:
22
function best(tuning::TuningStrategy, history)
23
   measurements = [h[2].measurement[1] for h in history]
567×
24
   measure = first(history)[2].measure[1]
25
   if orientation(measure) == :score
87×
26
       measurements = -measurements
27
   end
28
   best_index = argmin(measurements)
2,384×
29
   return history[best_index]
189×
30
end
31

32
# for selecting what to report to the user apart from the optimal
33
# model:
34
tuning_report(tuning::TuningStrategy, history, state) = (history=history,)
56×
35

36
# for declaring the default number of models to evaluate:
37
default_n(tuning::TuningStrategy, range) = DEFAULT_N
9×
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