{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6007","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6007/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6007/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6007/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/6007","id":121611532,"number":6007,"title":"MiniBatchKMeans Predict Label Indexing","user":{"login":"toddpi314","id":251627,"avatar_url":"https://avatars.githubusercontent.com/u/251627?v=3","gravatar_id":"","url":"https://api.github.com/users/toddpi314","html_url":"https://github.com/toddpi314","followers_url":"https://api.github.com/users/toddpi314/followers","following_url":"https://api.github.com/users/toddpi314/following{/other_user}","gists_url":"https://api.github.com/users/toddpi314/gists{/gist_id}","starred_url":"https://api.github.com/users/toddpi314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddpi314/subscriptions","organizations_url":"https://api.github.com/users/toddpi314/orgs","repos_url":"https://api.github.com/users/toddpi314/repos","events_url":"https://api.github.com/users/toddpi314/events{/privacy}","received_events_url":"https://api.github.com/users/toddpi314/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-11T00:52:14Z","updated_at":"2016-01-11T02:55:34Z","closed_at":null,"body":"When training batches of data using partial_fit, replaying those same values back using predict often returns labels that are a single index off.\r\n\r\nThat is, training:\r\n[1,2,3]\r\n[2,3,4]\r\n[2,3,4]\r\n[5,6,7]\r\n[5,6,7]\r\n\r\nWill return predict results like:\r\n [1,2,3] => 1\r\n[2,3,4] => 1\r\n[2,3,4] => 2\r\n[5,6,7] => 2\r\n[5,6,7] => 3\r\n\r\nThis is a simplified example but we have been seeing this sporadically for larger datasets.\r\n\r\nIs this a new issue?"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/170421191","html_url":"https://github.com/scikit-learn/scikit-learn/issues/6007#issuecomment-170421191","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6007","id":170421191,"user":{"login":"MechCoder","id":1867024,"avatar_url":"https://avatars.githubusercontent.com/u/1867024?v=3","gravatar_id":"","url":"https://api.github.com/users/MechCoder","html_url":"https://github.com/MechCoder","followers_url":"https://api.github.com/users/MechCoder/followers","following_url":"https://api.github.com/users/MechCoder/following{/other_user}","gists_url":"https://api.github.com/users/MechCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/MechCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MechCoder/subscriptions","organizations_url":"https://api.github.com/users/MechCoder/orgs","repos_url":"https://api.github.com/users/MechCoder/repos","events_url":"https://api.github.com/users/MechCoder/events{/privacy}","received_events_url":"https://api.github.com/users/MechCoder/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T02:55:34Z","updated_at":"2016-01-11T02:55:34Z","body":"I'm unable to reproduce\r\n\r\n    X = np.array([[1, 2, 3], [2, 3, 4], [2, 3, 4], [5, 6, 7], [5, 6, 7]], dtype=np.float64)\r\n    mbk = MiniBatchKMeans(n_clusters=3)\r\n    mbk.partial_fit(X)\r\n    mbk.predict(X)\r\n    array([1, 2, 2, 0, 0], dtype=int32)\r\n\r\nDid you mean this or something else?"}}