---
schema_version: "1"
id: f211f060a5efec123f6a9e689c593e8f3377a10c6cb55438b5b35033c0ea31f3
title: Clustering
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_ai_predictive_model_clustering.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_ai_predictive_model_clustering.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 88393a82220c12dbb37353e65b2c902c0c4ba487511fa08a0863adb0f26b6e53
description: Use clustering in Data 360 to uncover hidden patterns and natural groupings in your data.
products:
  - Data 360
release: "264"
---
# Clustering

Use clustering in Data 360 to uncover hidden patterns and natural groupings in your data.

For example, identify emerging customer profiles, recurring support issues, and behavioral trends. You can also group transaction records into segments such as loyal customers, big spenders, or at-risk customers. You can write record-level clustering results to an output data model object (DMO) for downstream use in segmentation, personalization, reporting, automated campaigns, and other Data 360 workflows.

## Clustering Use Cases

Use clustering when you want to discover meaningful groups based on multiple variables and don't have clear rules for defining those groups.

Clustering can help you:

- Segment records automatically: Group customers, accounts, products, cases, or custom records based on multiple attributes.
- Discover cross-attribute patterns: Identify non-obvious patterns and relationships across selected variables.
- Discover emerging groups: Identify clusters that aren't represented by existing segments or business rules.
- Track trends over time: Use a trained clustering model when you need to compare consistently defined clusters over time.
- Identify outliers: Find records that don't fit well within an identified cluster and require further investigation.
- Enrich data for downstream models: Write record-level cluster assignments to a DMO for use as input variables in custom multiclass classification, forecasting, and other downstream models.

Clustering sometimes isn't the best approach when you already know the criteria that define each group and require predictable membership. Use business rules when the criteria can be defined explicitly. Use multiclass classification when you have labeled examples and want a model to predict a known category.

## Clustering Considerations

Before you create clusters, identify:

- The source object that contains the records you want to group. A trained clustering model can use a DMO or Calculated Insight Object (CIO), while unsupervised clustering uses one DMO.
- The relevant numerical, categorical, or supported text fields.
- The purpose of the clusters, such as exploration, segmentation, personalization, reporting, or downstream modeling.
- Whether cluster definitions must remain consistent across runs.
- Whether identifying outliers is important.
- Whether the input data contains enough meaningful variation to distinguish groups of records.

## Clustering Workflow Selection

Choose a workflow based on how you intend to use the clusters. Clustering identifies groups based on similarities in the input data. Business context is required to determine whether those groups are meaningful and appropriate for downstream use.

  
| Consideration | Structured Clustering | Unsupervised Clustering |
| --- | --- | --- |
| Primary purpose | Reusable segmentation and activation | Exploration and dynamic analysis |
| Process | Train a model, and then run inference | Run a predict job |
| Separate training | Required | Not required |
| Model artifact | Saved for reuse | Not stored or versioned |
| Cluster definitions | Locked after training | Recalculated for each run |
| ID and label continuity | Stable across inference runs | Not guaranteed across runs |
| New records | Assigned to existing clusters | Included when all clusters are recalculated |
| Data sources | A primary DMO or CIO, with supported related DMOs and CIOs | One DMO containing the input data |
| Common uses | Campaigns, journeys, recurring reports, and shared segment definitions | Exploration, preprocessing, discovery of variables, data reduction, and outlier analysis |

For example, a support organization clusters supported case attributes to identify patterns associated with login failures, billing questions, and product defects. The organization uses a trained clustering model when the groups must remain stable for case routing and reporting. It uses unsupervised clustering to explore emerging issues dynamically.

## Trained Clustering Models

A trained clustering model creates stable, reusable clusters. During training, the model analyzes training data and identifies groups of similar records. Saving the model locks the cluster definitions. You can then assign business-friendly labels to the clusters. During subsequent inference runs, the model assigns new records to the best-matching existing clusters. Cluster IDs and their associated labels retain the same meaning across inference runs.

Use a trained clustering model when:

- Downstream processes require consistent cluster definitions.
- New records must be assigned to existing clusters.
- Reports and dashboards compare the same groups over time.
- Campaigns, journeys, or personalization rules depend on stable cluster IDs or labels.
- Teams need shared segment definitions.

For example, a retailer trains a clustering model that identifies Loyal Customers, Occasional Shoppers, and At-Risk Customers. The model assigns new and updated customers to these existing clusters. Marketing uses the stable labels in recurring campaigns while analysts monitor changes in each segment's size over time.

## Data Sources for Trained Clustering Models

A trained clustering model can use:

- A DMO as the primary source.
- A DMO as the primary source with fields from supported related DMOs and CIOs.
- A CIO as the primary source with fields from supported related DMOs and CIOs.

