Skip to content

Commit a5751a7

Browse files
authored
Merge pull request #593 from JuliaAI/dev
For a 0.18 release
2 parents 9251ebf + 76a5147 commit a5751a7

31 files changed

+7181
-10392
lines changed

.github/workflows/check_registry.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
${{ runner.os }}-
4242
- uses: julia-actions/julia-buildpkg@v1
4343
- uses: julia-actions/julia-runtest@v1
44+
env:
45+
# This environment variable enables the integration tests:
46+
MLJ_TEST_REGISTRY: '1'
4447
- uses: julia-actions/julia-processcoverage@v1
4548
- uses: codecov/codecov-action@v4
4649
with:

Project.toml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJModels"
22
uuid = "d491faf4-2d78-11e9-2867-c94bc002c0b7"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.17.9"
4+
version = "0.18.0"
55

66
[deps]
77
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
@@ -31,33 +31,39 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
3131
CategoricalArrays = "0.9, 0.10"
3232
CategoricalDistributions = "0.1"
3333
Combinatorics = "1.0"
34-
Dates = "<0.0.1, 1"
34+
Dates = "1"
3535
Distances = "0.9,0.10"
36+
Distributed = "1"
3637
Distributions = "0.25"
37-
InteractiveUtils = "<0.0.1, 1"
38-
LinearAlgebra = "<0.0.1, 1"
39-
Markdown = "<0.0.1, 1"
38+
InteractiveUtils = "1"
39+
LinearAlgebra = "1"
4040
MLJModelInterface = "1.10"
41+
MLJTransforms = "0.1.1"
42+
Markdown = "1"
4143
OrderedCollections = "1.1"
4244
Parameters = "0.12"
43-
Pkg = "<0.0.1, 1"
45+
Pkg = "1"
4446
PrettyPrinting = "0.3, 0.4"
45-
Random = "<0.0.1, 1"
47+
Random = "1"
4648
RelocatableFolders = "0.3, 1"
4749
ScientificTypes = "3"
4850
StatisticalTraits = "3"
49-
Statistics = "<0.0.1, 1"
51+
Statistics = "1"
5052
StatsBase = "0.32,0.33, 0.34"
53+
Suppressor = "0.2.8"
5154
Tables = "0.2,1.0"
52-
julia = "1.6"
55+
julia = "1.10"
5356

5457
[extras]
58+
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
5559
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
5660
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
5761
MLJMultivariateStatsInterface = "1b6a4a23-ba22-4f51-9698-8599985d3728"
62+
MLJTransforms = "23777cdb-d90c-4eb0-a694-7c2b83d5c1d6"
5863
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
5964
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
65+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
6066
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6167

6268
[targets]
63-
test = ["MLJBase", "MLJDecisionTreeInterface", "MLJMultivariateStatsInterface", "Pkg", "StableRNGs", "Test"]
69+
test = ["Distributed", "MLJBase", "MLJDecisionTreeInterface", "MLJMultivariateStatsInterface", "MLJTransforms", "Pkg", "StableRNGs", "Suppressor", "Test"]

README.md

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,76 @@
1-
# MLJModels
1+
# MLJModels.jl
22

