ask-decisions 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/ask/decisions/calibration_report.rb +10 -2
- data/lib/ask/decisions/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a6d66ad26316914f34f043aa0ac1cad2ebd0756db251bb893475d9ab41b70749
|
|
4
|
+
data.tar.gz: 0663d597f9a6781923be49c80642b0bb70689c11c9f4557497880cfc8128477b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6dd919a98dd01107d2ea456c653ffbdf31d5580a2d02a19fe0769ffffa32bf2285b5547f3e0f63b1c40d3fb6de32e65ee1371a14127ed9b367a39e5cd1d022a
|
|
7
|
+
data.tar.gz: '0493127671b11ccaa3306ce7efea04c11b9395ca5d63b61ee50e9894e45738e0170dfc3ea5c7082566d25d675bd5311795c1f08f98621dcd8538f353a4f961e1'
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [0.2.2] - 2026-09-18
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **A confidence of exactly 1.0 lands in the top band of
|
|
12
|
+
`CalibrationReport#summarize`.** The bands were half-open at both ends
|
|
13
|
+
(`min <= confidence < max`), so the surest answer a decider can give — 1.0,
|
|
14
|
+
and in practice the most common one — belonged to no band at all. A report
|
|
15
|
+
written for setting a threshold was quietly dropping the decisions that most
|
|
16
|
+
justify one. The top band is now inclusive of 1.0.
|
|
17
|
+
|
|
7
18
|
## [0.2.1] - 2026-09-17
|
|
8
19
|
|
|
9
20
|
### Added
|
|
@@ -125,9 +125,14 @@ module Ask
|
|
|
125
125
|
end
|
|
126
126
|
|
|
127
127
|
# Bucket records by confidence ranges.
|
|
128
|
+
#
|
|
129
|
+
# The top band includes 1.0: a confidence of exactly 1.0 is the most
|
|
130
|
+
# common answer a calibrated decider gives, and with the upper bound
|
|
131
|
+
# exclusive it fell out of every band — so the surest decisions were
|
|
132
|
+
# the ones the report never showed.
|
|
128
133
|
def bucket_by_confidence(records)
|
|
129
134
|
ranges = [
|
|
130
|
-
{ min: 0.9, max: 1.0, label: "0.9–1.0" },
|
|
135
|
+
{ min: 0.9, max: 1.0, label: "0.9–1.0", top: true },
|
|
131
136
|
{ min: 0.7, max: 0.9, label: "0.7–0.9" },
|
|
132
137
|
{ min: 0.5, max: 0.7, label: "0.5–0.7" },
|
|
133
138
|
{ min: 0.3, max: 0.5, label: "0.3–0.5" },
|
|
@@ -135,7 +140,10 @@ module Ask
|
|
|
135
140
|
]
|
|
136
141
|
|
|
137
142
|
ranges.filter_map do |range|
|
|
138
|
-
bucket = records.select
|
|
143
|
+
bucket = records.select do |r|
|
|
144
|
+
r[:confidence] >= range[:min] &&
|
|
145
|
+
(range[:top] ? r[:confidence] <= range[:max] : r[:confidence] < range[:max])
|
|
146
|
+
end
|
|
139
147
|
next if bucket.empty?
|
|
140
148
|
correct = bucket.count { |r| r[:predicted] == r[:outcome] }
|
|
141
149
|
acc = correct.to_f / bucket.size
|