{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3886","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3886/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3886/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3886/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3886","id":50074329,"number":3886,"title":"[MRG+1-1] Add transform fields option to FeatureUnion","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":34,"created_at":"2014-11-25T19:44:40Z","updated_at":"2015-06-03T18:48:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3886","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3886","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/3886.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/3886.patch"},"body":"Fixes #2034.\r\n\r\nTodo:\r\n* [x] Docstrings\r\n* [x] Simple example\r\n* [x] Test\r\n\r\nAlso see [here](http://zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html) for how this would help people."},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/108571843","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3886#issuecomment-108571843","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3886","id":108571843,"user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T18:48:17Z","updated_at":"2015-06-03T18:48:17Z","body":"The conclusion of my discussion with @GaelVaroquaux was to put it under a different name in the FeatureExtraction module.\r\nThe problem that I had with that is that the way the code is currently written, that would mean copying the whole code with a little change.\r\nThe other option would be to put the new class in the feature_extraction module, and let FeatureUnion inherit from it without support for \"fields\" (which will be renamed columns btw).\r\n\r\nSo the current FeatureUnion would have the same old behavior, but there would be ``feature_extraction.ColumnTransformer`` that has a ``columns`` parameter. Maybe the ``columns`` parameter will even be required, so the constructor could look like:\r\n\r\n```python\r\nColumnTransformer({'column_name1': CountVectorizer(), 'column_name2': OneHotEncoder()})"}}