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

alan-turing-institute / MLJTuning.jl / 118

3 Apr 2020 - 2:24 coverage: 85.424% (+2.0%) from 83.404%
118

Pull #30

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
more doc tweaks
Pull Request #30: Implement RandomSearch

56 of 58 new or added lines in 3 files covered. (96.55%)

4 existing lines in 3 files now uncovered.

252 of 295 relevant lines covered (85.42%)

985.97 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) =
5,314×
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]
195×
24
   measure = first(history)[2].measure[1]
25
   if orientation(measure) == :score
77×
26
       measurements = -measurements
27
   end
28
   best_index = argmin(measurements)
1,428×
29
   return history[best_index]
65×
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,)
40×
35

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