A related DMO or CIO is available when it has a one-to-one or many-to-one relationship with the primary object. To review a DMO's related objects, open the DMO and select the **Relationships** tab. Eligible fields appear in the model builder under **Add additional related fields to your data (Optional)**.

## Unsupervised Clustering

Unsupervised clustering dynamically discovers groups without predefined labels or a separate model-training step. During each clustering job, the algorithm processes the selected dataset and generates clusters without storing or versioning a trained model artifact.

An unsupervised clustering job uses one DMO containing the input data. Because clusters are recalculated for every run, cluster IDs, record assignments, and distributions can change when records or job settings change. A cluster from one run isn't guaranteed to represent the same group in a later run, even if the two clusters have the same ID.

Use unsupervised clustering to:

- Perform one-time exploration or ad hoc analysis.
- Discover patterns in the current dataset.
- Work without requiring reusable cluster IDs.
- Dynamically preprocess data for another analysis or model.
- Reduce a large dataset to a smaller set of representative groups.
- Identify outliers or records that don't fit established patterns.

Don't use unsupervised cluster IDs as permanent segment definitions. If downstream processes require clusters to retain the same meaning across runs, use a trained clustering model.

For example, a retailer runs an unsupervised clustering job on product data using supported fields such as price, sales volume, seasonality, and product descriptions. The resulting clusters help analysts identify everyday sellers, seasonal products, and long-tail products. When the product catalog changes and the job runs again, the clusters are recalculated to reflect the current data.

## Clustering Input Types

Depending on the selected workflow and configuration, clustering can analyze structured data, supported unstructured content, or a combination of input types.

**Structured Data**

Structured data includes numerical and categorical fields. For example, a team can evaluate account revenue, transaction counts, and support engagement to identify potential account tiers.

**Unstructured Data**

Unstructured data includes customer feedback, support case descriptions, comments, notes, and product descriptions. Clustering can identify similarities and themes in text without requiring predefined categories. Unstructured content is an input type, not a separate clustering workflow. Availability depends on the selected workflow, algorithm, and configuration.

## Clustering Algorithm Selection

Choose an algorithm based on the characteristics of your data, whether you know approximately how many clusters you want, and whether identifying outliers is important.

**K-Means**

K-means groups records into a specified number of clusters based on similarity. The default is four, but you can adjust the number or let the model determine an appropriate number based on your data. Use K-means when you:

- Know approximately how many clusters you want.
- Expect most records to belong to a cluster.
- Plan to divide the dataset into a fixed number of clusters.

For unsupervised K-means, every clustering job processes the current dataset and recalculates all clusters. Later runs can produce different cluster IDs, record assignments, and distributions.

For example, an analyst configures unsupervised K-means to divide accounts into four clusters based on annual revenue, purchase frequency, and service activity. The resulting clusters provide an initial view of potential account tiers for further analysis.

**HDBSCAN**

HDBSCAN identifies clusters based on areas of higher data density and doesn't require you to specify the number of clusters in advance. It's suited to noisy data and can identify records that don't fit well within a cluster as outliers. Use HDBSCAN when:

- You don't know the expected number of clusters.
- Groups can have different sizes or densities.
- Your data contains noise or records that might not belong to a meaningful group.
- Identifying outliers is important.

For example, a support organization uses HDBSCAN to group cases based on supported case attributes and descriptions. Most cases form recognizable issue clusters while unusual cases are identified as outliers for separate investigation.

## Clustering Results

Depending on the workflow, algorithm, and job configuration, the output DMO can include:

- Cluster ID: The identifier of the cluster to which a record is assigned.
- Cluster label: A business-friendly name associated with the cluster, when supported.
- Input variables: Selected input values included for downstream analysis.
- Top contributors: The fields that contributed most to the clustering result, when supported.
- Outlier information: An indication that a record doesn't fit well within an identified cluster, when supported by the algorithm.

Labels don't change the lifecycle of the underlying clusters. In a trained clustering model, labels remain associated with locked cluster definitions. In unsupervised clustering, cluster assignments and IDs can change with every run. Don't assume that matching IDs represent the same groups across different unsupervised runs.

Use clustering results to:

- Create or refine customer and other business segments.
- Personalize experiences and campaigns.
- Route or prioritize support cases.
- Monitor changes in customer, product, or support populations.
- Identify emerging issues or unusual records.
- Provide cluster assignments as input variables for downstream models.
- Analyze cluster characteristics in reports and dashboards.

Before using clusters in customer-facing actions and automated processes, review the results and apply business context.

- **[Use Clustering on Structured Data](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_predictive_model_cluster_use.htm&release=264.0.0&type=5)**  
    Use clustering models in Data 360 to automatically group data model object (DMO) records by shared characteristics. Run a predict job or batch data transform to assign new records to saved clusters, and use the results across Salesforce.