More actions
No edit summary |
No edit summary |
||
| Line 15: | Line 15: | ||
# result | # result | ||
# array([5, 6, 1], dtype=int32) | # array([5, 6, 1], dtype=int32) | ||
=== tensorflow === | |||
* [https://www.tensorflow.org/versions/r0.10/api_docs/python/math_ops.html#unsorted_segment_sum unsorted_segment_sum] | |||
== 다음 시간에는 == | == 다음 시간에는 == | ||
Revision as of 09:06, 2 August 2016
내용
- sklearn의 k-means
- tensorflow로 k-means algorithm 구현하기
코드
sklearn의 k-means
from sklearn import cluster clst = cluster.KMeans() clst.fit([[0],[1],[2],[3], [1000], [1004], [1010], [2000], [100000], [12345], [23456], [66666]]) clst.predict([[11], [3000], [99999]]) # result # array([5, 6, 1], dtype=int32)