{"action":"closed","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4690","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4690/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4690/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4690/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/4690","id":74148963,"number":4690,"title":"Nested models and friendly errors","user":{"login":"Barmaley-exe","id":434122,"avatar_url":"https://avatars.githubusercontent.com/u/434122?v=3","gravatar_id":"","url":"https://api.github.com/users/Barmaley-exe","html_url":"https://github.com/Barmaley-exe","followers_url":"https://api.github.com/users/Barmaley-exe/followers","following_url":"https://api.github.com/users/Barmaley-exe/following{/other_user}","gists_url":"https://api.github.com/users/Barmaley-exe/gists{/gist_id}","starred_url":"https://api.github.com/users/Barmaley-exe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Barmaley-exe/subscriptions","organizations_url":"https://api.github.com/users/Barmaley-exe/orgs","repos_url":"https://api.github.com/users/Barmaley-exe/repos","events_url":"https://api.github.com/users/Barmaley-exe/events{/privacy}","received_events_url":"https://api.github.com/users/Barmaley-exe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Documentation","name":"Documentation","color":"0b02e1"},{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Easy","name":"Easy","color":"02d7e1"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-07T22:29:18Z","updated_at":"2015-06-11T15:14:12Z","closed_at":"2015-06-11T15:14:12Z","body":"Pretty often I see people using nested models wrong ([[1]](http://stackoverflow.com/q/16437022), [[2]](http://stackoverflow.com/q/12632992), [[3]](http://stackoverflow.com/q/28178763)). I've just thought: can we throw more helpful exceptions?\r\n\r\nOne way is to catch `ValueError`s inside of grid_search methods and rethrow them with a message like \r\n\r\n    Are you trying to search over parameters of a nested model?\r\n    If so, please refer to the documentation on <double underscore notation>.\r\n\r\n    Original exception: <...>\r\n\r\nOr, we can define a custom getter for `Pipeline`, `OneVsRestClassfier`, etc that will throw an exception with that message.\r\n\r\nAlso, right now there's no clear paragraph about, so to say, \"double underscore notation\". Yes, it is mentioned on docs for Pipeline, FeatureUnion, etc, but I feel like this notation is more than just that — double underscore is a standard sklearn's convention for dealing with nested models, and I think it should be emphasized (so we refer people to that place). Though, I don't know where to put it."}}