简体   繁体   中英

Kmeans clustering using TENSORFLOW2

How could I convert a pandas database that contains 47 columns and 99999 lines into a tensors in Tensorflow 2? is the Kmeans algorithm already implemented under TF 2? because the command tf.contrib.factorization.KMeans does not work under TF2 since tf.contrib no longer exists on the second API Tensorflow

  1. List item

I got my TF2 example working with KMeans implementation from here tf.compat.v1.estimator.experimental.KMeans

Note: As of Nov 7, 2019 the code example has a problem. Change tf.estimator.experimental.KMeans to tf.compat.v1.estimator.experimental.KMeans


Also for anyone looking for TF 2 contrib, there's a quote on the r1.15 tf.contrib page:

Warning: The tf.contrib module will not be included in TensorFlow 2.0. Many of its submodules have been integrated into TensorFlow core, or spun-off into other projects like tensorflow_io, or tensorflow_addons. For instructions on how to upgrade see the Migration guide.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM