Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For a 1.1.1 release #955

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/resampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,15 @@ function MLJModelInterface.update(
mach, e = fitresult
train_test_rows = e.train_test_rows

measures = e.measure
operations = e.operation
# since `resampler.model` could have changed, so might the actual measures and
# operations that should be passed to the (low level) `evaluate!`:
measures = _actual_measures(resampler.measure, resampler.model)
operations = _actual_operations(
resampler.operation,
measures,
resampler.model,
verbosity
)

# update the model:
mach2 = _update!(mach, resampler.model)
Expand Down
20 changes: 17 additions & 3 deletions test/resampling.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#module TestResampling

using Distributed
import ComputationalResources: CPU1, CPUProcesses, CPUThreads
using .TestUtilities
Expand Down Expand Up @@ -876,5 +874,21 @@ end
@test contains(printed_evaluations, "N/A")
end

#end
@testset_accelerated "issue with Resampler #954" acceleration begin
knn = KNNClassifier()
cnst =DeterministicConstantClassifier()
X, y = make_blobs(10)

resampler = MLJBase.Resampler(
;model=knn,
measure=accuracy,
operation=nothing,
acceleration,
)
mach = machine(resampler, X, y) |> fit!

resampler.model = cnst
fit!(mach)
end

true
Loading