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