--- # Default customer-profile template. # Copy to a Volume, edit, and point CR_PROFILE_TEMPLATE_PATH at it to customize. # Two declared data sources, both optional: # * feature_deviation — top-N deviation rows (right-hand panel; SHAP placeholder) # * customer — single profile row (left column; override per dataset) # Either source returning empty is rendered gracefully — the section just hides. data: feature_deviation: source: "v_account_feature_deviation_topn" join_key: "entity_id" order_by: "deviation_rank ASC" limit: 12 as_list: true ---
{{#if playbook_name}} {{/if}}
Customer

{{entity_id}}

{{risk_tier}} risk tier
{{fmt_pct churn_probability}} churn probability
Value at risk {{fmt_currency value_at_risk}}
Expected loss {{fmt_currency expected_loss}}
Policy rank {{fmt_int policy_rank_among_eligible}}
Eligible plays {{fmt_int eligible_playbook_count}}
{{#if customer}}
Customer

Profile

A dataset-specific template is loaded but did not declare any visible fields. Edit the template's frontmatter and HTML to surface the fields your CSMs need.

{{else}}
Customer profile not configured

Dataset-specific panel pending

No customer data source is declared in the active template. Two things to check:

  1. The apply_profile_override(...) cell in c05_snapshot_and_dashboard has run on the cluster, so the per-dataset HTML is published at /Volumes/<cat>/<sch>/dashboard_templates/<dataset>_profile.html. The app auto-discovers the newest .html there — no env var needed.
  2. If you want to pin a specific file, set the Databricks App env var CR_PROFILE_TEMPLATE_PATH — it overrides the auto-discovered template.

See docs/ech_notebook_ux_overrides.md (email-churn) or docs/sps_notebook_ux_overrides.md (SPS) for the ready-to-paste cells.

{{#if _template_diagnostic}}
Debug · template load diagnostic
Status
{{_template_diagnostic.status}}
Requested path
{{#if _template_diagnostic.requested_path}}{{_template_diagnostic.requested_path}}{{else}}(none — env var unset and auto-discovery returned empty){{/if}}
Env var CR_PROFILE_TEMPLATE_PATH
{{#if _template_diagnostic.env_var_set}}set{{else}}unset{{/if}}
Loaded from
{{_template_diagnostic.loaded_from}}
Catalog · Schema
{{_template_diagnostic.catalog}}.{{_template_diagnostic.schema}}
Parent dir exists
{{#if _template_diagnostic.parent_dir_exists}}yes{{else}}no — the app's service principal cannot stat the parent directory; grant READ_VOLUME or wait for the deployed grant to propagate (Stop/Start the app){{/if}}
{{#if _template_diagnostic.parent_dir_listing}}
Parent dir listing (first 20)
{{_template_diagnostic.parent_dir_listing}}
{{/if}} {{#if _template_diagnostic.error_type}}
Error
{{_template_diagnostic.error_type}}: {{_template_diagnostic.error_message}}
{{/if}} {{#if _template_diagnostic.data_sources}}
Declared data sources
    {{#each _template_diagnostic.data_sources}}
  • {{this.name}}{{this.source}} on {{this.join_key}} · {{this.status}} · {{this.row_count}} row(s){{#if this.error}} · {{this.error}}{{/if}}
  • {{/each}}
{{/if}}
{{/if}}
{{/if}}
{{#if account_top_shap_features}}
Why this account scored where it did

Model results interpretation

Each row is one factor the model leans on for this customer. The number is the customer's actual value, the pill shows where that value sits versus everyone else (very low → very high), and the bar's length and colour show how strongly it moved the churn score — risk-driving (yellow) pushes toward churn, protective (green) pulls away.

    {{#each account_top_shap_features}}
  • {{this.feature}} {{fmt_raw_value this.raw_value}} {{quantile_band this.raw_value this.q05 this.q25 this.q75 this.q95}} {{direction_phrase this.shap_contribution}}
    Scaled value (z-score)
    {{fmt_shap_value this.value}}
    SHAP contribution (log-odds)
    {{fmt_signed_shap this.shap_contribution}}
    {{#if this.z}}
    Std. deviations from population mean
    {{fmt_signed_z this.z}}
    {{/if}}
  • {{/each}}
{{#if feature_dictionary}}
What these factors mean Feature dictionary · lineage and definition

Where each factor above comes from, how it's computed, and what it represents in business terms. Pulled from feature_meta + column_descriptions for the latest scoring run.

    {{#each feature_dictionary}}
  • {{this.feature}} {{#if this.window_phrase}}{{this.window_phrase}}{{/if}} {{#if this.aggregation_kind}}{{this.aggregation_kind}}{{/if}}

    {{#if this.business_phrase}}{{this.business_phrase}}{{else}}{{derivation_phrase this.aggregation_kind this.feature this.source_columns this.window_phrase}}{{/if}}

    How it's computed
    {{derivation_phrase this.aggregation_kind this.feature this.source_columns this.window_phrase}}
    {{#if this.source_table}}
    Source dataset
    {{this.source_table}}
    {{/if}} {{#if this.source_columns}}
    Source columns
    {{#each this.source_columns}} {{this}} {{/each}}
    {{/if}} {{#if this.source_column_defs}}
    Column definitions
      {{#each this.source_column_defs}}
    • {{this.column_name}} — {{#if this.business_definition}}{{this.business_definition}}{{else}}(definition not yet curated){{/if}}
    • {{/each}}
    {{/if}}
  • {{/each}}
{{/if}}
{{/if}} {{#if feature_deviation}}
Vs. training population

How this customer compares

Bars show z-score vs. the training population (capped at ±3σ). Use as a reality-check on the SHAP drivers above — does the model lean on features where the customer actually deviates?

    {{#each feature_deviation}}
  • {{this.feature_name}} {{fmt_float this.feature_value 3}} {{fmt_signed_z this.z}}
  • {{/each}}
{{/if}}
{{#if recommended}}✓{{else}}◎{{/if}} {{#if recommended}}Recommended action{{else}}{{#if is_holdout}}Holdout{{else}}Not recommended{{/if}}{{/if}} {{playbook_name}} {{#if expected_uplift_pct}}Expected uplift · {{fmt_pct expected_uplift_pct}}{{/if}}
{{#if playbook_description}}

{{playbook_description}}

{{/if}} {{#if playbook_when_applicable}}
When this play helps
{{playbook_when_applicable}}
{{/if}} {{#if playbook_time_zero_definition}}
Time-zero definition
{{playbook_time_zero_definition}}
{{/if}} {{#if playbook_analysis_population_rule}}
Analysis population
{{playbook_analysis_population_rule}}
{{/if}} {{#if alternate_playbooks}}
Other applicable playbooks
{{#each alternate_playbooks}} {{this.playbook_name}} {{#if this.fit_score}}{{fmt_pct this.fit_score}} match{{/if}} {{#if this.expected_uplift_pct}}+{{fmt_pct this.expected_uplift_pct}}{{/if}} {{/each}}
{{/if}}
Archetype {{archetype_name}} {{#if policy_fit_score}}{{fmt_pct policy_fit_score}} match{{/if}} {{#if policy_fit_tier}}{{fit_tier_label policy_fit_tier}}{{/if}} {{#if archetype_cluster_size}}{{fmt_int archetype_cluster_size}} customers{{/if}} {{#if archetype_mean_churn_probability}}avg {{fmt_pct archetype_mean_churn_probability}} churn{{/if}}
{{#if archetype_description}}
Description
{{archetype_description}}
{{/if}} {{#if archetype_rationale}}
Why this customer matches
{{archetype_rationale}}
{{/if}} {{#if policy_rationale}}
Policy rationale
{{policy_rationale}}
{{/if}} {{#if eligibility_evidence}}
Evidence on this customer
{{eligibility_evidence}}
{{/if}}
Technical details
{{#if archetype_feature_thresholds}}
Feature thresholds
{{archetype_feature_thresholds}}
{{/if}} {{#if policy_eligibility_rules_prose}}
Eligibility rules · prose
{{policy_eligibility_rules_prose}}
{{/if}} {{#if eligibility_rules_sql}}
Eligibility predicate · SQL
{{eligibility_rules_sql}}
{{/if}}