-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP + RFC. Add simple plotting recipe. Fix #85 #99
Conversation
A simple recipe for plotting. Right now it's the default plot for tuned models, that can be changed if that is not desired. It uses colored scatter points. There's an option for using heatmap also, but that currently behaves strangely for log scales. That seems to be a bug in Plots though, I think the recipe here is fine. Using the plot(tuned_ensemble) The heatmap version (you can also use heatmap(tuned_model) |
This looks super. I'm having some problems though. Any ideas? I'm using Plots.jl v0.23.1 julia> using Plots
julia> Plots.backend()
Plots.GRBackend()
julia> include("examples/two_parameter_tune.jl")
julia> tuned_ensemble isa MLJ.Machine{<:MLJ.EitherTunedModel}
true
julia> plot(tuned_ensemble)
ERROR: No user recipe defined for Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] convertToAnyVector(::Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}, ::Dict{Symbol,Any}) at /Users/anthony/.julia/packages/Plots/gylTh/src/series.jl:14
[3] macro expansion at /Users/anthony/.julia/packages/Plots/gylTh/src/series.jl:139 [inlined]
[4] apply_recipe(::Dict{Symbol,Any}, ::Type{Plots.SliceIt}, ::Nothing, ::Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}, ::Nothing) at /Users/anthony/.julia/packages/RecipesBase/Uz5AO/src/RecipesBase.jl:275
[5] _process_userrecipes(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}}) at /Users/anthony/.julia/packages/Plots/gylTh/src/pipeline.jl:83
[6] _plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}}) at /Users/anthony/.julia/packages/Plots/gylTh/src/plot.jl:178
[7] #plot#136(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}) at /Users/anthony/.julia/packages/Plots/gylTh/src/plot.jl:57
[8] plot(::Machine{MLJ.DeterministicTunedModel{Grid,DeterministicEnsembleModel{Tuple{Array{Float64,2},Array{Float64,1}},KNNRegressor{Float64}}}}) at /Users/anthony/.julia/packages/Plots/gylTh/src/plot.jl:51
[9] top-level scope at none:0
julia> versioninfo()
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU: Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)
Environment:
JULIA_PATH = /Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia
Edit Maybe add above code as test and see if Travis also dies? |
Sure I've added the suggested test, though this adds Plots as a testing dependency. |
Seems to work for Travis. |
Yes, my mistake. In a recent rebuild of my working env I had done I'd like to pull this before adding a 1-parameter version (there was some discussion of adding uncertainty estimates in this case). @mkborregaard Could you please:
@fkiraly Are you happy for me to pull this? |
I can - just to make sure, the test doesn't add Plots as a dependency, just as a test dependency. But you'd still like me to remove it again? |
Yes, let's leave it out for now thanks. |
512271b
to
520ace2
Compare
add plot recipe Revert "add dep on RecipesBase" This reverts commit 4a08062. clean up manifest add test revert add test
520ace2
to
977f4c3
Compare
No description provided.