33
[![Build Status](https://github.com/JuliaAI/MLJModels.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/MLJModels.jl/actions)
44
[![codecov](https://codecov.io/gh/JuliaAI/MLJModels.jl/graph/badge.svg?token=KgarnnCc0K)](https://codecov.io/gh/JuliaAI/MLJModels.jl)
55

6-
Repository of the "built-in" models available for use in the
7-
[MLJ](https://github.com/JuliaAI/MLJ.jl) MLJ machine
8-
learning framework; and the home of the MLJ model registry.
6+
Home of the [MLJ](https://juliaml.ai) Model Registry and tools for model search and model code loading.
97

10-
For instructions on integrating a new model with MLJ visit
11-
[here](https://JuliaAI.github.io/MLJ.jl/dev/adding_models_for_general_use/)
8+
For instructions on integrating a new model into MLJ visit
9+
[here](https://juliaai.github.io/MLJModelInterface.jl/stable/).
1210

1311

1412
### Contents
1513

1614
- [Who is this repo for?](#who-is-this-repo-for)
15+
- [How to register new models](#how-to-register-new-models)
1716
- [What is provided here?](#what-is-provided-here)
18-
- [Instructions for updating the MLJ model registry](#instructions-for-updating-the-mlj-model-registry)
1917

2018
## Who is this repo for?
2119

22-
General users of the MLJ machine learning platform should refer to
23-
[MLJ home page](https://JuliaAI.github.io/MLJ.jl/dev/)
24-
for usage and installation instructions. MLJModels is a dependency of
25-
MLJ that the general user can ignore.
20+
Newcomers to MLJ should refer to [this page](https://juliaml.ai) for usage and
21+
installation instructions. MLJModels.jl is a dependency of MLJ that the general user can
22+
ignore.
2623

27-
This repository is for developers wishing to
28-
[register](#instructions-for-updating-the-mlj-model-registry) new MLJ
29-
model interfaces, whether they be:
24+
This repository is for developers maintaining:
3025

31-
- implemented **natively** in a
32-
package providing the core machine learning algorithm, as in
26+
- The [MLJ Model Registry](/src/registry), a database of packages implementing the MLJ
27+
interface for machine learning models, together with metadata about those models.
28+
29+
- MLJ tools for searching the database (`models(...)` and `matching(...)`) and for loading
30+
model code (`@load`, `@iload`).
31+
32+
## How to register new models
33+
34+
The model registry lives at "/src/registry" but
35+
is maintained using
36+
[MLJModelRegistryTools.jl](https://juliaai.github.io/MLJModelRegistryTools.jl/dev/).
37+
38+
New MLJ model interfaces can be implemented either:
39+
40+
- **natively** in a package providing the core machine learning algorithm, as in
3341
[`EvoTrees.jl`](https://github.com/Evovest/EvoTrees.jl/blob/master/src/MLJ.jl); or
3442

35-
- implemented in a separate **interface package**, such as
43+
- in a separate **interface package**, such as
3644
[MLJDecisionTreeInterface.jl](https://github.com/JuliaAI/MLJDecisionTreeInterface.jl).
3745

38-
It also a place for developers to add models (mostly transformers)
39-
such as `OneHotEncoder`, that are exported for "built-in" use in
40-
MLJ. (In the future these models may live in a separate package.)
41-
42-
To list *all* model interfaces currently registered, do `using MLJ` or
43-
`using MLJModels` and run:
46+
In either case, the package providing the implementation needs to be added to the MLJ
47+
Model Registry to make it discoverable by MLJ users, and to make the model metadata
48+
searchable. To register a package, prepare a pull request to MLJModels.jl by following [these instructions](https://juliaai.github.io/MLJModelRegistryTools.jl/dev/registry_management_tools/#Registry-management-tools).
4449

45-
- `localmodels()` to list built-in models (updated when external models are loaded with `@load`)
50+
Currently, after registering the model, one must also make a PR to MLJ updating [this
51+
dictionary of model
52+
descriptors](https://github.com/JuliaAI/MLJ.jl/blob/dev/docs/ModelDescriptors.toml) to
53+
ensure the new models appear in the right places in MLJ's [Model
54+
Browser](https://JuliaAI.github.io/MLJ.jl/dev/model_browser/#Model-Browser)
4655

47-
- `models()` to list all registered models, or see [this list](/src/registry/Models.toml).
56+
To list *all* model interfaces currently registered, do `using MLJ` or `using MLJModels`
57+
and run `models()` to list all registered models.
4858

4959
Recall that an interface is loaded from within MLJ, together with the
5060
package providing the underlying algorithm, using the syntax `@load
5161
RidgeRegressor pkg=GLM`, where the `pkg` keyword is only necessary in
5262
ambiguous cases.
5363

54-
5564
## What is provided here?
5665

57-
MLJModels contains:
58-
59-
- transformers to be pre-loaded into MLJ, located at
60-
[/src/builtins](/src/builtins), such as `OneHotEncoder`
61-
and `ConstantClassifier`.
62-
63-
- the MLJ [model registry](src/registry/Metadata.toml), listing all
64-
models that can be called from MLJ using `@load`. Package developers
65-
can register new models by implementing the MLJ interface in their
66-
package and following [these
67-
instructions](https://JuliaAI.github.io/MLJ.jl/dev/adding_models_for_general_use/).
68-
69-
70-
## Instructions for updating the MLJ model registry
66+
The actual MLJ Model Registry consists of the TOML files in [this
67+
directory](/src/registry). A few models available for immediate use in MLJ (without
68+
loading model code using `@load`) are also provided by this package, under "/src/builtins"
69+
but these may be moved out in the future.
7170

72-
Generally model registration is performed by administrators. If you
73-
have an interface you would like registered, open an issue
74-
[here](https://github.com/JuliaAI/MLJ.jl/issues).
71+
### Historical note
7572

76-
**Administrator instructions.** These are given in the
77-
`MLJModels.@update` document string. After registering the model, make a PR to MLJ
78-
updating [this dictionary of model descriptors](https://github.com/JuliaAI/MLJ.jl/blob/dev/docs/ModelDescriptors.toml)
79-
to ensure the new models appear in the right places in MLJ's [Model Browser](https://JuliaAI.github.io/MLJ.jl/dev/model_browser/#Model-Browser)
73+
Older versions of MLJModels.jl contained some of the models now residing at
74+
[MLJTransforms.jl](https://github.com/JuliaAI/MLJTransforms.jl/tree/dev). Even older
75+
versions provided implementations of all the non-native implementations of the
76+
MLJ interface.

src/GaussianProcesses.jl

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/MLJModels.jl

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export UnivariateDiscretizer,
4848
OneHotEncoder, ContinuousEncoder, FillImputer, UnivariateFillImputer,
4949
UnivariateTimeTypeToContinuous, InteractionTransformer
5050

51-
const srcdir = dirname(@__FILE__) # the directory containing this file
5251
const MMI = MLJModelInterface
5352

5453
if VERSION < v"1.3"
@@ -61,31 +60,31 @@ include("utilities.jl")
6160

6261
# load built-in models:
6362
include("builtins/Constant.jl")
64-
include("builtins/Transformers.jl")
6563
include("builtins/ThresholdPredictors.jl")
6664

67-
Handle = NamedTuple{(:name, :pkg), Tuple{String,String}}
68-
(::Type{Handle})(name,string) = NamedTuple{(:name, :pkg)}((name, string))
65+
# declare paths to the metadata and associated project file:
66+
const REGISTRY_PROJECT = @path joinpath(@__DIR__, "registry", "Project.toml")
67+
const REGISTRY_METADATA = @path joinpath(@__DIR__, "registry", "Metadata.toml")
68+
Base.include_dependency(REGISTRY_PROJECT)
69+
Base.include_dependency(REGISTRY_METADATA)
6970

7071
# load utilities for reading model metadata from file:
7172
include("metadata.jl")
7273

73-
# read in the metadata:
74-
metadata_file = joinpath(srcdir, "registry", "Metadata.toml")
75-
Base.include_dependency(metadata_file)
76-
const INFO_GIVEN_HANDLE = info_given_handle(metadata_file)
74+
# read in metadata:
75+
const INFO_GIVEN_HANDLE = info_given_handle(REGISTRY_METADATA)
7776
const PKGS_GIVEN_NAME = pkgs_given_name(INFO_GIVEN_HANDLE)
7877
const AMBIGUOUS_NAMES = ambiguous_names(INFO_GIVEN_HANDLE)
7978
const NAMES = model_names(INFO_GIVEN_HANDLE)
8079
const MODEL_TRAITS_IN_REGISTRY = model_traits_in_registry(INFO_GIVEN_HANDLE)
8180

82-
# model search and registry code:
81+
# include tools to search the model registry:
8382
include("model_search.jl")
83+
84+
# include tools to load model code:
8485
include("loading.jl")
85-
include("registry/src/Registry.jl")
86-
using .Registry
8786

88-
# finalize:
89-
include("init.jl")
87+
# include tool for cloning the Model Registry project file:
88+
include("registry_project.jl")
9089

9190
end # module

0 commit comments

Comments
 (0)