Skip to content

Commit

Permalink
fix serialization, resolving part of MLJ.jl issue 1099
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Mar 3, 2024
1 parent 3f070fb commit e901f4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ MLJBase.predict(::EitherIteratedModel, fitresult, Xnew) =

MLJBase.transform(::EitherIteratedModel, fitresult, Xnew) =
transform(fitresult, Xnew)

# here `fitresult` is a trained atomic machine:
MLJBase.save(::EitherIteratedModel, fitresult) = MLJBase.serializable(fitresult)
MLJBase.restore(::EitherIteratedModel, fitresult) = MLJBase.restore!(fitresult)
2 changes: 1 addition & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ end
seekstart(io)
mach2 = machine(io)
close(io)
@test_broken MLJBase.predict(mach2, (; x = rand(2))) fill(42.0, 2)
@test MLJBase.predict(mach2, (; x = rand(2))) fill(42.0, 2)
end

end
Expand Down

0 comments on commit e901f4a

Please sign in to comment.