About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Feb 11, 2025
The K-Means node clusters the data set into distinct groups (or clusters). The
method defines a fixed number of clusters, iteratively assigns records to clusters, and adjusts the
cluster centers until further refinement can no longer improve the model. Instead of trying to
predict an outcome, k-means uses a process known as unsupervised learning to uncover patterns
in the set of input fields.
Example
node = stream.create("kmeans", "My node")
# "Fields" tab
node.setPropertyValue("custom_fields", True)
node.setPropertyValue("inputs", ["Cholesterol", "BP", "Drug", "Na", "K", "Age"])
# "Model" tab
node.setPropertyValue("use_model_name", True)
node.setPropertyValue("model_name", "Kmeans_allinputs")
node.setPropertyValue("num_clusters", 9)
node.setPropertyValue("gen_distance", True)
node.setPropertyValue("cluster_label", "Number")
node.setPropertyValue("label_prefix", "Kmeans_")
node.setPropertyValue("optimize", "Speed")
# "Expert" tab
node.setPropertyValue("mode", "Expert")
node.setPropertyValue("stop_on", "Custom")
node.setPropertyValue("max_iterations", 10)
node.setPropertyValue("tolerance", 3.0)
node.setPropertyValue("encoding_value", 0.3)
Properties |
Values | Property description |
---|---|---|
|
[field1 ... fieldN] | K-means models perform cluster analysis on a set of input fields but do not use a target field. Weight and frequency fields are not used. See Common modeling node properties for more information. |
|
number | |
|
flag | |
|
|
|
|
string | |
|
|
|
|
|
|
|
number | |
|
number | |
|
number | |
|
|
Specifies whether model building should be optimized for speed or for memory. |
Was the topic helpful?
0/1000