Skip to content

Commit e762c73

Browse files
authored
Merge pull request #955 from JuliaAI/dev
For a 1.1.1 release
2 parents 2788980 + d744f3a commit e762c73

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/resampling.jl

+9-2
Original file line numberDiff line numberDiff line change
@@ -1591,8 +1591,15 @@ function MLJModelInterface.update(
15911591
mach, e = fitresult
15921592
train_test_rows = e.train_test_rows
15931593

1594-
measures = e.measure
1595-
operations = e.operation
1594+
# since `resampler.model` could have changed, so might the actual measures and
1595+
# operations that should be passed to the (low level) `evaluate!`:
1596+
measures = _actual_measures(resampler.measure, resampler.model)
1597+
operations = _actual_operations(
1598+
resampler.operation,
1599+
measures,
1600+
resampler.model,
1601+
verbosity
1602+
)
15961603

15971604
# update the model:
15981605
mach2 = _update!(mach, resampler.model)

test/resampling.jl

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#module TestResampling
2-
31
using Distributed
42
import ComputationalResources: CPU1, CPUProcesses, CPUThreads
53
using .TestUtilities
@@ -876,5 +874,21 @@ end
876874
@test contains(printed_evaluations, "N/A")
877875
end
878876

879-
#end
877+
@testset_accelerated "issue with Resampler #954" acceleration begin
878+
knn = KNNClassifier()
879+
cnst =DeterministicConstantClassifier()
880+
X, y = make_blobs(10)
881+
882+
resampler = MLJBase.Resampler(
883+
;model=knn,
884+
measure=accuracy,
885+
operation=nothing,
886+
acceleration,
887+
)
888+
mach = machine(resampler, X, y) |> fit!
889+
890+
resampler.model = cnst
891+
fit!(mach)
892+
end
893+
880894
true

0 commit comments

Comments
 (0)