JuliaAI / MLJModels.jl

Home of the MLJ model registry and tools for model queries and mode code loading
MIT License
79 stars 27 forks source link

Unsupported atomic model in `BinaryThresholdPredictor` should trigger informative error #486

Closed ablaom closed 1 year ago

ablaom commented 1 year ago
julia> prob_predictor = RidgeRegressor()
RidgeRegressor(
  lambda = 1.0, 
  fit_intercept = true, 
  penalize_intercept = false, 
  scale_penalty_with_samples = true, 
  solver = nothing)

julia> point_predictor = BinaryThresholdPredictor(prob_predictor)
ERROR: KeyError: key Deterministic not found
Stacktrace:
 [1] getindex
   @ ./dict.jl:498 [inlined]
 [2] BinaryThresholdPredictor(args::MLJLinearModels.RidgeRegressor; wrapped_model::Nothing, 
model::Nothing, threshold::Float64)                                                        
   @ MLJModels ~/MLJ/MLJModels/src/builtins/ThresholdPredictors.jl:104
 [3] BinaryThresholdPredictor(args::MLJLinearModels.RidgeRegressor)
   @ MLJModels ~/MLJ/MLJModels/src/builtins/ThresholdPredictors.jl:89
 [4] top-level scope
   @ REPL[301]:1