| 1304 | |
| 1305 | |
| 1306 | class NuniqueApprox(Reduction): |
| 1307 | _parameters = ["frame", "b", "split_every"] |
| 1308 | _defaults = {"b": 16, "split_every": None} |
| 1309 | reduction_chunk = hyperloglog.compute_hll_array |
| 1310 | reduction_combine = hyperloglog.reduce_state |
| 1311 | reduction_aggregate = hyperloglog.estimate_count |
| 1312 | |
| 1313 | @functools.cached_property |
| 1314 | def _meta(self): |
| 1315 | return 1.0 |
| 1316 | |
| 1317 | @property |
| 1318 | def chunk_kwargs(self): |
| 1319 | return {"b": self.b} |
| 1320 | |
| 1321 | @property |
| 1322 | def combine_kwargs(self): |
| 1323 | return self.chunk_kwargs |
| 1324 | |
| 1325 | @property |
| 1326 | def aggregate_kwargs(self): |
| 1327 | return self.chunk_kwargs |
| 1328 | |
| 1329 | |
| 1330 | class ReductionConstantDim(Reduction): |