Skip to content

Commit f1e169e

Browse files
committed
strip down; rename everwhere MLJTestIntegration -> MLJTestInterface
1 parent baee5c1 commit f1e169e

16 files changed

+247
-3116
lines changed

Project.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
name = "MLJTestIntegration"
2-
uuid = "697918b4-fdc1-4f9e-8ff9-929724cee270"
1+
name = "MLJTestInterface"
2+
uuid = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.2.5"
4+
version = "0.1.0"
55

66
[deps]
7-
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
8-
NearestNeighborModels = "636a865e-7cf4-491e-846c-de09b730eb36"
7+
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
98
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
109
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1110

1211
[compat]
13-
MLJ = "0.18"
14-
NearestNeighborModels = "0.2"
12+
MLJBase = "0.20, 0.21"
1513
julia = "1.6"

README.md

Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,64 @@
1-
# MLJTestIntegration.jl
1+
# MLJTestInterface.jl
22

3-
Package for applying integration tests to models implementing the
4-
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model
5-
interface.
3+
Package for testing an implementation of the
4+
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model interface.
65

7-
[![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md) [![Build Status](https://github.com/JuliaAI/MLJTestIntegration.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/MLJTestIntegration.jl/actions) [![Coverage](https://codecov.io/gh/JuliaAI/MLJTestIntegration.jl/branch/master/graph/badge.svg)](https://codecov.io/github/JuliaAI/MLJTestIntegration.jl?branch=master)
6+
[![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md) [![Build Status](https://github.com/JuliaAI/MLJTestInterface.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/MLJTestInterface.jl/actions) [![Coverage](https://codecov.io/gh/JuliaAI/MLJTestInterface.jl/branch/master/graph/badge.svg)](https://codecov.io/github/JuliaAI/MLJTestInterface.jl?branch=master)
87

98
# Installation
109

1110
```julia
1211
using Pkg
13-
Pkg.add("MLJTestIntegration")
12+
Pkg.add("MLJTestInterface")
1413
```
1514

1615
# Usage
1716

18-
This package provides a method for testing a collection of `models`
19-
(types or named tuples with keys `:name` and `:package_name`) using
20-
the specified training `data`:
17+
To test that a collection of model types, `models`, satisfy the [MLJ model interface
18+
requirements](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/),
19+
use the `MLJTestInterface.test` function:
2120

2221
```julia
23-
MLJTestIntegration.test(models, data...; mod=Main, level=2, throw=false, verbosity=1)
22+
MLJTestInterface.test(models, data...; mod=Main, level=2, throw=false, verbosity=1)
2423
-> failures, summary
2524
```
2625

27-
For detailed documentation, run `using MLJTestIntegration; @doc MLJTestIntegration.test`.
26+
Here `data` is training data acceptable to all the specified `models`, as would appear in
27+
a call `MLJModelInterface.fit(model_instance, verbosity, data...)`.
2828

29-
For convenience, a number of specializations of this method are also provided:
29+
For detailed documentation, run `using MLJTestInterface; @doc MLJTestInterface.test`.
3030

31-
- `test_single_target_classifiers`
32-
- `test_single_target_regressors`
33-
- `test_single_target_count_regressors`
34-
- `test_continuous_table_transformers`
3531

36-
Query the document strings for details, or see
37-
[examples/bigtest/notebook.jl](examples/bigtest/notebook.jl).
32+
# Example
3833

39-
40-
# Examples
41-
42-
## Testing models in a new MLJ model interface implementation
43-
44-
The following tests the model interface implemented by some model type `MyClassifier` for
45-
multiclass classification, as might appear in tests for a package providing that type:
34+
The following tests the model interface implemented by the `DecisionTreeClassifier` model
35+
implemented in the package MLJDecisionTreeInterface.jl.
4636

4737
```julia
48-
import MLJTestIntegration
38+
import MLJDecisionTreeInterface
39+
import MLJTestInterface
4940
using Test
50-
X, y = MLJTestIntegration.make_multiclass()
51-
failures, summary = MLJTestIntegration.test([MyClassifier, ], X, y, verbosity=1, mod=@__MODULE__)
41+
X, y = MLJTestInterface.make_multiclass()
42+
failures, summary = MLJTestInterface.test(
43+
[MLJDecisionTreeInterface.DecisionTreeClassifier, ],
44+
X, y,
45+
verbosity=0, # set to 2 when debugging
46+
throw=false, # set to `true` when debugging
47+
mod=@__MODULE__,
48+
)
5249
@test isempty(failures)
5350
```
5451

55-
## Testing models after filtering models in the registry
56-
57-
The following applies comprehensive integration tests to all
58-
regressors provided by the package GLM.jl appearing in the MLJ Model
59-
Registry. Since GLM.jl models are provided through the interface
60-
package `MLJGLMInterface`, this must be in the current environment:
61-
62-
```julia
63-
Pkg.add("MLJGLMInterface")
64-
import MLJBase, MLJTestIntegration
65-
using DataFrames # to view summary
66-
X, y = MLJTestIntegration.MLJ.make_regression();
67-
regressors = MLJTestIntegration.MLJ.models(matching(X, y)) do m
68-
m.package_name == "GLM"
69-
end
70-
71-
# to test code loading:
72-
MLJTestIntegration.test(regressors, X, y, verbosity=2, mod=@__MODULE__, level=1)
73-
74-
# comprehensive tests:
75-
failures, summary =
76-
MLJTestIntegration.test(regressors, X, y, verbosity=2, mod=@__MODULE__, level=4)
77-
78-
summary |> DataFrame
79-
```
80-
8152
# Datasets
8253

83-
The following commands generate datasets of the form `(X, y)` suitable for integration
54+
The following commands generate small datasets of the form `(X, y)` suitable for interface
8455
tests:
8556

86-
- `MLJTestIntegration.make_binary`
57+
- `MLJTestInterface.make_binary`
8758

88-
- `MLJTestIntegration.make_multiclass`
59+
- `MLJTestInterface.make_multiclass`
8960

90-
- `MLJTestIntegration.make_regression`
61+
- `MLJTestInterface.make_regression`
9162

92-
- `MLJTestIntegration.make_count`
63+
- `MLJTestInterface.make_count`
9364

0 commit comments

Comments
 (0)