MDS: supply Gram matrix directly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- julia
- Ambito
- data-visualization
Direzione di ricerca
Inizia individuando gli entry point esistenti per il fit MDS e le conversioni dmat2gram e gram2dist menzionate nell’issue. Confronta i percorsi attuali per coordinate e distanze prima di definire l’API di tagging dell’input; il lavoro è completato quando l’input diretto di una matrice di Gram è supportato senza compromettere il comportamento esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Currently the pipeline for MDS is X -> D -> G -> M, where X is a coordinate representation of the data, D is the pairwise distance matrix, G is the Gram matrix, and M is the final MDS model. One can alternatively go D -> G -> M by supplying the distances=true keyword. However, there are applications where the natural thing to supply is G. For example, if you are working with objects for which there is a natural inner product, and you want to visualize these objects in a lower-dimensional space, you're going to first compute G, and it would be quite silly to use fit(MDS, gram2dist(G); distances=true) when the first thing that will happen inside fit is to convert the distances back into the Gram matrix.
I know there isn't a ton of stuff inside fit that happens after you have G, but from the standpoint of keeping things in sync I think it would be best to expose this to the user instead of forcing them to create their own private version of fit.
The only hard problem is deciding the API. I think a good design would be
struct Distances{M<:AbstractMatrix}
D::M
end
struct Gramian{M<:AbstractMatrix}
G::M
end
fit(::Type{MDS}, X::AbstractMatrix) = fit(MDS, Distances(L2distance(X)))
fit(::Type{MDS}, D::Distances) = fit(MDS, Gramian(dmat2gram(D.D)))
function fit(::Type{MDS}, G::Gramian)
# the "main" implementation
end
Then users call one of:
fit(MDS, X)fit(MDS, Distances(D))fit(MSD, Gramian(G))
depending on what kind of starting point they have.
One alternative approach is to use a keyword argument, but here we would run into a compatibility problem: if we add gramian::Bool=false as a keyword, then we have to look for the case where distances == gramian == true and throw an error. This is not a big deal but it feels a bit ugly. Alternatively we could add interpretation=:coordinates and support the settings :distances and :gramian but that would be a breaking change. We can do a breaking change, but it seems to be a bit silly for a very minor change. With the "type tagging" of the input data, we could have fit(::Type{MDS}, X::AbstractMatrix) still support the distances kwarg but give a deprecation warning, and then we can remove that API whenever other more substantive changes force a breaking release.
- Lingua principale
- Julia
- Stelle
- 387
- Fork
- 83
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaStats/MultivariateStats.jl
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
tagbot-manual
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
JuliaStats/MultivariateStats.jl#238 · 1 commento ·
-
Return a result even when MetricMDS does not convergeForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
JuliaStats/MultivariateStats.jl#233 · 1 commento ·
-
How to use MetricMDSAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
JuliaStats/MultivariateStats.jl#231 · 2 commenti ·
Tutte le issue di JuliaStats/MultivariateStats.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaGPU/KernelAbstractions.jl#897 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oscar-system/GAP.jl#1455 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
JuliaAI/MLJTransforms.jl#85 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SciML/OrdinaryDiffEq.jl#4875 ·
I maintainer di solito rispondono entro 4 giorni