Skip to content

Commit

Permalink
test with MLJTestInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Oct 28, 2024
1 parent b77ec5d commit e43b313
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GLMNet = "8d5ece8b-de18-5317-b113-243142960cc6"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Lasso = "b4fcebef-c861-5a0f-a7e2-ba9dc32b180a"
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
Expand All @@ -26,6 +27,7 @@ Interpolations = "0.15"
Lasso = "0.7"
MLJBase = "1"
MLJModelInterface = "1"
MLJTestInterface = "0.2.6"
Statistics = "1"
StatsAPI = "1"
StatsBase = "0.34"
Expand All @@ -36,7 +38,8 @@ julia = "1.9"
[extras]
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
MLJTestInterface = "72560011-54dd-4dc2-94f3-c5de45b75ecd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["DelimitedFiles", "MLJBase", "Test"]
test = ["DelimitedFiles", "MLJBase", "MLJTestInterface", "Test"]
12 changes: 11 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Maxnet, Test, Statistics, CategoricalArrays
using Maxnet, Test, Statistics, CategoricalArrays, MLJTestInterface

p_a, env = Maxnet.bradypus()
# Make the levels in ecoreg string to make sure that that works
Expand Down Expand Up @@ -85,6 +85,16 @@ end
m = maxnet(p_a, env; features = "lq", addsamplestobackground = false)

@testset "MLJ" begin
data = MLJTestInterface.make_binary()
failures, summary = MLJTestInterface.test(
[MaxnetBinaryClassifier],
data...;
mod=@__MODULE__,
verbosity=0, # bump to debug
throw=false, # set to true to debug
)
@test isempty(failures)

using MLJBase
mn = Maxnet.MaxnetBinaryClassifier

Expand Down

0 comments on commit e43b313

Please sign in to comment.