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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dd4560892d89a85e39ed1e73474268724f2f55fca39f1471e9e490e2044168c
4
- data.tar.gz: d960989693373e6ce7afe0ddcec17bc88e59addafb89d5269fa67ef52bb9b299
3
+ metadata.gz: a6d66ad26316914f34f043aa0ac1cad2ebd0756db251bb893475d9ab41b70749
4
+ data.tar.gz: 0663d597f9a6781923be49c80642b0bb70689c11c9f4557497880cfc8128477b
5
5
  SHA512:
6
- metadata.gz: 3e2616a2e442dd2c764e5dd3d020a7ba7086f40ba24acca442e272db358817727e4bbaa6c57e84b87fea7c3e64103a6c6a741d7cac24f29f72504708a086b6ea
7
- data.tar.gz: 99ea57a135e7f4265245f246f908af5b821b4780ffbf9cafe8f68c94c9d63124e4298666b106c556ccbb9c9aa1be75bb45e690747f9c063fc1616ee053553248
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 { |r| r[:confidence] >= range[:min] && r[:confidence] < range[:max] }
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Decisions
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-decisions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto