Skip to content

Commit

Permalink
Change labels from strings to symbols in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
englhardt committed Nov 5, 2018
1 parent 2b635c5 commit 7fc6209
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/classifiers/classifier_svdd_neg_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
actual = SVDD.predict(svdd_neg, dummy_data)

@test_broken expected actual
@test sum(actual .> 0) == sum(labels .== "outlier")
@test sum(actual .> 0) == sum(labels .== :outlier)
end

@testset "with outlier examples" begin
Expand All @@ -51,7 +51,7 @@
SVDD.fit!(svdd_neg, TEST_SOLVER)
predictions = SVDD.predict(svdd_neg, dummy_data)
@test sum(predictions .> 0) == 0
pools[labels .== "outlier"] .= :Lout
pools[labels .== :outlier] .= :Lout

SVDD.set_pools!(svdd_neg, pools)
@test_throws SVDD.ModelStateException SVDD.predict(svdd_neg, dummy_data)
Expand All @@ -72,7 +72,7 @@
expected = SVDD.predict(svdd_neg, dummy_data)
@test sum(expected .> 0) > 0

pools[labels .== "inlier"] .= :Lin
pools[labels .== :inlier] .= :Lin
SVDD.set_pools!(svdd_neg, pools)

SVDD.fit!(svdd_neg, TEST_SOLVER)
Expand Down
4 changes: 2 additions & 2 deletions test/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ function generate_mvn_with_outliers(n_dim, n_observations,

if incl_outliers
x = hcat(inliers, outliers)
labels = vcat(fill("inlier", n_observations), fill("outlier", 8))
labels = vcat(fill(:inlier, n_observations), fill(:outlier, 8))
else
x = inliers
labels = vcat(fill("inlier", n_observations))
labels = vcat(fill(:inlier, n_observations))
end
if normalized
x = mapslices(normalize, x, dims=2)
Expand Down

0 comments on commit 7fc6209

Please sign in to comment.