CCA results do not match sklearn.cross_decomposition.CCA
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- data, machine-learning
Research direction
Start with the CCA fit(CCA, X, Y; outdim=1) and xtransform(m, X) entry points shown in the report, then compare their outputs with sklearn.cross_decomposition.CCA on the supplied matrices. Determine whether the mismatch is expected or indicates a package issue, and document or test the behavior so reproduction is clear.
Written by the indexing model from the issue text.
Description
Hello,
When using CCA, we (@trappmartin and I) tried to reproduce the results from sklearn.cross_decomposition.CCA
>>> from sklearn.cross_decomposition import CCA
>>> X = [[0., 0., 1.], [1.,0.,0.], [2.,2.,2.], [3.,5.,4.]]
>>> Y = [[0.1, -0.2], [0.9, 1.1], [6.2, 5.9], [11.9, 12.3]]
>>> cca = CCA(n_components=1)
>>> cca.fit(X, Y)
CCA(n_components=1)
>>> X_c, Y_c = cca.transform(X, Y)
>>> X_c
array([[-1.3373174 ],
[-1.10847164],
[ 0.40763151],
[ 2.03815753]])
with the following
julia> Y = reduce(hcat, [[0.1, -0.2], [0.9, 1.1], [6.2, 5.9], [11.9, 12.3]])
julia> X = reduce(hcat, [[0., 0., 1.], [1.,0.,0.], [2.,2.,2.], [3.,5.,4.]])
julia> m = fit(CCA, X, Y; outdim=1)
CCA (xindim = 3, yindim = 2, outdim = 1)
julia> xtransform(m, X)
1×4 Matrix{Float64}:
0.867677 0.678174 -0.228687 -1.31716
but found out that the results do not match.
We could not figure out if it is due to our code or the package.
Is there a way to reproduce the results from sklearn?
- Dominant language
- Julia
- Stars
- 387
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaStats/MultivariateStats.jl
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
tagbot-manual
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
JuliaStats/MultivariateStats.jl#238 · 1 comment ·
-
Return a result even when MetricMDS does not convergePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaStats/MultivariateStats.jl#233 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
All issues in JuliaStats/MultivariateStats.jl
Similar issues
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`Possibly taken @devmotion claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaStats/Distributions.jl#2117 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
TomerAberbach/profiler-md#970 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
grame-cncm/faust#1409 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
SciML/PETScDiffEq.jl#521 ·
Maintainers usually reply within 1 day