{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4543","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4543/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4543/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4543/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4543","id":67017319,"number":4543,"title":"Pipeline on labels_ instead of just transforms","user":{"login":"selwyth","id":3229766,"avatar_url":"https://avatars.githubusercontent.com/u/3229766?v=3","gravatar_id":"","url":"https://api.github.com/users/selwyth","html_url":"https://github.com/selwyth","followers_url":"https://api.github.com/users/selwyth/followers","following_url":"https://api.github.com/users/selwyth/following{/other_user}","gists_url":"https://api.github.com/users/selwyth/gists{/gist_id}","starred_url":"https://api.github.com/users/selwyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selwyth/subscriptions","organizations_url":"https://api.github.com/users/selwyth/orgs","repos_url":"https://api.github.com/users/selwyth/repos","events_url":"https://api.github.com/users/selwyth/events{/privacy}","received_events_url":"https://api.github.com/users/selwyth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-08T00:06:38Z","updated_at":"2015-04-08T16:51:13Z","closed_at":null,"body":"My current use case is to cluster a bunch of data to generate labels, then use a classifier to draw decision boundaries and make label predictions on new data.\r\n\r\nI love using pipeline and gridsearch packages in tandem, but can't use it for this because clustering does not have a transform method for X. Is it worthwhile to make pipeline components chain-able by the labels_ attribute in addition to transform?"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/90972728","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4543#issuecomment-90972728","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4543","id":90972728,"user":{"login":"selwyth","id":3229766,"avatar_url":"https://avatars.githubusercontent.com/u/3229766?v=3","gravatar_id":"","url":"https://api.github.com/users/selwyth","html_url":"https://github.com/selwyth","followers_url":"https://api.github.com/users/selwyth/followers","following_url":"https://api.github.com/users/selwyth/following{/other_user}","gists_url":"https://api.github.com/users/selwyth/gists{/gist_id}","starred_url":"https://api.github.com/users/selwyth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selwyth/subscriptions","organizations_url":"https://api.github.com/users/selwyth/orgs","repos_url":"https://api.github.com/users/selwyth/repos","events_url":"https://api.github.com/users/selwyth/events{/privacy}","received_events_url":"https://api.github.com/users/selwyth/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T16:51:13Z","updated_at":"2015-04-08T16:51:13Z","body":"Yes, want `labels_` to be `y`. It's very similar to #4143 -- that one proposes transforms to existing `y`; I'm thinking of generating a `y` where there isn't one previously, then sending it down the `pipeline`.\r\n\r\nTrying to be more explicit here: say I want to classify the `iris` dataset but don't have the labels to train it on. I would like to cluster the data (say using KMeans), then use the `labels_` as the `y` for a classifier (say kNN) on out-of-sample data. Would like to put these in a `pipeline` so I can tune the hyperparameters for both steps (e.g. both `n_clusters` and `n_neighbors`). Basically, I'm wondering if it's worthwhile to be able to `pipeline` the conversion of an unsupervised learning problem into a supervised learning problem. Hope that helps."}}