rfm-customer-segmentation

Analyzes CSV transaction data to compute RFM metrics and segment customers via K-means clustering with Chinese-language support.

264|45|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/liangdabiao/claude-data-analysis-ultra-main --skill rfm-customer-segmentation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rfm-customer-segmentation
Source: https://github.com/liangdabiao/claude-data-analysis-ultra-main/tree/main/.claude/skills/rfm-customer-segmentation
Command: npx skills add https://github.com/liangdabiao/claude-data-analysis-ultra-main --skill rfm-customer-segmentation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, scikit-learn, matplotlib, seaborn.

What problem does it solve?

This Skill automates RFM analysis and customer segmentation for ecommerce data, reducing manual work and enabling data-driven marketing decisions across Chinese datasets.

Core Features & Use Cases

  • 自动RFM分析: 计算 Recency、Frequency、Monetary 指标并生成分群
  • 智能聚类: 使用肘部法则自动确定聚类数并执行 K-means 分群
  • 可视化与报告: 生成仪表板、分群汇总和 VIP 客户清单,语言支持中文
  • Use Case: 针对电商历史订单,识别高价值 VIP 客户并给出精准营销建议

Quick Start

  • 将交易数据保存为 CSV,包含字段如 用户码、最近购买日期、购买次数、总消费金额等。
  • 调用 RFM 分析引擎对数据执行完整分析,输出 customer_segments.csv、rfm_dashboard.png 等结果,以及可选的 VIP 营销清单。

Frequently Asked Questions about rfm-customer-segmentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I segment e-commerce customers using RFM analysis?

RFM segmentation divides customers into groups based on Recency (last purchase date), Frequency (purchase count), and Monetary (total spending). This Skill automates RFM computation on CSV transaction data and applies K-means clustering to identify customer segments like VIP buyers, enabling targeted marketing campaigns.

Can I use K-means clustering to automatically determine the number of customer segments?

Yes. This Skill uses the elbow method to automatically select the optimal number of K-means clusters from your transaction data, eliminating manual tuning and producing stable, reproducible customer segments.

What input data format does RFM customer segmentation require?

RFM analysis requires CSV files with transaction-level data including user_id, order_date, quantity, and unit_price fields. The Skill handles data cleaning and Chinese character support, then outputs customer_segments.csv, visualizations, and VIP lists.

How do I generate a VIP customer list and marketing reports from transaction data?

After RFM segmentation and K-means clustering, this Skill automatically scores customer segments and exports a VIP customer list alongside visualizations and segmentation summaries, ready for marketing use.

Does this Skill work with Chinese e-commerce data?

Yes. This Skill is built for Chinese datasets and provides full Chinese language support throughout RFM analysis, clustering, dashboard generation, and VIP customer reports.

What libraries does RFM segmentation depend on?

RFM analysis relies on pandas and numpy for data processing, scikit-learn for K-means clustering, and matplotlib and seaborn for visualization and dashboard generation.