Repository of selected MLJ model interfaces, and home of the MLJ model registry.
For instructions on integrating a new model with MLJ visit here
General users of the MLJ machine learning platform should refer to MLJ home page for usage and installation instructions. While MLJ users are required to have MLJModels installed in their project environment, they can otherwise ignore it.
This repository is for developers wishing to:
-
add a model interface for a third party package that does not provide, or is not willing to provide, an MLJ interface natively
-
register new MLJ interfaces, whether they be defined here or in a third party package
To list all model interfaces currently registered, do using MLJ
or using MLJModels
and run:
-
localmodels()
to list built-in models (updated when external models are loaded with@load
) -
models()
to list all registered models, or see this list.
Recall that an interface is loaded from within MLJ, together with the
package providing the underlying algorithm, using the syntax @load RidgeRegressor pkg=GLM
, where the pkg
keyword is only necessary in
ambiguous cases.
MLJModels contains:
-
interfaces, under /src/, for "essential" Julia machine learning packages which do not yet provide, or are unlikely to provide, native MLJ model interfaces. The bulk of these are ScikitLearn.jl models.
-
a few models that are pre-loaded into MLJ, located at /src/builtins, such as
OneHotEncoder
andConstantClassifier
. -
the MLJ model registry, listing all models that can be called from MLJ using
@load
. Package developers can register new models by implementing the MLJ interface in their package and following these instructions.
Generally model registration is performed by administrators. If you have an interface you would like registered, open an issue here.
Administrator instructions. To register all the models in GreatNewPackage with MLJ:
-
In the dev branch of a clone of the dev branch of MLJModels, change to the
/src/registry/
directory and, in Julia, activate the environment specified by the Project.toml there, after checking the [compat] conditions there are up to date. Do not useRevise
. -
Add
GreatNewPackage
to the environment. -
In some environment to which your MLJModels clone has been added (using
Pkg.dev
) executeusing MLJModels; @update
. This updatessrc/registry/Metadata.toml
andsrc/registry/Models.toml
(the latter is generated for convenience and not used by MLJ). If the new package does not appear in the list of packages generated, you may have to force precompilation of MLJModels. -
Test that interfaces load with
MLJModels.check_registry()
-
Quit your REPL session, whose namespace is now polluted.
-
Note. that your local MLJModels will not immediately adopt the updated registry because that requires pre-compilation; for technical reasons the registry is not loaded in
__init__
()`. -
Push your changes to an appropriate branch of MLJModels to make the updated metadata available to users of the next MLJModels tagged release.