{"action":"created","issue":{"url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/321","repository_url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick","labels_url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/321/labels{/name}","comments_url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/321/comments","events_url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/321/events","html_url":"https://github.com/DistrictDataLabs/yellowbrick/pull/321","id":302345641,"number":321,"title":"Class Balance Heat Map Visualizer","user":{"login":"lwgray","id":1000117,"avatar_url":"https://avatars2.githubusercontent.com/u/1000117?v=4","gravatar_id":"","url":"https://api.github.com/users/lwgray","html_url":"https://github.com/lwgray","followers_url":"https://api.github.com/users/lwgray/followers","following_url":"https://api.github.com/users/lwgray/following{/other_user}","gists_url":"https://api.github.com/users/lwgray/gists{/gist_id}","starred_url":"https://api.github.com/users/lwgray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwgray/subscriptions","organizations_url":"https://api.github.com/users/lwgray/orgs","repos_url":"https://api.github.com/users/lwgray/repos","events_url":"https://api.github.com/users/lwgray/events{/privacy}","received_events_url":"https://api.github.com/users/lwgray/received_events","type":"User","site_admin":false},"labels":[{"id":545742505,"url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/labels/review","name":"review","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-03-05T15:34:08Z","updated_at":"2018-03-10T20:57:28Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/pulls/321","html_url":"https://github.com/DistrictDataLabs/yellowbrick/pull/321","diff_url":"https://github.com/DistrictDataLabs/yellowbrick/pull/321.diff","patch_url":"https://github.com/DistrictDataLabs/yellowbrick/pull/321.patch"},"body":"In this PR I've implemented a ClassBalanceHeatMap visualizer based on @bbengfort  prototype code .  I was asked by @rebeccabilbro to take a crack at this implementation.  \r\n\r\nThis visualizer is a heatmap implementation of the class balance visualizer.  It is being added because the heatmap provides a way to quickly understand how good your classifier is at predicting the right classes.\r\n\r\nTake for instance,  the sklearn digits data set (see below) with 10 classes.  The heatmap displays data as a stacked bar chart.  On the X axis are the different classes. The Y axis is a count of how many times your model predicted a certain class.  For example... The second bar shows the total number of instances where a Class 1 prediction was assigned.  Additionally, each bar is color coded  to show the number of predicted class.  In the case of the second bar, it shows three colors with the following counts, Class 1(Purple, 50), Class 8 (Red, 3), Class 9(Grey, 1).  This means that of the total number of \"Class 1\" predictions, 92.5% were actually \"Class 1\", 5.5% were \"Class 8\" and 2% were \"Class 9\"\r\n\r\n![heatmap](https://user-images.githubusercontent.com/1000117/36981588-8e540cec-205b-11e8-8219-c5f6b94ff5ca.png)\r\n\r\n### HELP\r\n\r\n#### Major Issue\r\nIf I build the visualizer in a python notebook as seen [here](https://github.com/lwgray/ddl/blob/master/yellowbrick/heatmap.ipynb) it works.  \r\n\r\nHowever, if I write the visualizer into yellowbrick/classifier/class_balance_heat_map.py (in this pull request) I receive a RuntimeError: Invalid DISPLAY variable.  I can provide the traceback if required.\r\n\r\n#### To Do\r\n\r\n\r\n- [x] Graphics - \r\n**Strike throughs are being left as user-defined parameters**\r\n    - [x] ~~Fix axis labels~~\r\n    - [x] ~~Fix axis ticks~~\r\n    - [x] ~~Draw box around legend~~\r\n    - [x] ~~Get rid of grid lines in Figure~~\r\n    - [x] Set ylim of chart so that there exists space between bars and chart border\r\n\r\n- [ ] Tests\r\n    - [ ] Test1: Test that indices and classes are the same length.  Here are two instances to test\r\n        - [ ] This would be the case where more labels are supplied in our test data, via score than in our training data; \r\n        - [ ] if there are less labels in y and y_pred, that's fine - we just need to ensure there are zeros for the fit classes that do not have any associated values\r\n- [ ] Documentation\r\n     - [x] Create Example Notebook\r\n     - [ ] Review docstrings - Bad wording\r\n     - [ ] class_prediction_error.py/rst doc files\r\n- [ ] Issues\r\n    - [x] Open issue regarding self.score_ and self.classes_ nomenclature\r\n           throughout yellowbrick.  see @bbengfort @ndanielsen comments below \r\n    - [ ] Open up an issue to create the target module as per @rebeccabilbro\r\n- [x] Misc\r\n    - [x] Correct RuntimeError\r\n    - [x] Perform _check_target on y and y_pred - raise YellowbrickValueError\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/comments/372066062","html_url":"https://github.com/DistrictDataLabs/yellowbrick/pull/321#issuecomment-372066062","issue_url":"https://api.github.com/repos/DistrictDataLabs/yellowbrick/issues/321","id":372066062,"user":{"login":"bbengfort","id":745966,"avatar_url":"https://avatars0.githubusercontent.com/u/745966?v=4","gravatar_id":"","url":"https://api.github.com/users/bbengfort","html_url":"https://github.com/bbengfort","followers_url":"https://api.github.com/users/bbengfort/followers","following_url":"https://api.github.com/users/bbengfort/following{/other_user}","gists_url":"https://api.github.com/users/bbengfort/gists{/gist_id}","starred_url":"https://api.github.com/users/bbengfort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbengfort/subscriptions","organizations_url":"https://api.github.com/users/bbengfort/orgs","repos_url":"https://api.github.com/users/bbengfort/repos","events_url":"https://api.github.com/users/bbengfort/events{/privacy}","received_events_url":"https://api.github.com/users/bbengfort/received_events","type":"User","site_admin":false},"created_at":"2018-03-10T20:57:28Z","updated_at":"2018-03-10T20:57:28Z","author_association":"OWNER","body":"@lwgray tests have been fixed - if you hit the \"update branch\" button and then do a pull your local branch should have the tests fixed as well. "}}
{"actor":{"display_login":"bbengfort"}}