Skip to content

Commit 6ea3f23

Browse files
authored
Merge pull request #37 from JuliaAI/dev
For a 0.3.1 release
2 parents bd8f263 + 0dc2190 commit 6ea3f23

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJMultivariateStatsInterface"
22
uuid = "1b6a4a23-ba22-4f51-9698-8599985d3728"
33
authors = ["Anthony D. Blaom <[email protected]>", "Thibaut Lienart <[email protected]>", "Okon Samuel <[email protected]>"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"

src/models/decomposition_models.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ end
168168
function MMI.fit(model::ICA, verbosity::Int, X)
169169
icagfun(fname::Symbol, ::Type{T} = Float64) where T<:Real=
170170
fname == :tanh ? MS.Tanh{T}(1.0) :
171-
fname == :gaus ? MS.Gaus{T}() :
171+
fname == :gaus ? MS.Gaus() :
172172
error("Unknown gfun $(fname)")
173173

174174
Xarray = MMI.matrix(X)

test/models/decomposition_models.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,32 @@ end
4949
winit=randn(rng, eltype(X_array), size(X_array, 2), k))
5050
test_composition_model(ica_ms, ica_mlj, X, X_array, test_inverse=false)
5151
end
52+
@testset "ICA2" begin
53+
X_array = matrix(X)
54+
k = 5
55+
tolerance = 5.0
56+
# MultivariateStats ICA
57+
rng = StableRNG(1234) # winit gets randomly initialised
58+
#Random.seed!(1234) # winit gets randomly initialised
59+
ica_ms = MultivariateStats.fit(
60+
MultivariateStats.ICA,
61+
permutedims(X_array),
62+
k;
63+
tol=tolerance,
64+
fun=MultivariateStats.Gaus(),
65+
winit = randn(rng, eltype(X_array), size(X_array, 2), k)
66+
)
67+
# MLJ ICA
68+
rng = StableRNG(1234) # winit gets randomly initialised
69+
#Random.seed!(1234) # winit gets randomly initialised
70+
ica_mlj = ICA(
71+
k=k,
72+
tol=tolerance,
73+
fun=:gaus,
74+
winit=randn(rng, eltype(X_array), size(X_array, 2), k))
75+
test_composition_model(ica_ms, ica_mlj, X, X_array, test_inverse=false)
76+
end
77+
5278

5379
@testset "PPCA" begin
5480
X_array = matrix(X)

0 commit comments

Comments
 (0)