ITADN

[BUG] `OneCoinDawidSkene` is broken after vesion `1.4.0`.

#127Closedtakumi1001 创建于 2025-01-11
bug
T
takumi1001commented
### Observed behavior In crowd-kit 1.4.0 and later, the following error occurs when running `fit_predict()` on `OneCoinDawidSkene`. Code (Same as the example in docs): ``` from crowdkit.aggregation import OneCoinDawidSkene from crowdkit.datasets import load_dataset df, gt = load_dataset('relevance-2') hds = OneCoinDawidSkene(100) result = hds.fit_predict(df) ``` Error: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-2-bc24fa88a4e5>](https://localhost:8080/#) in <cell line: 5>() 3 df, gt = load_dataset('relevance-2') 4 hds = OneCoinDawidSkene(100) ----> 5 result = hds.fit_predict(df) [/usr/local/lib/python3.10/dist-packages/crowdkit/aggregation/classification/dawid_skene.py](https://localhost:8080/#) in fit_predict(self, data, true_labels, initial_error) 378 """ 379 --> 380 self.fit(data, true_labels, initial_error) 381 assert self.labels_ is not None, "no labels_" 382 return self.labels_ TypeError: OneCoinDawidSkene.fit() takes 2 positional arguments but 4 were given ``` I believe the following commits are related to this issue: https://github.com/Toloka/crowd-kit/commit/e67d3a73bcec8898addf15da324da54b2e74629d ### Expected behavior The argument problem is fixed and the algorithm runs successfully. In `1.3.0.post0`, this issue is not caused. Thank you for reading my issue. I appreciate the all contributors of the crowd-kit. ### Python Version 3.1 ### Crowd-Kit Version 1.4.1 ### Other Packages Versions _No response_ ### Example code ```Python from crowdkit.aggregation import OneCoinDawidSkene from crowdkit.datasets import load_dataset df, gt = load_dataset('relevance-2') hds = OneCoinDawidSkene(100) result = hds.fit_predict(df) ``` ### Relevant log output ```shell --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-2-bc24fa88a4e5>](https://localhost:8080/#) in <cell line: 5>() 3 df, gt = load_dataset('relevance-2') 4 hds = OneCoinDawidSkene(100) ----> 5 result = hds.fit_predict(df) [/usr/local/lib/python3.10/dist-packages/crowdkit/aggregation/classification/dawid_skene.py](https://localhost:8080/#) in fit_predict(self, data, true_labels, initial_error) 378 """ 379 --> 380 self.fit(data, true_labels, initial_error) 381 assert self.labels_ is not None, "no labels_" 382 return self.labels_ TypeError: OneCoinDawidSkene.fit() takes 2 positional arguments but 4 were given ```
关闭于 2025-01-14 3 条评论