Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For a 0.20 release #751

Merged
merged 47 commits into from
Apr 5, 2022
Merged
Changes from 3 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5c83035
drop `filename` arg from save(filename, model, ...)
ablaom Jan 21, 2022
009b439
drop `filenmame` arguement from `restore`
ablaom Jan 23, 2022
f39263e
remove specific model checks for general scitype check
pazzo83 Jan 25, 2022
3b85789
revert back to check for elscitype in passed-in args
pazzo83 Jan 25, 2022
4b272fe
Merge pull request #724 from JuliaAI/drop-filename-from-save-method
ablaom Jan 25, 2022
d231edc
Merge branch 'for-a-0-point-20-release' of https://github.com/alan-tu…
ablaom Jan 25, 2022
c131aa8
correct save call with kwars...
olivierlabayle Jan 26, 2022
406f22a
address some MultivariateStats dep warnings
ablaom Jan 28, 2022
5c9eda4
fix logic with `Unknown` in fit_data_scitype, logging tests, misc
ablaom Jan 28, 2022
9f6bcdb
migrate current state from MLJSerialization
olivierlabayle Jan 28, 2022
02a42b5
add filesize check for composite
olivierlabayle Jan 28, 2022
10d9194
add some Misc tests
olivierlabayle Jan 28, 2022
4b58488
add some docstrings
olivierlabayle Jan 28, 2022
6dd7270
add UnupervisedModel test
olivierlabayle Jan 28, 2022
25100d3
add warn message when loading machine with state != -1
olivierlabayle Jan 28, 2022
3581923
refactor Base.replace to use in save
olivierlabayle Jan 28, 2022
a8c260c
add docstrings
olivierlabayle Jan 28, 2022
6a08fd1
drop `filename` arg from save(filename, model, ...)
ablaom Jan 21, 2022
feab9da
drop `filenmame` arguement from `restore`
ablaom Jan 23, 2022
6bbcbb8
correct save call with kwars...
olivierlabayle Jan 26, 2022
b87339a
Merge branch 'for-a-0-point-20-release' of https://github.com/alan-tu…
ablaom Jan 30, 2022
5fde0b1
remove simple_data
olivierlabayle Jan 31, 2022
dbca31c
update some docstrings
olivierlabayle Jan 31, 2022
8270e33
move network_model_names to CompositeFitresult and remove report_addi…
olivierlabayle Feb 2, 2022
f5429ab
update backquotes and old syntax
olivierlabayle Feb 2, 2022
d488717
switching to a undefined cache for serializable machines
olivierlabayle Feb 2, 2022
c91a810
remove passing args to machine constructor from file
olivierlabayle Feb 2, 2022
6d83802
add restore! now sets state to 1
olivierlabayle Feb 3, 2022
03a74e0
add warning deserialized for operations with args
olivierlabayle Feb 3, 2022
69303a0
correct code to unbreak test but I believe the test itself is broken
olivierlabayle Feb 3, 2022
6a32f25
add another warning test
olivierlabayle Feb 3, 2022
348f82e
Merge branch 'dev' into for-a-0-point-20-release
ablaom Feb 3, 2022
8a28b43
remove specific model checks for general scitype check
pazzo83 Jan 25, 2022
61da705
revert back to check for elscitype in passed-in args
pazzo83 Jan 25, 2022
07784ab
address some MultivariateStats dep warnings
ablaom Jan 28, 2022
f808a66
fix logic with `Unknown` in fit_data_scitype, logging tests, misc
ablaom Jan 28, 2022
d5c6462
Merge branch 'refactor_model_scitype_check2' of https://github.com/al…
ablaom Feb 3, 2022
75f992d
remove redundant code
ablaom Feb 4, 2022
f4be7dc
improvement to warn_generic_scitype_mismatch()
ablaom Feb 4, 2022
3f5229b
Merge pull request #732 from JuliaAI/refactor_model_scitype_check2
ablaom Feb 7, 2022
51862ec
Merge pull request #733 from JuliaAI/serialization
ablaom Mar 25, 2022
aa53c2e
Merge branch 'dev' into for-a-0-point-20-release
ablaom Mar 25, 2022
af105a3
correct test filesize for serialization
olivierlabayle Mar 30, 2022
1d9c2f4
tweak some doc-strings
ablaom Apr 5, 2022
acc4c4a
remove an old feature from doc-string
ablaom Apr 5, 2022
1c6c796
spelling
ablaom Apr 5, 2022
54eac32
hide some doc-strings for private methods
ablaom Apr 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions src/interface/model_api.jl
Original file line number Diff line number Diff line change
@@ -31,10 +31,35 @@ predict_median(m, fitresult, Xnew, ::Type{<:BadMedianTypes}) =
MLJModelInterface.implemented_methods(::FI, M::Type{<:MLJType}) =
getfield.(methodswith(M), :name) |> unique

# serialization fallbacks:
MLJModelInterface.save(filename, model, fitresult; kwargs...) = fitresult
# The following serialization fallbacks should live in
# MLJModelInterface when version 2.0 is released. At that time the
# hack block could also be removed.

#####################
# hack block begins #
#####################
const ERR_SERIALIZATION_FAILURE = ErrorException(
"Serialization failure. You are using a model that implements an outdated "*
"version of the serialization API. If you are using "*
"a model from XGBoost.jl, try using MLJXGBoostInterface 2.0 or "*
"or higher. "
)
const ERR_DESERIALIZATION_FAILURE = ErrorException(
"Deserialization failure. Your model must be deserialized using "*
"using MLJBase < 0.20 and MLJSerialization < 2.0. If this is an "*
"XGBoost.jl model, be sure to use MLJXGBoostInterface < 2.0. "
)
MLJModelInterface.save(filename, model, fitresult; kwargs...) =
throw(ERR_SERIALIZATION_FAILURE)
MLJModelInterface.restore(filename, model, serializable_fitresult) =
serializable_fitresult
throw(ERR_DESERIALIZATION_FAILURE)
###################
# hack block ends #
###################

MLJModelInterface.save(model, fitresult; kwargs) = fitresult
MLJModelInterface.restore(model, serializable_fitresult) =
serializable_fitresult

# to suppress inclusion of abstract types in the model registry.
for T in (:Supervised, :Unsupervised,