@recipe function f(mach::MLJBase.Machine{<:EitherTunedModel})
    r = report(mach).plotting
    z = r.measurements
    x = r.parameter_values[:,1]
    y = r.parameter_values[:,2]

    r.parameter_scales[1] == :none &&
        (x = string.(x))

    r.parameter_scales[2] == :none &&
        (y = string.(y))

    xsc, ysc = r.parameter_scales

    xguide --> r.parameter_names[1]
    yguide --> r.parameter_names[2]
    xscale --> (xsc in [:custom, :linear] ? :identity : xsc)
    yscale --> (ysc in [:custom, :linear] ? :identity : ysc)

    st = get(plotattributes, :seriestype, :scatter)

    if st ∈ (:surface, :heatmap, :contour, :contourf, :wireframe)
        ux = unique(x)
        uy = unique(y)
        m = reshape(z, (length(ux), length(uy)))'
        ux, uy, m
    else
        label --> ""
        seriestype := st
        ms = get(plotattributes, :markersize, 4)
        markersize := _getmarkersize(ms, z)
        marker_z --> z
        x, y
    end
end

function _getmarkersize(ms, z)
    ret = sqrt.(z)
    minz, maxz = extrema(x for x in ret if isfinite(x))
    ret .-= minz
    ret ./= maxz - minz
    4ms .* ret .+ 1
end
