Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.4'
- '1.6'
- '1'
os:
- ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJParticleSwarmOptimization"
uuid = "17a086e9-ed03-4f30-ab88-8b63f0f6126c"
authors = ["Long Nguyen <[email protected]> and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand All @@ -12,6 +12,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Distributions = "0.25"
MLJBase = "0.18, 0.19, 0.20"
MLJBase = "0.18, 0.19, 0.20, 0.21"
MLJTuning = "0.6, 0.7"
julia = "1.4"
julia = "1.6"
12 changes: 8 additions & 4 deletions test/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@
state = PSO.initialize(rng, ranges, n)
PSO.retrieve!(rng, state)
params = state.parameters
@test params[1] == ["a", "a", "c"]
@test params[2] ≈ [553, 250, 375]
@test params[3] ≈ [3.9372495283243105, 3.6569395920512977, 3.6354556967115146]
@test params[4] ≈ [-0.8067647f0, 0.4209916f0, 0.6736019f0]
@test params[1] isa AbstractVector{<:AbstractString}
@test params[2] isa AbstractVector{<:Integer}
@test params[3] isa AbstractVector{<:AbstractFloat}
@test params[4] isa AbstractVector{<:AbstractFloat}
@test length(params[4]) == 3
@test all(params) do p
length(p) == n
end
end
end
2 changes: 1 addition & 1 deletion test/strategies/adaptive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ for acceleration in modes

tree = EvoTreeRegressor(rng=rng)
r1 = range(tree, :max_depth; values=[3:7;])
r2 = range(tree, :η; lower=-2, upper=0, scale=exp10)
r2 = range(tree, :eta; lower=-2, upper=0, scale=exp10)

baseline_self_tuning_tree = TunedModel(
model=tree,
Expand Down
2 changes: 1 addition & 1 deletion test/strategies/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for acceleration in (CPU1(), CPUProcesses(), CPUThreads())

tree = EvoTreeRegressor(rng=rng)
r1 = range(tree, :max_depth; values=[3:7;])
r2 = range(tree, :η; lower=-2, upper=0, scale=exp10)
r2 = range(tree, :eta; lower=-2, upper=0, scale=exp10)

baseline_self_tuning_tree = TunedModel(
model=tree,
Expand Down
6 changes: 4 additions & 2 deletions test/update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

@testset "Update personal best" begin
@test state.pbest == measurements
@test state.pbest_X ≈ [0.35710007620140427 0.37056803307520936 0.2723318907233864 2.7429797605672808 3.9372495283243105 -0.8067647083847199;
# https://github.com/JuliaAI/MLJParticleSwarmOptimization.jl/issues/27
@test_broken state.pbest_X ≈ [0.35710007620140427 0.37056803307520936 0.2723318907233864 2.7429797605672808 3.9372495283243105 -0.8067647083847199;
0.471258004384426 0.3400938657534834 0.18864812986209056 2.3976392099947 3.6569395920512977 0.420991611378423 ;
0.09661447846912713 0.19630556211862715 0.7070799594122457 2.5742724788985445 3.6354556967115146 0.6736019046580138]
end
Expand All @@ -52,4 +53,5 @@
@test all(state.gbest .== 0.1)
@test all(state.gbest_X .== state.pbest_X[2, :]')
end
end
end

Loading