Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error when Plotting: Cannot convert LaplaceRedux.Laplace to series data for plotting #61

Open
patrickm663 opened this issue Sep 21, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@patrickm663
Copy link

patrickm663 commented Sep 21, 2023

Hi

I am running into an issue when getting to the plotting section of the MLP regression tutorial.

I had originally run into the error on my own example, but I still face it when following the tutorial. The fitting and optimisation step runs without error!

Below is my environment (Pluto notebook; Julia 1.9.3):

Status `/tmp/jl_HCANJ7/Project.toml`
  [587475ba] Flux v0.14.6
  [c52c1a26] LaplaceRedux v0.1.3
  [91a5bcdd] Plots v1.39.0
  [44cfe95a] Pkg v1.9.2
  [10745b16] Statistics v1.9.0

For clarification, below is the code:

begin
	subset_w = :all
	la = Laplace(nn; likelihood=:regression, subset_of_weights=subset_w)
	fit!(la, data)
	plot(la, X, y; zoom=-5, size=(400,400))
end

And below is the full error:

Cannot convert LaplaceRedux.Laplace to series data for plotting

    error(::String)@error.jl:35
    _prepare_series_data(::LaplaceRedux.Laplace)@series.jl:8
    _series_data_vector(::LaplaceRedux.Laplace, ::Dict{Symbol, Any})@series.jl:36
    macro expansion@series.jl:128[inlined]
    apply_recipe(::AbstractDict{Symbol, Any}, ::Type{RecipesPipeline.SliceIt}, ::Any, ::Any, ::Any)@RecipesBase.jl:300
    _process_userrecipes!(::Any, ::Any, ::Any)@user_recipe.jl:38
    recipe_pipeline!(::Any, ::Any, ::Any)@RecipesPipeline.jl:72
    _plot!(::Plots.Plot, ::Any, ::Any)@plot.jl:223
    #plot#188@plot.jl:102[inlined]
    plot@plot.jl:93[inlined]
    top-level scope@[Local: 5](http://localhost:1234/edit?id=0e0472c4-5887-11ee-1f75-2fc9822473d3#)[inlined]

Thank you for any assistance.

Kind regards
Patrick

@pat-alt
Copy link
Member

pat-alt commented Sep 21, 2023

Hi @patrickm663, sorry about that, I haven't had time to update the docs.

I have recently started moving all plotting functionality of Taija packages into its own package to avoid depending on Plots: TaijaPlotting. The examples in the docs and README still work as long as you add this package to your environment and load it.

The following should fix the issue:

using Pkg; Pkg.add("TaijaPlotting")
using TaijaPlotting

Let me know if that works. In any case I'll keep this issue open as a reminder to update docs.

Thanks!

@pat-alt pat-alt added the documentation Improvements or additions to documentation label Sep 21, 2023
@patrickm663
Copy link
Author

Hi @pat-alt thanks for the prompt response! Using TaijaPlotting worked, thank you!

@pat-alt pat-alt mentioned this issue Nov 7, 2023
7 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants