声明类型推断验证状态待复核
独立站每月800个弃购用户全部发同一封挽回邮件点击率仅4%——买家意图预测只对高意图用户(P>0.7)精准触达CVR从4%提升到12-18%,年化GMV增益30-80万元同时降低低意图用户退订率
Skill-Purchase-Intent-Prediction
独立站每月800个弃购用户全部发同一封挽回邮件点击率仅4%——买家意图预测只对高意图用户(P>0.7)精准触达CVR从4%提升到12-18%,年化GMV增益30-80万元同时降低低意图用户退订率
¥30-80 万
待企业数据验证 · 缺失:样本、基线、时间窗、币种、计算方法、证据来源
独立站每月800个弃购用户全部发同一封挽回邮件点击率仅4%——买家意图预测只对高意图用户(P>0.7)精准触达CVR从4%提升到12-18%,年化GMV增益30-80万元同时降低低意图用户退订率
购买意图(Purchase Intent)≠ 购买兴趣(Purchase Interest):
用户行为信号 → 意图强度层次:
浏览产品页 → 兴趣(低意图)
多次浏览同品类 → 考虑(中意图)
加入收藏/Wishlist → 计划(中高意图)
加购物车 → 强意图
开始结账但未完成 → 极强意图(购买意图最高点)CATS 框架(聚类聚合 + 时序):
双层预测架构:
P(\text{purchase}|u,t) = \sigma\left(\underbrace{W_1 \cdot h_{cluster}}_{\text{宏观风格}} + \underbrace{W_2 \cdot h_{timeseries}}_{\text{近期意图趋势}} + b\right)意图分级输出:
业务问题:独立站每月约 800 个用户加购后未付款,平均客单价 $149。传统做法是给所有弃购用户发同一封挽回邮件,点击率仅 4%。实际上 70% 的弃购用户已经离开决策窗口,只有 30% 还在"考虑购买"阶段。
数据要求: - 用户行为序列(浏览/加购/结账/购买的时间戳) - 用户历史购买记录(频率/客单价/品类偏好) - 当前 session 行为(近 24 小时)
预期产出: - 每个弃购用户的购买意图评分(0-1) - 高意图用户名单(P > 0.7):24h 内发挽回邮件 - 中意图用户名单(0.4-0.7):3 天内发限时优惠 - 低意图用户(< 0.4):不触达(降低退订率)
代码块数量:2
"""
Purchase Intent Prediction
CATS 框架:聚类聚合 + 时序建模的买家意图预测
"""
import numpy as np
from collections import defaultdict
from dataclasses import dataclass
# 行为权重(意图信号强度)
BEHAVIOR_WEIGHTS = {
'view_product': 0.05,
'view_detail': 0.10,
'search_price': 0.15,
'compare': 0.20,
'add_wishlist': 0.25,
'add_cart': 0.50,
'start_checkout': 0.80,
'return_checkout': 0.90,
'purchase': 1.00,
}
@dataclass
class UserSession:
user_id: str
events: list # [{'action': str, 'timestamp': float, 'price': float}]
history_purchases: int = 0
days_since_last_purchase: float = 30.0
def compute_intent_timeseries(events: list, window_days: int = 7) -> np.ndarray:
"""计算用户近期行为的意图时序(每日意图强度)"""
if not events:
return np.zeros(window_days)
now = max(e['timestamp'] for e in events)
daily_intent = np.zeros(window_days)
for event in events:
days_ago = (now - event['timestamp']) / 86400 # 秒转天
if days_ago < window_days:
day_idx = min(int(days_ago), window_days - 1)
weight = BEHAVIOR_WEIGHTS.get(event.get('action', 'view_product'), 0.05)
daily_intent[window_days - 1 - day_idx] += weight
# 归一化
max_val = max(daily_intent.max(), 1e-8)
return daily_intent / max_val
def cluster_user_style(history_purchases: int, days_since_last: float,
avg_session_events: float) -> str:
"""用户购买风格聚类(简化版)"""
if history_purchases >= 5 and days_since_last < 30:
return 'loyal_active' # 忠诚活跃用户:高频购买
elif history_purchases >= 2 and avg_session_events > 8:
return 'deliberate' # 谨慎型:行为多但购买频率适中
elif history_purchases == 0 and avg_session_events > 5:
return 'new_high_intent' # 新用户高意图
elif avg_session_events < 3:
return 'casual' # 随意浏览型
else:
return 'regular'
CLUSTER_PRIORS = {
'loyal_active': 0.65,
'deliberate': 0.40,
'new_high_intent': 0.45,
'casual': 0.10,
'regular': 0.30,
}
def predict_purchase_intent(session: UserSession) -> dict:
"""
预测购买意图概率
返回: {intent_score, intent_level, recommended_action}
"""
# 时序意图分析
ts = compute_intent_timeseries(session.events)
# 最近3天意图趋势(是否在上升)
recent_trend = (ts[-1] + ts[-2] * 0.5) - (ts[-4] * 0.5 + ts[-5] * 0.3) if len(ts) >= 6 else 0
recent_intensity = ts[-3:].mean() if len(ts) >= 3 else 0
# 最高意图行为
max_behavior_weight = max(
(BEHAVIOR_WEIGHTS.get(e.get('action', ''), 0) for e in session.events),
default=0
)
# 用户风格先验
avg_events = len(session.events) / 7 if session.events else 1
user_style = cluster_user_style(
session.history_purchases,
session.days_since_last_purchase,
avg_events
)
style_prior = CLUSTER_PRIORS[user_style]
# 综合意图得分
raw_score = (
0.35 * max_behavior_weight +
0.25 * recent_intensity +
0.20 * max(0, recent_trend) +
0.20 * style_prior
)
intent_score = min(0.99, max(0.01, float(raw_score)))
# 分级
if intent_score >= 0.70:
level = 'HIGH'
action = '立即发挽回邮件/优惠券(24h内)'
elif intent_score >= 0.40:
level = 'MEDIUM'
action = '3天内发提醒/再营销广告'
else:
level = 'LOW'
action = '暂不触达,避免骚扰'
return {
'user_id': session.user_id,
'intent_score': round(intent_score, 3),
'intent_level': level,
'user_style': user_style,
'max_action_weight': round(max_behavior_weight, 2),
'recent_intensity': round(recent_intensity, 3),
'recommended_action': action,
}
def run_intent_prediction_demo():
print('=' * 65)
print('Purchase Intent Prediction — 买家购买意图预测')
print('=' * 65)
import time
now = time.time()
sessions = [
UserSession('U001',
events=[
{'action': 'view_product', 'timestamp': now - 7*86400},
{'action': 'view_detail', 'timestamp': now - 5*86400},
{'action': 'search_price', 'timestamp': now - 3*86400},
{'action': 'compare', 'timestamp': now - 2*86400},
{'action': 'add_cart', 'timestamp': now - 1*86400},
{'action': 'start_checkout','timestamp': now - 3600},
],
history_purchases=2, days_since_last_purchase=45),
UserSession('U002',
events=[
{'action': 'view_product', 'timestamp': now - 20*86400},
],
history_purchases=0, days_since_last_purchase=999),
UserSession('U003',
events=[
{'action': 'add_cart', 'timestamp': now - 2*86400},
{'action': 'return_checkout','timestamp': now - 86400},
{'action': 'compare', 'timestamp': now - 3600},
],
history_purchases=5, days_since_last_purchase=15),
UserSession('U004',
events=[
{'action': 'view_product', 'timestamp': now - 30*86400},
{'action': 'view_detail', 'timestamp': now - 28*86400},
],
history_purchases=1, days_since_last_purchase=90),
]
results = [predict_purchase_intent(s) for s in sessions]
results.sort(key=lambda x: -x['intent_score'])
print(f'\n📊 购买意图预测结果(从高到低):')
print(f' {"用户":>6} {"意图分":>8} {"级别":>8} {"风格":>18} {"建议行动"}')
print(' ' + '-' * 70)
for r in results:
icon = {'HIGH': '🔴', 'MEDIUM': '🟡', 'LOW': '🟢'}[r['intent_level']]
print(f' {r["user_id"]:>6} {r["intent_score"]:>8.3f} {icon} {r["intent_level"]:<8} '
f'{r["user_style"]:<18} {r["recommended_action"][:30]}')
high = [r for r in results if r['intent_level'] == 'HIGH']
mid = [r for r in results if r['intent_level'] == 'MEDIUM']
print(f'\n 高意图用户: {len(high)} 人 → 立即触达')
print(f' 中意图用户: {len(mid)} 人 → 3天内触达')
print('\n[✓] Purchase Intent Prediction 测试通过')
if __name__ == '__main__':
run_intent_prediction_demo()论文链接用于核验方法来源,不自动证明本页商业结果。