How to bin integral vs floating point correctly (precision issue and general question)
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
issue ではソースファイルもテストも指定されていないため、まず整数データ、[min, max+1] の境界、空の最後のビンを使って、浮動小数点精度のヒストグラムのケースを再現します。ヒストグラムのビニングのエントリポイントと、整数範囲に関する既存のガイダンスを確認します。精度の挙動と推奨される整数の境界が解決・文書化され、報告されたケースのカバレッジが追加されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Dear @HDembinski and other authors, thanks for this awesome library. We have just started using it and the speed and versatility are impressive! We have a problem that manifests as a precision problem, but also shows a more general question.
The problem: We use the floating precision histogram to bin any kind of data. When we bin data (gray value camera images) of integer precision, we set lower and upper bound based on the data range to [min, max+1] and the number of bins to upper bound - lower bound. However there are sometimes cases where the numeric precision then leads to an empty last bin. This is due to rounding error, the values fall into max-1 instead of max. We checked and the bin index is then computed as (max-1).999... which finally resolves to max-1. Is there a good solution to this? It leads to confusion that the last bin is empty, and its also a bit problematic in writing tests.
The underlying question: We are not completely certain what is a "recommended" way to set histogram bounds for integral data space. Are there common guidelines? In floating point precision it is more understandable what data range is covered by each bin. But in integral space, it seems the value 0 could be best represented by bin [-0.5, 0.5) rather than the more obvious [0, 1). And help, links or pointers to documentation would be highly appreciated!
- 主要言語
- C++
- スター
- 334
- フォーク
- 75
- 平均マージ
- 18時間 2分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/histogram のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
-
Mixed scalar/array `fill` zeroes the whole histogram when a non-inclusive axis drops the first entry再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
axes should provide strong exception guarantee for metadata対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
boostorg/histogram の issue をすべて見る
似ている issue
-
bug priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
chipsalliance/verible#2644 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
grafana/pyroscope-dotnet#470 ·
メンテナーはふだん 1 日以内に返信
-
documentation P5 XS
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-astro/AlpacaBridge#1848 ·
メンテナーはふだん 1 日以内に返信
-
DiskANN AnnIterator returns unconverted IP distances after the graph walk runs out of candidatesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
zilliztech/knowhere#1933 ·
メンテナーはふだん 1 日以内に返信