{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/10319","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/10319/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/10319/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/10319/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/10319","id":282113993,"number":10319,"title":"longevity of models","user":{"login":"joernhees","id":464192,"avatar_url":"https://avatars1.githubusercontent.com/u/464192?v=4","gravatar_id":"","url":"https://api.github.com/users/joernhees","html_url":"https://github.com/joernhees","followers_url":"https://api.github.com/users/joernhees/followers","following_url":"https://api.github.com/users/joernhees/following{/other_user}","gists_url":"https://api.github.com/users/joernhees/gists{/gist_id}","starred_url":"https://api.github.com/users/joernhees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joernhees/subscriptions","organizations_url":"https://api.github.com/users/joernhees/orgs","repos_url":"https://api.github.com/users/joernhees/repos","events_url":"https://api.github.com/users/joernhees/events{/privacy}","received_events_url":"https://api.github.com/users/joernhees/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-12-14T14:12:57Z","updated_at":"2017-12-15T04:05:27Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Training models might take considerable amounts of time and energy, but with every upgrade of sklearn one currently might lose the ability to use a model trained with an older release version.\r\n\r\nWhile this is mentioned in the [docs](http://scikit-learn.org/stable/modules/model_persistence.html#security-maintainability-limitations), i still find it upsetting, as i can either pin sklearn to some old version or re-train all models and use an up-to-date sklearn. Re-training also might make it necessary to keep large amounts of training data around and ship them to all machines, potentially with parameters found by grid-search on previous versions to at least save grid-search times.\r\n\r\nFor example, i have a GradientBoostingClassifier model from 0.18.1 that now causes this userwarning:\r\n> Trying to unpickle estimator GradientBoostingClassifier from version 0.18.1 when using version 0.19.1. This might lead to breaking code or invalid results. Use at your own risk.\r\n\r\nWhen trying to actually use the model the result is:\r\n```\r\nAttributeError: 'GradientBoostingClassifier' object has no attribute 'n_features_'\r\n```\r\n\r\nFrom my guess, this is mainly an issue of using pickle on the model object (which is currently the recommended way to serialize models): every rename of model properties in the source will cause a whole lot of trouble when loading a model object pre-dating that change, as the methods won't find the properties anymore.\r\n\r\nAt the same time i think that the underlying idea of an estimator changes rather rarely.\r\n\r\nWould there be any interest in providing high-level `save` and `load` functionality that decouples the run-time model mechanics a bit more from its serialization and focuses more on longevity?"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/351907925","html_url":"https://github.com/scikit-learn/scikit-learn/issues/10319#issuecomment-351907925","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/10319","id":351907925,"user":{"login":"amueller","id":449558,"avatar_url":"https://avatars3.githubusercontent.com/u/449558?v=4","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":"2017-12-15T04:05:27Z","updated_at":"2017-12-15T04:05:27Z","author_association":"OWNER","body":">  otherwise just announce the explicit lack of compatibility.\r\n\r\nThat's what we do right now, right? Or do you mean on a per-model basis?\r\n\r\n> We could consider implementing __setstate__ to help load old models in new versions\r\n\r\nI don't like this because it can potentially require a separate converter function for each version, i.e. in the worst case for each version you have to write a new converter for the last n versions."}}
{"actor":{"display_login":"amueller"}}