{"action":"opened","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12373","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12373/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12373/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/12373/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/12373","id":369746826,"node_id":"MDU6SXNzdWUzNjk3NDY4MjY=","number":12373,"title":"error: '_CFSubcluster' object has no attribute 'centroid_'","user":{"login":"zhiweige","id":26078984,"node_id":"MDQ6VXNlcjI2MDc4OTg0","avatar_url":"https://avatars2.githubusercontent.com/u/26078984?v=4","gravatar_id":"","url":"https://api.github.com/users/zhiweige","html_url":"https://github.com/zhiweige","followers_url":"https://api.github.com/users/zhiweige/followers","following_url":"https://api.github.com/users/zhiweige/following{/other_user}","gists_url":"https://api.github.com/users/zhiweige/gists{/gist_id}","starred_url":"https://api.github.com/users/zhiweige/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhiweige/subscriptions","organizations_url":"https://api.github.com/users/zhiweige/orgs","repos_url":"https://api.github.com/users/zhiweige/repos","events_url":"https://api.github.com/users/zhiweige/events{/privacy}","received_events_url":"https://api.github.com/users/zhiweige/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-13T00:09:57Z","updated_at":"2018-10-13T00:09:57Z","closed_at":null,"author_association":"NONE","body":"Hi， I found the code in this \r\nhttps://github.com/scikit-learn/scikit-learn/blob/bac89c253b35a8f1a3827389fbee0f5bebcbc985/sklearn/cluster/birch.py#L212 line would cause this error.\r\n  Because new_subcluster1, new_subcluster2  created by \r\nnew_subcluster1, new_subcluster2 = _split_node(\r\nclosest_subcluster.child_, threshold, branching_factor)\r\nare constructed with \r\nnew_subcluster1 = _CFSubcluster()\r\nnew_subcluster2 = _CFSubcluster()\r\n\r\nso, the problem is when calls the function update_split_subclusters in line\r\nhttps://github.com/scikit-learn/scikit-learn/blob/bac89c253b35a8f1a3827389fbee0f5bebcbc985/sklearn/cluster/birch.py#L164, there will call 'self.init_centroids_[ind] = new_subcluster1.centroid_'.\r\nBut this construction method of 'new_subcluster1 = _CFSubcluster()' has no attribute 'centroid_'.\r\n\r\nCan you help me to fix this issue? Thanks.\r\n\r\n<!--\r\nIf your issue is a usage question, submit it here instead:\r\n- StackOverflow with the scikit-learn tag: https://stackoverflow.com/questions/tagged/scikit-learn\r\n- Mailing List: https://mail.python.org/mailman/listinfo/scikit-learn\r\nFor more information, see User Questions: http://scikit-learn.org/stable/support.html#user-questions\r\n-->\r\n\r\n<!-- Instructions For Filing a Bug: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#filing-bugs -->\r\n\r\n#### Description\r\n<!-- Example: Joblib Error thrown when calling fit on LatentDirichletAllocation with evaluate_every > 0-->\r\n\r\n#### Steps/Code to Reproduce\r\n<!--\r\nExample:\r\n```python\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.decomposition import LatentDirichletAllocation\r\n\r\ndocs = [\"Help I have a bug\" for i in range(1000)]\r\n\r\nvectorizer = CountVectorizer(input=docs, analyzer='word')\r\nlda_features = vectorizer.fit_transform(docs)\r\n\r\nlda_model = LatentDirichletAllocation(\r\n    n_topics=10,\r\n    learning_method='online',\r\n    evaluate_every=10,\r\n    n_jobs=4,\r\n)\r\nmodel = lda_model.fit(lda_features)\r\n```\r\nIf the code is too long, feel free to put it in a public gist and link\r\nit in the issue: https://gist.github.com\r\n-->\r\n\r\n#### Expected Results\r\n<!-- Example: No error is thrown. Please paste or describe the expected results.-->\r\n\r\n#### Actual Results\r\n<!-- Please paste or specifically describe the actual output or traceback. -->\r\n\r\n#### Versions\r\n<!--\r\nPlease run the following snippet and paste the output below.\r\nFor scikit-learn >= 0.20:\r\nimport sklearn; sklearn.show_versions()\r\nFor scikit-learn < 0.20:\r\nimport platform; print(platform.platform())\r\nimport sys; print(\"Python\", sys.version)\r\nimport numpy; print(\"NumPy\", numpy.__version__)\r\nimport scipy; print(\"SciPy\", scipy.__version__)\r\nimport sklearn; print(\"Scikit-Learn\", sklearn.__version__)\r\n-->\r\n\r\n\r\n<!-- Thanks for contributing! -->\r\n"}}
{"actor":{"display_login":"zhiweige"}}