Skip to content

Commit

Permalink
Merge pull request #951 from MilesCranmer/plotting
Browse files Browse the repository at this point in the history
Forward `(::Machine).fitresult` to RecipesBase
  • Loading branch information
ablaom authored Jan 9, 2024
2 parents 081fec8 + ad03525 commit 6e3e285
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Expand Down Expand Up @@ -52,6 +53,7 @@ OrderedCollections = "1.1"
Parameters = "0.12"
PrettyTables = "1, 2"
ProgressMeter = "1.7.1"
RecipesBase = "1"
Reexport = "1.2"
ScientificTypes = "3"
StatisticalMeasures = "0.1.1"
Expand Down
5 changes: 5 additions & 0 deletions src/MLJBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ const Dist = Distributions
# Measures
import StatisticalMeasuresBase

# Plots
using RecipesBase: RecipesBase, @recipe

# from Standard Library:
using Statistics, LinearAlgebra, Random, InteractiveUtils

Expand Down Expand Up @@ -172,6 +175,8 @@ include("data/datasets_synthetic.jl")

include("default_measures.jl")

include("plots.jl")

include("composition/models/stacking.jl")

const EXTENDED_ABSTRACT_MODEL_TYPES = vcat(
Expand Down
5 changes: 5 additions & 0 deletions src/plots.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@recipe function default_machine_plot(mach::Machine)
# Allow downstream packages to define plotting recipes
# for their own machine types.
mach.fitresult
end

0 comments on commit 6e3e285

Please sign in to comment.