Skip to content

Commit 16d8e20

Browse files
committed
rm some obsolete testing
1 parent 0f0d4d4 commit 16d8e20

File tree

6 files changed

+16
-44
lines changed

6 files changed

+16
-44
lines changed

src/MLJModels.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ include("model_search.jl")
8585
# include tools to load model code:
8686
include("loading.jl")
8787

88+
# include tool for cloning the Model Registry project file:
89+
include("registry_project.jl")
90+
8891
end # module

src/registry/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# The MLJ Model Registry
2+
13
The *MLJ Model Registry*, also known as the *model metadata database*,
24
consists of the files in this directory:
35

test/builtins/Constant.jl

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,10 @@ X = NamedTuple{(:x1,:x2,:x3)}((rand(10), rand(10), rand(10)))
1919
@test MLJBase.predict(model, fitresult, X)[7].μ d.μ
2020
@test MLJBase.predict_mean(model, fitresult, X) fill(1.5, 10)
2121

22-
d = MLJModels.info_dict(model)
23-
@test d[:input_scitype] == MLJBase.Table
24-
@test d[:target_scitype] == AbstractVector{MLJBase.Continuous}
25-
@test d[:name] == "ConstantRegressor"
26-
@test d[:load_path] == "MLJModels.ConstantRegressor"
27-
28-
d = MLJModels.info_dict(DeterministicConstantRegressor)
29-
@test d[:input_scitype] == MLJBase.Table
30-
@test d[:target_scitype] == AbstractVector{MLJBase.Continuous}
31-
@test d[:name] == "DeterministicConstantRegressor"
32-
@test d[:load_path] == "MLJModels.DeterministicConstantRegressor"
22+
@test MLJBase.input_scitype(model) == MLJBase.Table
23+
@test MLJBase.target_scitype(model) == AbstractVector{MLJBase.Continuous}
24+
@test MLJBase.name(model) == "ConstantRegressor"
25+
@test MLJBase.load_path(model) == "MLJModels.ConstantRegressor"
3326
end
3427

3528
@testset "Classifier" begin
@@ -59,17 +52,11 @@ end
5952
fitresult, cache, report = MLJBase.fit(model, 1, X, y, w)
6053
d = MLJBase.UnivariateFinite([y[1], y[2], y[4]], [1/3, 1/4, 5/12])
6154

62-
d = MLJModels.info_dict(model)
63-
@test d[:input_scitype] == MLJBase.Table
64-
@test d[:target_scitype] == AbstractVector{<:MLJBase.Finite}
65-
@test d[:name] == "ConstantClassifier"
66-
@test d[:load_path] == "MLJModels.ConstantClassifier"
67-
68-
d = MLJModels.info_dict(DeterministicConstantClassifier)
69-
@test d[:input_scitype] == MLJBase.Table
70-
@test d[:target_scitype] == AbstractVector{<:MLJBase.Finite}
71-
@test d[:name] == "DeterministicConstantClassifier"
72-
@test d[:load_path] == "MLJModels.DeterministicConstantClassifier"
55+
@test MLJBase.input_scitype(model) == MLJBase.Table
56+
@test MLJBase.target_scitype(model) == AbstractVector{<:MLJBase.Finite}
57+
@test MLJBase.name(model) == "ConstantClassifier"
58+
@test MLJBase.load_path(model) == "MLJModels.ConstantClassifier"
59+
7360
end
7461

7562
end # module

test/builtins/Transformers.jl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ end
5353
@test round.(Int, MLJBase.transform(stand, f, [0,4,8])) == [-1.0,1.0,3.0]
5454
@test round.(Int, MLJBase.inverse_transform(stand, f, [-1, 1, 3])) ==
5555
[0, 4, 8]
56-
infos = MLJModels.info_dict(stand)
5756

5857
N = 5
5958
rand_char = rand("abcefgh", N)
@@ -157,14 +156,6 @@ end
157156
@test Xnew[4] == X[4]
158157
@test Xnew[5] == X[5]
159158

160-
infos = MLJModels.info_dict(stand)
161-
162-
@test infos[:name] == "Standardizer"
163-
@test infos[:input_scitype] ==
164-
Union{MLJBase.Table, AbstractVector{<:Continuous}}
165-
@test infos[:output_scitype] ==
166-
Union{MLJBase.Table, AbstractVector{<:Continuous}}
167-
168159
# univariate case
169160
stand = Standardizer()
170161
f, _, _ = MLJBase.fit(stand, 1, [0, 2, 4])
@@ -296,11 +287,6 @@ end
296287
e = v - MLJBase.inverse_transform(t, f, MLJBase.transform(t, f, v))
297288
@test sum(abs, e) <= 5000*eps()
298289

299-
infos = MLJModels.info_dict(t)
300-
301-
@test infos[:name] == "UnivariateBoxCoxTransformer"
302-
@test infos[:input_scitype] == AbstractVector{MLJBase.Continuous}
303-
@test infos[:output_scitype] == AbstractVector{MLJBase.Continuous}
304290
end
305291

306292

@@ -383,12 +369,6 @@ end
383369
f, = MLJBase.fit(t, 0, X)
384370
@test_throws Exception MLJBase.transform(t, f, Xmiss)
385371

386-
infos = MLJModels.info_dict(t)
387-
388-
@test infos[:name] == "OneHotEncoder"
389-
@test infos[:input_scitype] == MLJBase.Table
390-
@test infos[:output_scitype] == MLJBase.Table
391-
392372
# test the work on missing values
393373
X = (name = categorical(["Ben", "John", "Mary", "John", missing], ordered=true),
394374
height = [1.85, 1.67, 1.5, 1.67, 1.56],

test/metadata.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Test
44
using MLJModels
55
using MLJBase
66

7-
METADATA = MLJModels.METADATA
7+
METADATA = MLJModels.REGISTRY_METADATA
88
pca = MLJModels.Handle("PCA", "MultivariateStats")
99
cnst = MLJModels.Handle("ConstantRegressor", "MLJModels")
1010
i = MLJModels.info_given_handle(METADATA)[pca]

test/registry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using Suppressor
1414

1515
# make a clone of the MLJModel registry, to test `registry_project` method:
1616
filename, stream = mktemp()
17-
for line in MLJModels.Registry.registry_project()
17+
for line in MLJModels.registry_project()
1818
write(stream, line*"\n")
1919
end
2020
close(stream)

0 commit comments

Comments
 (0)