{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5778","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5778/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5778/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5778/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5778","id":116052468,"number":5778,"title":"Discretizer","user":{"login":"mblondel","id":233706,"avatar_url":"https://avatars.githubusercontent.com/u/233706?v=3","gravatar_id":"","url":"https://api.github.com/users/mblondel","html_url":"https://github.com/mblondel","followers_url":"https://api.github.com/users/mblondel/followers","following_url":"https://api.github.com/users/mblondel/following{/other_user}","gists_url":"https://api.github.com/users/mblondel/gists{/gist_id}","starred_url":"https://api.github.com/users/mblondel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mblondel/subscriptions","organizations_url":"https://api.github.com/users/mblondel/orgs","repos_url":"https://api.github.com/users/mblondel/repos","events_url":"https://api.github.com/users/mblondel/events{/privacy}","received_events_url":"https://api.github.com/users/mblondel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/New%20Feature","name":"New Feature","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-10T07:26:43Z","updated_at":"2015-11-10T12:29:39Z","closed_at":null,"body":"`Binarizer` transforms continuous values to two states (0 or 1). It would be nice to generalize this to an arbitrary number of states K. \r\n\r\nThis preprocessor would produce a scipy sparse matrix of shape (n_samples, K * n_features) using the one-of-K encoding. The K thresholds could be chosen uniformly between the min and max of each feature or using the K-quantiles. \r\n\r\nFor example, using uniformly chosen thresholds, if min=0, max=1.0 and K=3, a feature value between 0 and 0.33 would be encoded as [1, 0, 0], a value between 0.33 and 0.66 as [0, 1, 0] and a value between 0.66 and 1.0 as [0, 0, 1]. \r\n\r\nMy usecase is that this encoding might be more meaningful than continuous values when using `PolynomialFeatures`.\r\n\r\nPossibly related to #1062."},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/155408096","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5778#issuecomment-155408096","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5778","id":155408096,"user":{"login":"mblondel","id":233706,"avatar_url":"https://avatars.githubusercontent.com/u/233706?v=3","gravatar_id":"","url":"https://api.github.com/users/mblondel","html_url":"https://github.com/mblondel","followers_url":"https://api.github.com/users/mblondel/followers","following_url":"https://api.github.com/users/mblondel/following{/other_user}","gists_url":"https://api.github.com/users/mblondel/gists{/gist_id}","starred_url":"https://api.github.com/users/mblondel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mblondel/subscriptions","organizations_url":"https://api.github.com/users/mblondel/orgs","repos_url":"https://api.github.com/users/mblondel/repos","events_url":"https://api.github.com/users/mblondel/events{/privacy}","received_events_url":"https://api.github.com/users/mblondel/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T12:29:39Z","updated_at":"2015-11-10T12:29:39Z","body":"#4801 is not an implementation of what I proposed. Maybe we could have a `strategy` option (uniform, quantile, mdlp) in a `Discretizer` class."}}