Scale transform changes aggregate results
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
Comienza con el ejemplo de Python proporcionado y revisa los tutoriales que cubren sistemas de coordenadas, transformaciones y agregación. Confirma cómo Scale cambia los resultados agregados para sum y mean; después, actualiza el tutorial relevante para que el efecto del sistema de coordenadas de destino sea explícito y verifica que el ejemplo siga siendo comprensible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hey everyone,
as mentioned on Zulip I am using macsima data, where the macsima reader by default adds the Scale transformation to the coordinate system. I noticed that when I remove this my aggregation results are slightly different. This is most prominent for small signals, for larger signals it is not so pronounced. My original use case was for the mean intensity. For sum its very obvious that the absolute values change due to the transform, but the ratios stay similar.
Of course I understand that it makes sense to apply the transform before doing the aggregation, since they are intended for example for aligning my labels with the image. Still it was a bit unintuitive for me that this happens as a new user. Maybe this could be highlighted also a bit more in the tutorials. As requested below is a small example.
import spatialdata as sd
from spatialdata.datasets import blobs
from spatialdata.transformations import set_transformation, Scale
sdata = blobs()
# set scale transformation to new coordinate system. global coord system has Identity transform
scale_transform = Scale([0.1, 0.1], ("x", "y"))
set_transformation(sdata["blobs_image"], transformation=scale_transform, to_coordinate_system="scaled")
set_transformation(sdata["blobs_labels"], transformation=scale_transform, to_coordinate_system="scaled")
global_sum = sdata.aggregate(values="blobs_image", by="blobs_labels", target_coordinate_system="global")
print(global_sum["table"].X[:1])
#<Compressed Sparse Row sparse matrix of dtype 'float64'
# with 3 stored elements and shape (1, 3)>
# Coords Values
# (0, 0) 1309.3692551660652
# (0, 1) 1587.8641823936478
# (0, 2) 3125.1190857645483
scaled_sum = sdata.aggregate(values="blobs_image", by="blobs_labels", target_coordinate_system="scaled")
print(scaled_sum["table"].X[:1])
#<Compressed Sparse Row sparse matrix of dtype 'float64'
# with 3 stored elements and shape (1, 3)>
# Coords Values
# (0, 0) 12.758250581405642
# (0, 1) 15.427204091295
# (0, 2) 31.23271691509622
global_mean = sdata.aggregate(values="blobs_image", by="blobs_labels", agg_func="mean", target_coordinate_system="global")
print(global_mean["table"].X[:1])
#<Compressed Sparse Row sparse matrix of dtype 'float64'
# with 3 stored elements and shape (1, 3)>
# Coords Values
# (0, 0) 0.08696083251418378
# (0, 1) 0.10545687603066001
# (0, 2) 0.20755257260839133
scaled_mean = sdata.aggregate(values="blobs_image", by="blobs_labels", agg_func="mean", target_coordinate_system="scaled")
print(scaled_mean["table"].X[:1])
#<Compressed Sparse Row sparse matrix of dtype 'float64'
# with 3 stored elements and shape (1, 3)>
# Coords Values
# (0, 0) 0.08449172570467313
# (0, 1) 0.10216691451188742
# (0, 2) 0.2068391848681869
- Lenguaje dominante
- Python
- Estrellas
- 394
- Forks
- 95
- Merge medio
- 5 d 9 h
- PR fusionados (30 d)
- 3
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scverse/spatialdata
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
scverse/spatialdata#1256 ·
Los mantenedores suelen responder en 2 días
-
bug 🚨 element: labels 🏷️ method: aggregation 🔢 needs: triage priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
scverse/spatialdata#1249 ·
Los mantenedores suelen responder en 2 días
-
bug 🚨 element: images 🌌 element: labels 🏷️ needs: triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scverse/spatialdata#1239 ·
Los mantenedores suelen responder en 2 días
-
bug 🚨 element: shapes ▲ models needs: triage priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scverse/spatialdata#1234 ·
Los mantenedores suelen responder en 2 días
-
bug 🚨 element: labels 🏷️ method: aggregation 🔢 needs: triage priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scverse/spatialdata#1230 ·
Los mantenedores suelen responder en 2 días
Todos los issues de scverse/spatialdata
Issues similares
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
workflow: a tick's dispatch counts as 'only this step', and no review self-grants a round unattendedAbiertoworkflow
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kristofdegrave/homeassistant-smart-charging#1505 ·
Los mantenedores suelen responder en 1 día
-
New Submission: TropWATERAbiertometadata submission
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Wrongly named dashboard variableAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
canonical/content-cache-operator#163 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[submission]Abiertosubmission
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
leanprover/lean-eval-submissions#1852 ·
Los mantenedores suelen responder en 1 día