{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/172","repository_url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan","labels_url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/172/comments","events_url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/172/events","html_url":"https://github.com/scikit-learn-contrib/hdbscan/issues/172","id":294134123,"number":172,"title":"Is there a way to save the model for future prediction?","user":{"login":"econkc","id":17934731,"avatar_url":"https://avatars1.githubusercontent.com/u/17934731?v=4","gravatar_id":"","url":"https://api.github.com/users/econkc","html_url":"https://github.com/econkc","followers_url":"https://api.github.com/users/econkc/followers","following_url":"https://api.github.com/users/econkc/following{/other_user}","gists_url":"https://api.github.com/users/econkc/gists{/gist_id}","starred_url":"https://api.github.com/users/econkc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/econkc/subscriptions","organizations_url":"https://api.github.com/users/econkc/orgs","repos_url":"https://api.github.com/users/econkc/repos","events_url":"https://api.github.com/users/econkc/events{/privacy}","received_events_url":"https://api.github.com/users/econkc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-03T18:32:06Z","updated_at":"2018-02-04T17:11:46Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI wonder if there is a way to save the final model for future prediction? I understand that we can save a joblib object for tuning purpose that might be able to speed up the calculation but is there a way that we can just import the model back into python and use it to predict new data points without refitting the model. I am not sure if the \"generate_prediction_data()\" function is for this purpose and I cannot find a clear explanation of this function anywhere in the documentation.\r\n\r\nThanks,"},"comment":{"url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/comments/362922725","html_url":"https://github.com/scikit-learn-contrib/hdbscan/issues/172#issuecomment-362922725","issue_url":"https://api.github.com/repos/scikit-learn-contrib/hdbscan/issues/172","id":362922725,"user":{"login":"lmcinnes","id":11962885,"avatar_url":"https://avatars0.githubusercontent.com/u/11962885?v=4","gravatar_id":"","url":"https://api.github.com/users/lmcinnes","html_url":"https://github.com/lmcinnes","followers_url":"https://api.github.com/users/lmcinnes/followers","following_url":"https://api.github.com/users/lmcinnes/following{/other_user}","gists_url":"https://api.github.com/users/lmcinnes/gists{/gist_id}","starred_url":"https://api.github.com/users/lmcinnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmcinnes/subscriptions","organizations_url":"https://api.github.com/users/lmcinnes/orgs","repos_url":"https://api.github.com/users/lmcinnes/repos","events_url":"https://api.github.com/users/lmcinnes/events{/privacy}","received_events_url":"https://api.github.com/users/lmcinnes/received_events","type":"User","site_admin":false},"created_at":"2018-02-04T17:11:46Z","updated_at":"2018-02-04T17:11:46Z","author_association":"COLLABORATOR","body":"The following code would work:\r\n\r\n    model = hdbscan.HDBSCAN(prediction_data=True).fit(data)\r\n    labels, membership_strengths = hdbscan.approximate_predict(model, new_data)\r\n\r\nIf you wanted to save the model to disk and then later with another script load it back up you would pickle to model to disk, then in the other script load the pickled model."}}
{"actor":{"display_login":"lmcinnes"}}