@@ -31,10 +31,6 @@ const ERR_INVALID_OPERATION = ArgumentError(
31
31
_ambiguous_operation (model, measure) =
32
32
" `$measure ` does not support a `model` with " *
33
33
" `prediction_type(model) == :$(prediction_type (model)) `. "
34
- err_ambiguous_operation (model, measure) = ArgumentError (
35
- _ambiguous_operation (model, measure)*
36
- " \n Unable to infer an appropriate operation for `$measure `. " *
37
- " Explicitly specify `operation=...` or `operations=...`. " )
38
34
err_incompatible_prediction_types (model, measure) = ArgumentError (
39
35
_ambiguous_operation (model, measure)*
40
36
" If your model is truly making probabilistic predictions, try explicitly " *
@@ -65,11 +61,25 @@ ERR_MEASURES_DETERMINISTIC(measure) = ArgumentError(
65
61
" and so is not supported by `$measure `. " * LOG_AVOID
66
62
)
67
63
68
- # ==================================================================
69
- # # MODEL TYPES THAT CAN BE EVALUATED
64
+ err_ambiguous_operation (model, measure) = ArgumentError (
65
+ _ambiguous_operation (model, measure)*
66
+ " \n Unable to infer an appropriate operation for `$measure `. " *
67
+ " Explicitly specify `operation=...` or `operations=...`. " *
68
+ " Possible value(s) are: $PREDICT_OPERATIONS_STRING . "
69
+ )
70
+
71
+ ERR_UNSUPPORTED_PREDICTION_TYPE = ArgumentError (
72
+ """
73
+
74
+ The `prediction_type` of your model needs to be one of: `:deterministic`,
75
+ `:probabilistic`, or `:interval`. Does your model implement one of these operations:
76
+ $PREDICT_OPERATIONS_STRING ? If so, you can try explicitly specifying `operation=...`
77
+ or `operations=...` (and consider posting an issue to have the model review it's
78
+ definition of `MLJModelInterface.prediction_type`). Otherwise, performance
79
+ evaluation is not supported.
70
80
71
- # not exported:
72
- const Measurable = Union{Supervised, Annotator}
81
+ """
82
+ )
73
83
74
84
# ==================================================================
75
85
# # RESAMPLING STRATEGIES
@@ -987,7 +997,7 @@ function _actual_operations(operation::Nothing,
987
997
throw (err_ambiguous_operation (model, m))
988
998
end
989
999
else
990
- throw (err_ambiguous_operation (model, m) )
1000
+ throw (ERR_UNSUPPORTED_PREDICTION_TYPE )
991
1001
end
992
1002
end
993
1003
end
@@ -1137,7 +1147,7 @@ See also [`evaluate`](@ref), [`PerformanceEvaluation`](@ref),
1137
1147
1138
1148
"""
1139
1149
function evaluate! (
1140
- mach:: Machine{<:Measurable} ;
1150
+ mach:: Machine ;
1141
1151
resampling= CV (),
1142
1152
measures= nothing ,
1143
1153
measure= measures,
@@ -1235,7 +1245,7 @@ Returns a [`PerformanceEvaluation`](@ref) object.
1235
1245
See also [`evaluate!`](@ref).
1236
1246
1237
1247
"""
1238
- evaluate (model:: Measurable , args... ; cache= true , kwargs... ) =
1248
+ evaluate (model:: Model , args... ; cache= true , kwargs... ) =
1239
1249
evaluate! (machine (model, args... ; cache= cache); kwargs... )
1240
1250
1241
1251
# -------------------------------------------------------------------
0 commit comments