Skip to content

Commit 76fd447

Browse files
authored
Merge pull request #51 from JuliaAI/dev
For a 0.5.4 release
2 parents 7a2bb1c + 780f020 commit 76fd447

File tree

4 files changed

+47
-37
lines changed

4 files changed

+47
-37
lines changed

.github/workflows/TagBot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
types:
55
- created
66
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
710
jobs:
811
TagBot:
912
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
@@ -12,4 +15,6 @@ jobs:
1215
- uses: JuliaRegistries/TagBot@v1
1316
with:
1417
token: ${{ secrets.GITHUB_TOKEN }}
18+
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
1519
ssh: ${{ secrets.DOCUMENTER_KEY }}
20+
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJTestIntegration"
22
uuid = "697918b4-fdc1-4f9e-8ff9-929724cee270"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "0.5.3"
4+
version = "0.5.4"
55

66
[deps]
77
MLJ = "add582a8-e3ab-11e8-2d5e-e98b27df1bc7"
@@ -12,9 +12,10 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1212
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1313

1414
[compat]
15-
MLJ = "0.18, 0.19, 0.20, 0.21"
15+
MLJ = "0.18, 0.19, 0.20, 0.21, 0.22"
1616
MLJModels = "0.16, 0.17, 0.18"
1717
MLJTestInterface = "0.2.4"
18+
MLJTransforms = "0.1.3"
1819
NearestNeighborModels = "0.2"
1920
Pkg = "<0.0.1, 1"
2021
Test = "<0.0.1, 1"
@@ -23,7 +24,8 @@ julia = "1.10"
2324
[extras]
2425
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
2526
MLJModels = "d491faf4-2d78-11e9-2867-c94bc002c0b7"
27+
MLJTransforms = "23777cdb-d90c-4eb0-a694-7c2b83d5c1d6"
2628
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2729

2830
[targets]
29-
test = ["MLJDecisionTreeInterface", "MLJModels", "Test"]
31+
test = ["MLJDecisionTreeInterface", "MLJModels", "MLJTransforms", "Test"]

README.md

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ Package for applying integration tests to models implementing the
44
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model
55
interface.
66

7-
**To test implementations of the MLJ model interface, use [MLJTestInterface.jl](https://github.com/JuliaAI/MLJTestInterface.jl)
8-
instead.**
7+
For to apply minimal tests for an implementations of the MLJ model interface, use
8+
[MLJTestInterface.jl](https://github.com/JuliaAI/MLJTestInterface.jl) instead.
99

10-
[![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)
10+
However, *implementations are now encouraged to include the comprehensive tests* provided
11+
in this package instead.
12+
13+
[![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)
1114

1215
# Installation
1316

@@ -19,55 +22,55 @@ Pkg.add("MLJTestIntegration")
1922
# Usage
2023

2124
This package provides a method for testing a collection of `models`
22-
(types or named tuples with keys `:name` and `:package_name`) using
23-
the specified training `data`:
25+
(more, specifically model types) using the specified training `data`:
2426

2527
```julia
26-
MLJTestIntegration.test(models, data...; mod=Main, level=2, throw=false, verbosity=1)
28+
MLJTestIntegration.test(models, data...; mod=Main, level=2, throw=false, verbosity=1)
2729
-> failures, summary
2830
```
2931

32+
For pure Julia models, `level=4` (the maximimum) is recommended. Otherwise `level=3` is
33+
recommended.
34+
3035
For detailed documentation, run `using MLJTestIntegration; @doc MLJTestIntegration.test`.
3136

3237

33-
# Example: Testing models filtered from the MLJ model registry
38+
# Example
3439

35-
The following applies comprehensive integration tests to all
36-
regressors provided by the package GLM.jl appearing in the MLJ Model
37-
Registry. Since GLM.jl models are provided through the interface
38-
package `MLJGLMInterface`, this must be in the current environment:
40+
The following tests the model interface implemented by the `DecisionTreeClassifier` model
41+
implemented in the package MLJDecisionTreeInterface.jl.
3942

4043
```julia
41-
Pkg.add("MLJGLMInterface")
42-
import MLJBase, MLJTestIntegration
43-
using DataFrames # to view summary
44-
X, y = MLJTestIntegration.MLJ.make_regression();
45-
regressors = MLJTestIntegration.MLJ.models(matching(X, y)) do m
46-
m.package_name == "GLM"
47-
end
48-
49-
# to test code loading:
50-
failures, summary =
51-
MLJTestIntegration.test(regressors, X, y, verbosity=2, mod=@__MODULE__, level=1)
52-
@assert isempty(failures)
53-
54-
# comprehensive tests:
55-
failures, summary =
56-
MLJTestIntegration.test(regressors, X, y, verbosity=2, mod=@__MODULE__, level=4)
57-
58-
summary |> DataFrame
44+
import MLJDecisionTreeInterface
45+
import MLJTestIntegration
46+
using Test
47+
X, y = MLJTestIntegration.make_multiclass()
48+
failures, summary = MLJTestIntegration.test(
49+
[MLJDecisionTreeInterface.DecisionTreeClassifier, ],
50+
X, y,
51+
verbosity=0, # set to 2 when debugging
52+
throw=false, # set to `true` when debugging
53+
mod=@__MODULE__,
54+
)
55+
@test isempty(failures)
5956
```
6057

58+
For models supporting tabular data `X`, we recommend repeating the tests with `(X, y)`
59+
replaced with `(Tables.rowtable(X)), y)` to ensure support for different table types,
60+
which new implementation sometimes fail to do.
61+
6162
# Datasets
6263

6364
The following commands generate datasets of the form `(X, y)` suitable for integration
6465
tests:
6566

66-
- `MLJTestIntegration.make_binary`
67+
- `MLJTestIntegration.make_binary`
6768

68-
- `MLJTestIntegration.make_multiclass`
69+
- `MLJTestIntegration.make_multiclass`
6970

70-
- `MLJTestIntegration.make_regression`
71+
- `MLJTestIntegration.make_regression`
7172

72-
- `MLJTestIntegration.make_count`
73+
- `MLJTestIntegration.make_count`
7374

75+
The binary and multiclass sets are deliberately small and will catch failures to properly
76+
track target class pools, a common gotcha in new implementations.

test/datasets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const MTI = MLJTestIntegration
66

77
Rgs = @load KNNRegressor pkg=NearestNeighborModels verbosity=0
88
Clf = @load KNNClassifier pkg= NearestNeighborModels verbosity=0
9-
Trf = @load Standardizer pkg=MLJModels verbosity=0
9+
Trf = @load Standardizer pkg=MLJTransforms verbosity=0
1010

1111
Rgs_proxy = models() do m
1212
m.name == "KNNRegressor" && m.package_name == "NearestNeighborModels"

0 commit comments

Comments
 (0)