Scale transform changes aggregate results
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
提供された Python の例から始め、座標系、変換、集約を扱っているチュートリアルを確認してください。Scale が sum と mean の集約結果をどのように変えるかを確認し、対象座標系の影響が明確になるよう関連するチュートリアルを更新して、例が引き続き理解しやすいことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 394
- フォーク
- 95
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 3
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scverse/spatialdata のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
scverse/spatialdata#1256 ·
メンテナーはふだん 2 日以内に返信
-
bug 🚨 element: labels 🏷️ method: aggregation 🔢 needs: triage priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
scverse/spatialdata#1249 ·
メンテナーはふだん 2 日以内に返信
-
bug 🚨 element: images 🌌 element: labels 🏷️ needs: triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scverse/spatialdata#1239 ·
メンテナーはふだん 2 日以内に返信
-
bug 🚨 element: shapes ▲ models needs: triage priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scverse/spatialdata#1234 ·
メンテナーはふだん 2 日以内に返信
-
bug 🚨 element: labels 🏷️ method: aggregation 🔢 needs: triage priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scverse/spatialdata#1230 ·
メンテナーはふだん 2 日以内に返信
scverse/spatialdata の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
instance instance add
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
searxng/searx-instances#941 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
FluidNumerics/fluid-walk-blocker#89 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信