Type KMeansClustering
Namespace tensorflow_estimator.python.estimator.canned.kmeans
Parent Estimator
Interfaces IKMeansClustering
Methods
- cluster_centers
- cluster_centers_dyn
- NewDyn
- predict_cluster_index
- predict_cluster_index
- predict_cluster_index_dyn
- score
- score
- score_dyn
- transform
- transform
- transform_dyn
Properties
- ALL_DISTANCES_dyn
- CLUSTER_CENTERS_VAR_NAME_dyn
- CLUSTER_INDEX_dyn
- config
- config_dyn
- COSINE_DISTANCE_dyn
- KMEANS_PLUS_PLUS_INIT_dyn
- model_dir
- model_dir_dyn
- model_fn
- model_fn_dyn
- params
- params_dyn
- PythonObject
- RANDOM_INIT_dyn
- SCORE_dyn
- SQUARED_EUCLIDEAN_DISTANCE_dyn
Fields
Public instance methods
object cluster_centers()
Returns the cluster centers.
object cluster_centers_dyn()
Returns the cluster centers.
IEnumerator<object> predict_cluster_index(ValueTuple<object, object, object> input_fn)
Finds the index of the closest cluster center to each input point.
Parameters
-
ValueTuple<object, object, object>
input_fn - Input points. See
tf.estimator.Estimator.predict
.
IEnumerator<object> predict_cluster_index(PythonFunctionContainer input_fn)
Finds the index of the closest cluster center to each input point.
Parameters
-
PythonFunctionContainer
input_fn - Input points. See
tf.estimator.Estimator.predict
.
object predict_cluster_index_dyn(object input_fn)
Finds the index of the closest cluster center to each input point.
Parameters
-
object
input_fn - Input points. See
tf.estimator.Estimator.predict
.
object score(ValueTuple<object, object, object> input_fn)
Returns the sum of squared distances to nearest clusters. Note that this function is different from the corresponding one in sklearn
which returns the negative sum.
Parameters
-
ValueTuple<object, object, object>
input_fn - Input points. See
tf.estimator.Estimator.evaluate
. Only one batch is retrieved.
Returns
-
object
- The sum of the squared distance from each point in the first batch of inputs to its nearest cluster center.
object score(PythonFunctionContainer input_fn)
Returns the sum of squared distances to nearest clusters. Note that this function is different from the corresponding one in sklearn
which returns the negative sum.
Parameters
-
PythonFunctionContainer
input_fn - Input points. See
tf.estimator.Estimator.evaluate
. Only one batch is retrieved.
Returns
-
object
- The sum of the squared distance from each point in the first batch of inputs to its nearest cluster center.
object score_dyn(object input_fn)
Returns the sum of squared distances to nearest clusters. Note that this function is different from the corresponding one in sklearn
which returns the negative sum.
Parameters
-
object
input_fn - Input points. See
tf.estimator.Estimator.evaluate
. Only one batch is retrieved.
Returns
-
object
- The sum of the squared distance from each point in the first batch of inputs to its nearest cluster center.
IEnumerator<object> transform(ValueTuple<object, object, object> input_fn)
Transforms each input point to its distances to all cluster centers. Note that if `distance_metric=KMeansClustering.SQUARED_EUCLIDEAN_DISTANCE`,
this
function returns the squared Euclidean distance while the corresponding
sklearn function returns the Euclidean distance.
Parameters
-
ValueTuple<object, object, object>
input_fn - Input points. See
tf.estimator.Estimator.predict
.
IEnumerator<object> transform(PythonFunctionContainer input_fn)
Transforms each input point to its distances to all cluster centers. Note that if `distance_metric=KMeansClustering.SQUARED_EUCLIDEAN_DISTANCE`,
this
function returns the squared Euclidean distance while the corresponding
sklearn function returns the Euclidean distance.
Parameters
-
PythonFunctionContainer
input_fn - Input points. See
tf.estimator.Estimator.predict
.
object transform_dyn(object input_fn)
Transforms each input point to its distances to all cluster centers. Note that if `distance_metric=KMeansClustering.SQUARED_EUCLIDEAN_DISTANCE`,
this
function returns the squared Euclidean distance while the corresponding
sklearn function returns the Euclidean distance.
Parameters
-
object
input_fn - Input points. See
tf.estimator.Estimator.predict
.
Public static methods
KMeansClustering NewDyn(object num_clusters, object model_dir, ImplicitContainer<T> initial_clusters, ImplicitContainer<T> distance_metric, object seed, ImplicitContainer<T> use_mini_batch, ImplicitContainer<T> mini_batch_steps_per_iteration, ImplicitContainer<T> kmeans_plus_plus_num_retries, object relative_tolerance, object config, object feature_columns)
Public properties
object ALL_DISTANCES_dyn get; set;
object CLUSTER_CENTERS_VAR_NAME_dyn get; set;
object CLUSTER_INDEX_dyn get; set;
object config get;
object config_dyn get;
object COSINE_DISTANCE_dyn get; set;
object KMEANS_PLUS_PLUS_INIT_dyn get; set;
object model_dir get;
object model_dir_dyn get;
object model_fn get;
object model_fn_dyn get;
object params get;
object params_dyn get;
object PythonObject get;
object RANDOM_INIT_dyn get; set;
object SCORE_dyn get; set;
object SQUARED_EUCLIDEAN_DISTANCE_dyn get; set;
Public fields
string SCORE
return string
|
string ALL_DISTANCES
return string
|
string CLUSTER_INDEX
return string
|