I want to train a self tuning model with MLJ. I set up my model, it trains, but when I want to save the machine, I get the error message that
DeterministicTunedModel has no field artifact_location
.
Any idea how to solve it?
using MLJ
using MLJTuning
using XGBoost
using MLJXGBoostInterface
using DataFrames
XGBR = MLJ.@load XGBoostRegressor pkg=XGBoost
xgboost = XGBR(num_round = 20)
r_depth = range(xgboost, :max_depth, lower = 1, upper = 10)
self_tuning_xgboost = TunedModel(
model = xgboost,
tuning = Grid(resolution = 2),
resampling = CV(nfolds = 5),
measure = rms,
acceleration = CPUThreads(),
range = r_depth
)
x = DataFrame(a = rand(1000), b = rand(1000))
y = rand(1000)
machxgb = machine(self_tuning_xgboost, x, y)
fit!(machxgb)
MLJ.save("/path/to/file", machxgb)
I have tried it with both XGBoost/MLJXGBoostInterface and EvoTrees, and for both I get the same error.
Here is the full message.
ERROR: type DeterministicTunedModel has no field artifact_location
Stacktrace:
[1] getproperty
@ ./Base.jl:37 [inlined]
[2] save(logger::MLJTuning.DeterministicTunedModel{Grid, XGBoostRegressor}, machine::Machine{XGBoostRegressor, true})
@ MLJFlow ~/.julia/packages/MLJFlow/AAdc1/src/base.jl:29
[3] serializable(mach::Machine{…}, model::MLJTuning.DeterministicTunedModel{…}; verbosity::Int64)
@ MLJBase ~/.julia/packages/MLJBase/eCnWm/src/machines.jl:988
[4] serializable (repeats 2 times)
@ MLJBase ~/.julia/packages/MLJBase/eCnWm/src/machines.jl:978 [inlined]
[5] save(file::String, mach::Machine{MLJTuning.DeterministicTunedModel{Grid, XGBoostRegressor}, false})
@ MLJBase ~/.julia/packages/MLJBase/eCnWm/src/machines.jl:1082
[6] top-level scope
@ REPL[31]:1