Choicery Tutorial Series

Auto-Segment

How to automatically discover consumer segments using decision tree analysis on conjoint utilities, a practical guide for Choicery with methodological background.

Choicery Methodology Reference | July 2026

Contents

Part I, Practical Guide
  1. What Is Auto-Segment?
  2. Prerequisites: What You Need Before Starting
  3. Running Auto-Segment in Choicery
    • Target Type
    • Target Metric
    • Target Utility Level
    • Target Product / Focal Product
    • Tree Parameters
    • Predictor Variables (Tree Splits)
    • Running the Analysis
  4. Interpreting Results
    • Summary Bar
    • Segment Comparison Matrix
    • Decision Tree Drill-Down
    • Feature Importance
  5. Understanding R²
  6. Best Practices & Common Pitfalls
Part II, Theoretical Background
  1. Key Definitions
  2. The CART Algorithm
    • Recursive Binary Splitting
    • Split Criterion
    • Stopping Rules & Pruning
  3. Post-Hoc Utility Segmentation vs. Joint CMT
  4. Feature Importance in Decision Trees
  5. References
Part I

Practical Guide

Step-by-step instructions for running Auto-Segment analysis in Choicery.

1. What Is Auto-Segment?

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.

Example

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.

Key Difference from Latent Class

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.

Availability

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.

2. Prerequisites: What You Need Before Starting

1

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.

2

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.

3

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).

4

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.

3. Running Auto-Segment in Choicery

The Auto-Segment tab opens with a Configuration card. Here is what each control does and how to configure it.

Segment Filters Do Not Apply Here

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.

3.1 Target Type

Target Type
Utility Level
(default). Segments respondents by their preference for a specific attribute level. Use this to answer: "Who likes Feature X the most?"
Product (from PRODUCTS)
Segments respondents by their preference for a product you configured in the Products panel. The target value per respondent is the Product ZC-Diff: the zero-centered utility of the chosen product minus the mean zero-centered utility of all configured products. With only one configured product it is the product's zero-centered utility ("Product Utility (ZC)"); runs without zero-centered utilities use the raw product utility or its difference to the mean over all products ("Product Utility", "Product Utility Delta"). If the chosen metric shows no variation across respondents, Choicery switches to one of these alternatives and reports it as a fallback warning in the method details. Selecting this hides the Target Utility Level field and shows a Target Product field instead.

3.2 Target Metric

Target Metric
ZC-Diff
(default). Zero-Centered Diff utility values: the individual-level utility for the selected level, centered on the mean utility of the levels of the same attribute. The hint line reads "ZC-Diff uses utility-space values."
Simulation WTP
Reports a per-segment willingness-to-pay in currency units on top of the tree. The tree itself is still fitted on ZC-Diff; the per-segment WTP is the price change that offsets the attribute change. The option is disabled unless Target Type is Utility Level and a linear price attribute exists. The run itself requires at least two configured products (focal product plus at least one competitor); the dropdown may still offer the option with a single product when the Choice Share tab's Include "None" switch is on and the run has a None option, but the calculation then stops with "Simulation WTP requires at least two PRODUCTS (focal + competitor)."

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.

What the Tree Splits On

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.

3.3 Target Utility Level

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".

3.4 Target Product / Focal Product

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".

3.5 Tree Parameters

Tree Control Parameters
Max Depth
Slider 2-5, default 3. Controls how many split levels the tree can have. Deeper trees produce more segments but risk overfitting small samples.
Min Leaf Size (%)
Slider 5-30% in steps of 5, default 10%. Minimum segment size as a percentage of the analyzed respondents. Internally this becomes a minimum leaf sample count of max(2, N × pct), so on very small samples the effective floor is two respondents.
Tip: Start Simple

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.

3.6 Predictor Variables (Tree Splits)

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."

Variable Selection Matters

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.

3.7 Running the Analysis

1

Configure Target Type, Target Metric, and Target Utility Level (plus Target Product or Focal Product if the field is shown).

