davnn / MLJModels.jl

A place for non-native implementations of the MLJ model API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLJModels

Build Status

Repository of the "built-in" models available for use in the MLJ MLJ machine learning framework; and the home of the MLJ model registry.

For instructions on integrating a new model with MLJ visit here

Contents

Who is this repo for?

General users of the MLJ machine learning platform should refer to MLJ home page for usage and installation instructions. MLJModels is a dependency of MLJ that the general user can ignore.

This repository is for developers wishing to register new MLJ model interfaces, whether they be:

It also a place for developers to add models (mostly transformers) such as OneHotEncoder, that are exported for "built-in" use in MLJ. (In the future these models may live in a separate 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.

What is provided here?

MLJModels contains:

  • transformers to be pre-loaded into MLJ, located at /src/builtins, such as OneHotEncoder and ConstantClassifier.

  • 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.

Instructions for updating the MLJ model registry

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 the latest version of julia, activate the environment specified by the Project.toml there, after checking the [compat] conditions there are up to date. Do not use Revise.

  • Add GreatNewPackage to the environment.

  • In some environment to which your MLJModels clone has been added (using Pkg.dev) execute using MLJModels; MLJModels.@update. This updates src/registry/Metadata.toml and src/registry/Models.toml (the latter is generated for convenience and not used by MLJ).

  • Quit your REPL session and make a trivial commit to your MLJModels branch to force pre-compilation in a new julia session when you run using MLJModels. (For technical reasons the registry is not loaded in __init__()`, so without pre-compiliation the new ]registry is not available.)

  • Test that the interfaces load properly with MLJModels.check_registry(). (CI will fail on dev -> master if this test fails.)

  • Push your changes to an appropriate branch of MLJModels to make the updated metadata available to users of the next MLJModels tagged release.

About

A place for non-native implementations of the MLJ model API

License:MIT License


Languages

Language:Julia 100.0%