File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ isrevertible(::Type{StdFeats}) = true
1818_stdfun (x) = _stdfun (elscitype (x), x)
1919_stdfun (:: Type , x) = identity, identity
2020function _stdfun (:: Type{Continuous} , x)
21- μ = mean (x )
22- σ = std (x , mean= μ)
21+ μ = mean (skipmissing (x) )
22+ σ = std (skipmissing (x) , mean= μ)
2323 stdfun = x -> zscore (x, μ, σ)
2424 revfun = y -> revzscore (y, μ, σ)
2525 stdfun, revfun
Original file line number Diff line number Diff line change 2323 @test tₒ. c == t. c
2424 @test tₒ. d ≈ t. d
2525 @test tₒ. e == t. e
26+
27+ # missing values
28+ a = [rand (1 : 10 , 99 ); missing ]
29+ b = [rand (Normal (7 , 10 ), 99 ); missing ]
30+ t = Table (; a, b)
31+ T = StdFeats ()
32+ n, c = apply (T, t)
33+ @test isequal (n. a, t. a)
34+ @test isapprox (mean (skipmissing (n. b)), 0 ; atol= 1e-6 )
35+ @test isapprox (std (skipmissing (n. b)), 1 ; atol= 1e-6 )
2636end
You can’t perform that action at this time.
0 commit comments