Title: uncertainty query for 2d classifier output · Issue #185 · modAL-python/modAL · GitHub
Open Graph Title: uncertainty query for 2d classifier output · Issue #185 · modAL-python/modAL
X Title: uncertainty query for 2d classifier output · Issue #185 · modAL-python/modAL
Description: Hello, Thank you a lot for developing modAL and making it available ! 🙏 Though recently, I encountered an error and wonder if the proposed solution fits. While running this line learner.query(self.X_pool, n_instances=n) This error occurs...
Open Graph Description: Hello, Thank you a lot for developing modAL and making it available ! 🙏 Though recently, I encountered an error and wonder if the proposed solution fits. While running this line learner.query(self....
X Description: Hello, Thank you a lot for developing modAL and making it available ! 🙏 Though recently, I encountered an error and wonder if the proposed solution fits. While running this line learner.query(self....
Opengraph URL: https://github.com/modAL-python/modAL/issues/185
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"uncertainty query for 2d classifier output","articleBody":"Hello,\r\n\r\nThank you a lot for developing modAL and making it available ! :pray: \r\n\r\nThough recently, I encountered an error and wonder if the proposed solution fits.\r\n\r\nWhile running this line\r\n`learner.query(self.X_pool, n_instances=n)`\r\n\r\nThis error occurs\r\n\r\n\u003e \"modAL/models/base.py\", line 189, in query\r\n\u003e return query_result, retrieve_rows(X_pool, query_result)\r\n\u003e ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n\u003e \"modAL/utils/data.py\", line 122, in retrieve_rows\r\n\u003e raise TypeError(\"%s datatype is not supported\" % type(X))\r\n\u003e TypeError: \u003cclass 'numpy.ndarray'\u003e datatype is not supported\r\n\u003e \r\n\r\nHere is some context: \r\n- n = 20\r\n- X_pool.shape = (26, 384)\r\n- there are 35 classes in learner with KNeighborClassifier, it's multi-label setting.\r\n\r\nSo `classifier.predict_proba` returns 2D output for each class: list of 35 ndarrays of shape (26,2), which is not taken into account in `classifier_uncertainty` function from `ModAL/uncertainty.py`\r\n\r\nIn case of `NotFittedError` the function will return an array (26, 1), while if the model is fitted, it returns (35,2) instead of (26, 2)\r\n\r\nIt seems that adding a small piece of code should help:\r\n\r\n```\r\nclasswise_uncertainty = np.array(classwise_uncertainty)\r\nif len(classwise_uncertainty.shape)\u003e2: # or if classifier.estimator.outputs_2d_:\r\n classwise_uncertainty = classwise_uncertainty.max(axis=0)\r\n\r\n```\r\nMaybe there is a better solution for using multi-label classification ?\r\n\r\nThank you in advance :raised_hands: ","author":{"url":"https://github.com/liednik","@type":"Person","name":"liednik"},"datePublished":"2024-03-13T14:41:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/185/modAL/issues/185"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5d8a44d8-65b1-aa0e-e4c8-95f3f9497417 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C02:12C6F8:2AF58D:3A5A5A:698F258F |
| html-safe-nonce | f0180e0b7a37ffc07c512267613350b4283f2c6adaa7ff226e57cfccae2913c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzAyOjEyQzZGODoyQUY1OEQ6M0E1QTVBOjY5OEYyNThGIiwidmlzaXRvcl9pZCI6IjM0ODA5MzY0ODUzOTMyMTI4MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 37a58c60747e2e93e72dedf6b024fa13cc1cda6ac84b5b6bc591daeb788e2b92 |
| hovercard-subject-tag | issue:2184185334 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modAL-python/modAL/185/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6dad1ac0c69516430e3b3c826b80279f4774551c39ce1158bd2bb2b168010825/modAL-python/modAL/issues/185 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6dad1ac0c69516430e3b3c826b80279f4774551c39ce1158bd2bb2b168010825/modAL-python/modAL/issues/185 |
| og:image:alt | Hello, Thank you a lot for developing modAL and making it available ! 🙏 Though recently, I encountered an error and wonder if the proposed solution fits. While running this line learner.query(self.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | liednik |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6102991c714c1a6a27d05fb4f96ea6ca87a6750b4f093b95cc57ed1b84b145a1 |
| turbo-cache-control | no-preview |
| go-import | github.com/modAL-python/modAL git https://github.com/modAL-python/modAL.git |
| octolytics-dimension-user_id | 42179679 |
| octolytics-dimension-user_login | modAL-python |
| octolytics-dimension-repository_id | 110697473 |
| octolytics-dimension-repository_nwo | modAL-python/modAL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 110697473 |
| octolytics-dimension-repository_network_root_nwo | modAL-python/modAL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d52a41ad9b9ffb9b63a1b4a600a6054be8b70b36 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width