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

alan-turing-institute / MLJTuning.jl / 340

6 Aug 2020 - 23:53 coverage: 89.082%. Remained the same
340

Pull #67

travis-ci-com

web-flow
Merge c2874fbfd into bf3807365
Pull Request #67: Fix plot warning for custom scale

0 of 2 new or added lines in 1 file covered. (0.0%)

359 of 403 relevant lines covered (89.08%)

821.66 hits per line

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

0.0
/src/plotrecipes.jl
1
@recipe function f(mach::MLJBase.Machine{<:EitherTunedModel})
2
    r = report(mach).plotting
!
3
    z = r.measurements
!
4
    x = r.parameter_values[:,1]
!
5
    y = r.parameter_values[:,2]
!
6

7
    r.parameter_scales[1] == :none &&
!
8
        (x = string.(x))
9

10
    r.parameter_scales[2] == :none &&
!
11
        (y = string.(y))
12

13
    xsc, ysc = r.parameter_scales
!
14

15
    xguide --> r.parameter_names[1]
!
16
    yguide --> r.parameter_names[2]
!
NEW
17
    xscale --> (xsc in [:custom, :linear] ? :identity : xsc)
!
NEW
18
    yscale --> (ysc in [:custom, :linear] ? :identity : ysc)
!
19

20
    st = get(plotattributes, :seriestype, :scatter)
!
21

22
    if st ��� (:surface, :heatmap, :contour, :contourf, :wireframe)
!
23
        ux = unique(x)
!
24
        uy = unique(y)
!
25
        m = reshape(z, (length(ux), length(uy)))'
!
26
        ux, uy, m
!
27
    else
28
        label --> ""
!
29
        seriestype := st
!
30
        ms = get(plotattributes, :markersize, 4)
!
31
        markersize := _getmarkersize(ms, z)
!
32
        marker_z --> z
!
33
        x, y
!
34
    end
35
end
36

37
function _getmarkersize(ms, z)
38
    ret = sqrt.(z)
!
39
    minz, maxz = extrema(x for x in ret if isfinite(x))
!
40
    ret .-= minz
!
41
    ret ./= maxz - minz
!
42
    4ms .* ret .+ 1
!
43
end
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