How to automatically discover consumer segments using decision tree analysis on conjoint utilities, a practical guide for Choicery with methodological background.
Step-by-step instructions for running Auto-Segment analysis in Choicery.
Auto-Segment automatically partitions respondents into distinct segments based on their conjoint preferences and their survey characteristics (demographics, attitudes, behavioral questions). Rather than relying on manual cross-tabs or subjective grouping, Auto-Segment uses a CART decision tree to find the survey variable splits that best explain differences in a chosen utility metric.
The output is a segment comparison matrix: one column per discovered segment, with rows for the mean target metric, the covariate profile of each segment (with a feature importance bar next to each covariate name), and the decision rules that define the segment. The underlying decision tree itself is available as a drill-down below the matrix.
A conjoint study on electric vehicles includes age, income, and a sustainability attitude scale as survey variables. Auto-Segment discovers a segment defined by "Age ≤ 35 AND Sustainability > 4.2" whose mean ZC-Diff for the target level is clearly above that of the other segments. The decision tree shows this as a two-split path: first on age, then on sustainability score.
Latent Class segments are latent, discovered purely from choice patterns. You know segments exist but must profile them after the fact. Auto-Segment segments are explained by observable covariates, you know exactly who is in each segment and why. The tree rules tell you: "people with these characteristics prefer this level more/less."
Each internal node of the tree shows a split rule (e.g., Age ≤ 35), and each leaf node represents a segment with its mean value on the target metric, sample size, and color code. The rules are immediately actionable: they describe each segment in terms of survey answers, without requiring statistical expertise to read.
The Auto-Segment tab is currently not shown in the Market Simulation tab bar. The analysis, its routes and this guide remain in the product, but the entry point is hidden. If you do not see an Auto-Segment tab next to Sensitivity and Persona, that is expected in the current build.
A completed Preference Analysis (HB) or AI-Driven Profile Analysis run with individual-level utilities. Auto-Segment works on the per-respondent utility values produced by those runs, it cannot run on aggregate data alone. At least 10 respondents with usable covariates are required.
Survey variables collected (demographics, attitudes, behavioral questions). These serve as the candidate variables for tree splits. For HB runs Choicery reads them from completed responses: single choice, checkboxes, Likert, semantic differential and binary items as categorical variables, numeric and slider items as numeric variables, plus scalar columns added in the Data Editor. Checkbox answers enter as one combined value per respondent (for example "A | B"). For AI-Driven Profile Analysis runs the covariates of the run are merged in automatically. Text variables never enter, the scale of a variable can be overridden in Variable Config (metric, nominal, ordinal, text), and a variable with only one distinct value is dropped.
At least two products defined in the Products panel (required only for the Simulation WTP metric, and only in combination with a linear price attribute). Auto-Segment refuses to run Simulation WTP with fewer than two products (Product 1 plus at least one competitor).
Open Market Simulation → Auto-Segment tab. Auto-Segment lives within Market Simulation, not in the Preference Analysis or Advanced Analytics sections. See the availability note in Section 1: the tab is currently hidden from the tab bar.
The Auto-Segment tab opens with a Configuration card. Here is what each control does and how to configure it.
The tab carries a notice stating that the Segment Filters at the top of the Market Simulation page do not apply to Auto-Segment. Auto-Segment always discovers its own groups from the full respondent pool. Use Predictor Variables (Tree Splits) to control which variables the tree may split on.
Simulation WTP reuses two settings from the Choice Share tab: its Simulation Method and its Include "None" switch. RFC runs the break-even search with RFC shares; First Choice is mapped to Share of Preference because the search needs smooth shares. None is only used when the run has a None option. The method details under the summary bar show which settings were applied.
For a utility-level target the tree is fitted on ZC-Diff values: the exported zero-centered utilities of the run when available, otherwise the level utility minus the mean utility of the levels of the same attribute. Only if neither can be built does it fall back to the raw utility, and the metric label then reads "Utility". With Simulation WTP selected, the hint line states: "Tree splits on ZC-Diff. Per-segment WTP = price change to offset the attribute change (using linear price "<attribute>")." The metric choice therefore changes what is reported per segment, not how the segments are found.
Select the attribute level to analyze. The dropdown is grouped by attribute: the group heading is the attribute name and each entry is the level name on its own (for example, group "Brand" with entries "Brand A", "Brand B"). The tree will explain why some respondents value this level more than others.
With Simulation WTP selected, levels that the focal product already uses are removed from the list, since there would be no attribute change to price. If that removes every option, the dropdown shows "No alternative levels (every level matches the focal product)". If the run has no usable levels at all, it shows "No levels found in Preference Analysis results".
This dropdown appears when Target Type is "Product (from PRODUCTS)", where it is labelled Target Product, and when Target Metric is Simulation WTP, where it is labelled Focal Product. Entries are taken from the Products panel and are shown as the product name followed by the number of configured attributes, e.g. "Product 1 (5 attrs)". With no products configured it shows "No products configured".
max(2, N × pct), so on very small samples the effective floor is two respondents.Begin with Max Depth = 3 and Min Leaf Size = 10%. This produces an interpretable tree with a handful of segments. Only increase depth if you have 300+ respondents and a strong theoretical reason to expect complex interactions.
A searchable multi-select picker listing the survey variables available for the selected run (demographics, attitude scales, behavioral questions). These are the candidates the tree considers when looking for splits. The placeholder reads "Select predictor variables...", the search field "Search variables...", and a counter below the picker shows "n selected of m". At least one variable must be selected, otherwise the run stops with "Please select at least one covariate."
Including too many irrelevant variables increases noise and can lead to spurious splits. Focus on variables you believe could plausibly relate to preferences. A mix of demographics and attitudinal variables typically works best.
Configure Target Type, Target Metric, and Target Utility Level (plus Target Product or Focal Product if the field is shown).
Set Max Depth and Min Leaf Size (%).
Select predictor variables in the Predictor Variables (Tree Splits) picker.
Click Calculate. The status message "Building segmentation tree..." appears; the tree is built in seconds (CART is fast, even for large samples).
After calculation the results area shows a summary bar, the segment comparison matrix, and a collapsed decision tree drill-down. The matrix is the centerpiece.
A compact row of key metrics at the top:
| Metric | Description |
|---|---|
| Segments | Number of leaf nodes (terminal segments) in the tree |
| Respondents | Respondents actually used, that is, those matched to the run whose covariate record contains at least one of the selected predictor variables |
| R² | Variance explained by the tree, shown to three decimals (see Section 5) |
| Target | The attribute level or product being segmented, e.g. "Brand = Brand A" |
With Simulation WTP, a method details strip appears under the summary bar with the entries Price Attribute, PRODUCTS, None, Method and, where an attribute change is priced, Change. Below these a note line can appear (for example that First Choice was mapped to SOP) and a warning line when a fallback target metric was used or when the focal product already carries the target level, in which case no WTP is computed. Use it to confirm which price attribute and which product set the WTP numbers were computed against.
The comparison matrix is the primary output. It is a single table with one column per segment and one row per piece of information. Column headers show the segment name, its share of the sample and its size, for example "Segment 1" with "26% · n=130". Segments are numbered by descending mean value on the target metric, so Segment 1 always has the highest mean. Each segment also gets a fixed colour used for its header dot and in the tree drill-down.
The rows are grouped into sections:
Age <= 35.00 and Sustainability > 4.20. Repeated numeric bounds on the same variable are merged into a single interval chip such as Age in (25.00, 35.00]. A segment covering everyone shows "All respondents". Splits on a categorical level appear as Variable = Level for the "Yes" branch and Variable != Level for the "No" branch.| Segment 1 | Segment 2 | Segment 3 | |
|---|---|---|---|
| Key Metrics | |||
| Mean ZC-Diff | +5.100SD 1.820 | +1.700SD 1.540 | +1.400SD 1.610 |
| Who Are They | |||
| Age35% | median 29.00 (mean 28.40) | median 31.00 (mean 30.10) | median 52.00 (mean 51.30) |
| Sustainability28% | median 5.00 (mean 4.90) | median 3.00 (mean 3.10) | median 3.00 (mean 3.30) |
| Education12% | Master 62% | Bachelor 48% | High School 41% |
| Decision Path | |||
| Rules | Age <= 35.00Sustainability > 4.20 | Age <= 35.00Sustainability <= 4.20 | Age > 35.00 |
Illustrative matrix layout with fabricated numbers. Percentages and pictograms are omitted here for print legibility.
Use the decision rules and the "Who Are They" rows to give segments memorable names. "Young sustainability enthusiasts" is far more useful than "Segment 1" in a client presentation.
Below the matrix sits a collapsed section labelled "How were these segments built? (Decision Tree)". Expanding it draws the tree the segments came from:
2.400 and "Mean ZC-Diff"), and n = …. Numeric splits read Variable <= threshold with branch labels ≤ threshold and > threshold; splits on a categorical level read Variable = Level with No and Yes branches.n = ….Illustrative tree with fabricated numbers: respondents under 35 with high sustainability scores (Segment 1) show the strongest preference for the target level.
Reading the tree: follow any path from root to leaf. Each path defines a segment rule. In the example, Segment 1 = "Age ≤ 35 AND Sustainability > 4.2", with a mean ZC-Diff of 5.1 for the target level. Note that the segment numbering follows the mean value, not the position in the tree, so segment numbers are not left-to-right.
Feature importance is not a separate chart. It is shown inline in the matrix, as a bar plus a percentage next to each covariate name in the "Who Are They" section, and it also determines the order of those rows. Importance is measured by the total reduction in variance attributable to each covariate. Dummy columns created from categorical variables are aggregated back to their original variable name, and covariates that the tree never used receive no bar.
Interpretation: 35% of the total variance reduction came from Age splits. Age is the most important predictor of preference differences for this utility level, and the Age row appears first in the "Who Are They" section.
R² (coefficient of determination) measures how much of the individual variation in the target metric the decision tree explains using the selected covariates. It is computed on the same values the tree was fitted on, that is, the ZC-Diff values for a utility level target (and the corresponding product metric for a product target), and it is reported in the summary bar to three decimals.
| R² Value | Interpretation |
|---|---|
< 0.05 |
Covariates explain very little. Preference differences are driven by unobserved factors. |
0.05 - 0.15 |
Moderate explanatory power. Some covariate patterns emerge but much variation remains. |
0.15 - 0.30 |
Good. The tree captures meaningful preference heterogeneity via observables. |
> 0.30 |
Strong. Observable covariates are powerful predictors of preference differences. |
In conjoint studies, R² values between 0.05 and 0.30 are typical. Preference heterogeneity is inherently difficult to explain with observables alone, much of why people differ in their preferences is not captured by standard demographics or even attitude scales. An R² of 0.15 is a genuinely useful result.
R² is not prediction accuracy. A high R² means the tree explains variance well in-sample. It does not guarantee the splits will generalize to new respondents. This is why controlling tree depth and leaf size matters, it limits overfitting.
With small samples, deep trees, and many predictor variables, CART will always find splits, even in random noise. If your R² jumps dramatically when increasing depth from 3 to 5, the additional splits may be fitting noise rather than signal. Always prefer the simpler tree unless additional depth produces meaningfully different and large segments.
Auto-Segment is a post-hoc analysis. The decision tree was not part of the original choice model estimation. Segment differences are descriptive, not causal. "Young respondents prefer X more" does not mean youth causes the preference, it means age is correlated with a preference pattern discovered by HB estimation.
Methodology, algorithms, and academic context behind Auto-Segment.
At each node, CART evaluates all possible binary splits on all available covariates. For a numeric covariate like Age, scikit-learn places a candidate threshold halfway between each pair of adjacent observed values, so a displayed rule such as Age ≤ 35.50 need not match an observed age. The original CART formulation also searches every partition of a categorical covariate into two groups.
Choicery uses the scikit-learn implementation, which does not search multi-way partitions of categorical variables. Categorical covariates are dummy-encoded first (one column per level, the alphabetically first level dropped), so a categorical split is always of the form "level L versus everything else", and the dropped first level can only be isolated through the other levels' splits. This is a restriction relative to textbook CART: a grouping such as "Bachelor or Master versus the rest" can only be reached by two successive splits.
The algorithm selects the split that produces the greatest reduction in the sum of squared residuals (MSE) in the two resulting child nodes. This process repeats recursively on each child until a stopping rule is triggered.
For regression trees (continuous target = utility values), the split criterion minimizes the weighted sum of within-node variance:
Intuitively, the best split is the one that creates two groups with the most internally homogeneous utility values, the left group agrees among themselves, and the right group agrees among themselves, even if the two groups disagree with each other.
Choicery uses scikit-learn's DecisionTreeRegressor with default settings apart from depth and leaf size. A node stops splitting when any of these conditions holds:
There is no minimum-improvement rule: any split that reduces the weighted squared error, however slightly, is accepted. Choicery does not run a post-pruning pass. Tree size is controlled entirely by the two sliders, which is why the Max Depth and Min Leaf Size settings carry the full weight of the overfitting decision.
Choicery uses sklearn.DecisionTreeRegressor with random_state=42 for reproducibility. Max Depth maps directly to max_depth (clamped to 2-5); Min Leaf Size (%) becomes min_samples_leaf = max(2, N × pct). The tree is fitted on the ZC-Diff values rather than on raw part-worths, so that splits reflect relative preference for the level instead of respondent-level scale differences. Categorical variables are dummy-encoded before fitting, with importances aggregated back to original variable names in the output. Missing numeric values are filled with the column median; missing categorical values become a "MISSING" category.
Choicery's Auto-Segment uses a two-stage approach:
Stage 1: Estimate individual utilities via Preference Analysis (HB) or AI-Driven Profile Analysis. This produces a vector of utility part-worths for each respondent.
Stage 2: Fit a CART regression tree on the individual ZC-Diff values for a selected level, using survey covariates as predictors. The tree finds which covariates best explain why some respondents have higher utilities for this level than others.
This is a Tier 1 post-hoc approach: simple, fast, and intuitive. It leverages HB's strong individual-level estimates and applies standard machine learning to segment them.
Choice Model Trees (CMT), the choice-model instance of the Market Segmentation Tree framework proposed by Aouad et al. (2023), take a different approach. CMT jointly optimizes the tree splits AND the MNL choice model within each leaf node. Instead of first estimating utilities and then segmenting, CMT does both simultaneously.
| Dimension | Post-Hoc (Choicery) | CMT (Joint) |
|---|---|---|
| Estimation | Two-stage: HB first, then CART | Single-stage: tree + MNL jointly |
| Speed | Fast (seconds) | Slow (re-estimates MNL per split) |
| Individual Estimates | Full HB posteriors available | Only segment-level MNL betas |
| Statistical Efficiency | Loses some efficiency in two stages | Optimal joint estimation |
| Interpretability | Familiar tree + utility framework | Tree structure, but with MNL coefficients |
| Software | sklearn (standard) | Custom implementation required |
Practical trade-off: The post-hoc approach is fast, intuitive, and leverages HB's strong individual-level estimates. CMT would require re-estimating MNL per candidate split, which is computationally expensive for large conjoint designs with many attributes. For most applied conjoint research, the post-hoc approach is sufficient and far more practical.
Feature importance in CART is based on variance reduction (also called Gini importance for classification trees, or MSE reduction importance for regression trees). For each covariate, the importance score equals the total reduction in the loss function attributable to all splits on that covariate, summed across the entire tree.
Categorical variables (e.g., Education with levels "High School", "Bachelor", "Master") are dummy-encoded before tree fitting, creating binary columns with the first level dropped as the reference. After fitting, the importances of all dummies belonging to the same original variable are summed back to report a single importance value per original variable. This prevents categorical variables with many levels from appearing artificially unimportant due to importance fragmentation.
"Age has 35% importance" means 35% of the total MSE reduction across all splits came from splits on Age. It does not mean Age explains 35% of utility variance (that would be R² for a single variable). Importance is relative: it tells you which covariates the tree found most useful for splitting, conditional on all other covariates.
Feature importance in decision trees is computed from the tree structure itself (variance reduction). It is not the same as SHAP values, which provide model-agnostic, additive explanations of individual predictions. CART importance is a global measure of variable usefulness for splitting, while SHAP decomposes individual predictions.
Aouad, A., Elmachtoub, A., Ferreira, K., & McNellis, R. (2023). Market segmentation trees. Manufacturing & Service Operations Management, 25(2), 648-667. (Original preprint: arXiv:1906.01174)
Breiman, L., Friedman, J. H., Olshen, R. A., & Stone, C. J. (1984). Classification and regression trees. Boca Raton, FL: CRC Press.
Orme, B. K. (2020). Getting started with conjoint analysis: Strategies for product design and pricing research (4th ed.). Manhattan Beach, CA: Research Publishers LLC.