Mutating labels when training MulticlassLDA
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- machine-learning
Research direction
Start at src/lda.jl around line 522 and inspect how toindices handles integer labels during MulticlassLDA training and decoding. Reproduce the separate-training-and-test case, including labels with gaps, and verify that converting labels does not mutate the caller's labels or randomize class assignments.
Written by the indexing model from the issue text.
Description
This recent change really threw a wrench into my pipeline:
https://github.com/JuliaStats/MultivariateStats.jl/blob/bf15ed047bb44dc3f2ebc5db73a9b43df3a55059/src/lda.jl#L522
I am training LDAs on one set of trials and testing the decoding performance on a separate set of trials. All of a sudden, my performance dropped to chance and after about a day of digging around, I realised that toindices actually mutates the label names. In other words, when I was decoding the testset by finding the projected mean that each sample was closest to, I was using the original labels for my testing, and so the class assignments were all essentially random.
As a stopgap measure for my pipeline, I defined
MultivariateStats.toindices(label::AbstractVector{T}) where T <: Integer = label
which fixed my issue, but I realise that this is not general solution. In particular, if there are gaps in label, such that maximum(label) !== length(unique(label)), this could also cause problems.
Is there currently an array type that fulfils that criteria?
- 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