Skip to content

Commit

Permalink
Test application of IdentityScaling() does nothing (#113)
Browse files Browse the repository at this point in the history
* Test application of `IdentityScaling()` does nothing

* Test `DataFrame` and `NamedDimsArray`
  • Loading branch information
mjp98 authored Oct 31, 2022
1 parent cc299dc commit ee13296
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
@test IdentityScaling(123) == IdentityScaling()
@test IdentityScaling([1, 2, 3]) == IdentityScaling()
end

@testset "Transform does nothing" begin
x = ones(2, 3, 4)
@test FeatureTransforms.apply(x, IdentityScaling()) == x
@test FeatureTransforms.apply(x, IdentityScaling()) isa Array

table = DataFrame((a=[1, 2, 3], b=[4, 5, 6]))
@test FeatureTransforms.apply(table, IdentityScaling(); header=(:a, :b)) == table
@test FeatureTransforms.apply(table, IdentityScaling(); header=(:a, :b)) isa DataFrame

na = NamedDimsArray([1 2 3; 4 5 6], foo=["a", "b"], bar=[:x, :y, :z])
@test FeatureTransforms.apply(na, IdentityScaling()) == na
@test FeatureTransforms.apply(na, IdentityScaling()) isa NamedDimsArray
end
end

@testset "StandardScaling" begin
Expand Down

0 comments on commit ee13296

Please sign in to comment.