As of MLJ 0.18, this package is no longer a dependecy of MLJ, with serialization functionality provided by MLJBase 0.20
Linux | Coverage |
---|---|
A package adding model serialization to the MLJ machine learning framework.
using Pkg
Pkg.add("MLJ")
Pkg.add("MLJSerialization")
Fit and save a decision tree model:
Pkg.add("DecisionTree")
using MLJ
using MLJSerialization
X, y = @load_iris
Tree = @load DecisionTreeClassifier pkg=DecisionTree
tree = Tree()
mach = fit!(machine(tree, X, y))
MLJSerialization.save("my_machine.jlso", mach)
Retrieve the saved machine:
mach2 = machine("my_machine.jlso")
Xnew = selectrows(X, 1:3)
predict_mode(mach2, Xnew)
julia> predict_mode(mach2, Xnew)
3-element CategoricalArrays.CategoricalArray{String,1,UInt32}:
"setosa"
"setosa"
"setosa"
Documentation is provided in the Saving machines section of the MLJManual