2

Set Max Depth and Min Leaf Size (%).

3

Select predictor variables in the Predictor Variables (Tree Splits) picker.

4

Click Calculate. The status message "Building segmentation tree..." appears; the tree is built in seconds (CART is fast, even for large samples).

4. Interpreting Results

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.

4.1 Summary Bar

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.

4.2 Segment Comparison Matrix

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:

Segment 126% · n=130 Segment 216% · n=80 Segment 358% · n=290
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.

Naming Segments

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.

4.3 Decision Tree Drill-Down

Below the matrix sits a collapsed section labelled "How were these segments built? (Decision Tree)". Expanding it draws the tree the segments came from:

Age <= 35.00
2.400 Mean ZC-Diff | n = 500
← ≤ 35.00 > 35.00 →
Sustainability <= 4.20
3.800 Mean ZC-Diff | n = 210
← ≤ 4.20 > 4.20 →
Segment 2
1.700 Mean ZC-Diff | n = 80
Segment 1
5.100 Mean ZC-Diff | n = 130
Segment 3
1.400 Mean ZC-Diff | n = 290

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.

4.4 Feature Importance

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.

Example: Feature Importance Ordering

Age: ============== 35% Sustainability: =========== 28% Income: ======= 18% Education: ===== 12% Gender: === 7%

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.

5. Understanding R²

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² = 1 − SSresidual / SStotal
Where SStotal = total variance in the individual target values, SSresidual = variance unexplained by the tree
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.
Typical Values

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.

6. Best Practices & Common Pitfalls

Do

Don't

Overfitting Warning

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.

Post-Hoc Nature

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.

Part II

Theoretical Background

Methodology, algorithms, and academic context behind Auto-Segment.

7. Key Definitions

Glossary

CART (Classification and Regression Trees)
The Breiman et al. (1984) algorithm for recursive binary partitioning of data. When the target is continuous (as with utilities), it performs regression; when categorical, classification.
Decision Tree
A hierarchical set of if-then rules for splitting data into homogeneous subgroups. Each path from root to leaf defines a segment.
Internal Node
A non-terminal node containing a split rule, e.g., "Age ≤ 35". Data arriving at this node is sent left (True) or right (False).
Leaf Node
A terminal node representing a segment. Contains the mean utility value and sample size for respondents reaching this node.
Feature Importance
The total reduction in variance (MSE) attributable to splits on a given covariate, summed across all nodes where that covariate was used. Normalized to sum to 1.0.
R² (Coefficient of Determination)
1 − SSresidual / SStotal. Measures the proportion of total utility variance explained by the tree's splits.
Post-Hoc Segmentation
Segmentation applied after utility estimation, using the estimated utilities as the dependent variable. Contrasts with joint estimation approaches (e.g., CMT) that estimate the choice model and segments simultaneously.

8. The CART Algorithm

8.1 Recursive Binary Splitting

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.

Categorical Splits in Choicery

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.

8.2 Split Criterion

For regression trees (continuous target = utility values), the split criterion minimizes the weighted sum of within-node variance:

argmins [ NL · MSE(left) + NR · MSE(right) ]
Where s is the candidate split, NL and NR are child node sizes, and MSE = mean squared error within each child.

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.

8.3 Stopping Rules & Pruning

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 Implementation

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.

9. Post-Hoc Utility Segmentation vs. Joint CMT

Choicery's Auto-Segment uses a two-stage approach:

1

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.

2

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.

The CMT Alternative

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.

10. Feature Importance in Decision Trees

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.

Importance(xj) = ∑t ∈ Tj Nt · ΔMSE(t)
Where Tj is the set of nodes splitting on variable xj, Nt is the node sample size, and ΔMSE(t) is the MSE reduction at node t. Values are normalized to sum to 1.0.

One-Hot Aggregation

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.

Interpreting Importance Values

"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.

Not the Same as SHAP

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.

11. References

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.