Skip to content

Commit

Permalink
Merge pull request #556 from alan-turing-institute/suggest-predict-mode
Browse files Browse the repository at this point in the history
Fix error message for using deterministic measure with probabilistic model in `evaluate!`
  • Loading branch information
ablaom authored May 24, 2021
2 parents 96da79d + 1f664fd commit f04698b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJBase"
uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.18.6"
version = "0.18.7"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand Down
5 changes: 2 additions & 3 deletions src/resampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,10 @@ function _check_measure(measure, model, y, operation)
if model isa Probabilistic
if operation == predict
if prediction_type(measure) != :probabilistic
suggestion = ""
if target_scitype(measure) <: Finite
if target_scitype(measure) <: AbstractVector{<:Finite}
suggestion = "\nPerhaps you want to set operation="*
"predict_mode. "
elseif target_scitype(measure) <: Continuous
elseif target_scitype(measure) <: AbstractVector{<:Continuous}
suggestion = "\nPerhaps you want to set operation="*
"predict_mean or operation=predict_median. "
else
Expand Down

0 comments on commit f04698b

Please sign in to comment.