ltv-predictor

Predict customer lifetime value from order data using RFM features.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, scikit-learn, matplotlib, seaborn, openpyxl, flask, and includes scripts (resource) components.

What problem does it solve?

This Skill automates Customer Lifetime Value analysis by turning raw order data into RFM features and LTV predictions, reducing manual data wrangling and modeling time.

Core Features & Use Cases

  • RFM feature engineering: compute R, F, M and segment customers.
  • Multiple regression models: linear regression and random forest with model comparison and CV.
  • Batch predictions & reports: generate LTV predictions for many customers and export HTML/Markdown/Excel reports.
  • Business impact: enables data-driven lifecycle management, targeted marketing, and retention strategies.

Quick Start

Quick Start: Use the LTV Predictor to load order data, compute RFM features, train models, and predict LTV for new customers with a single command. For example: from scripts.quick_analysis import quick_ltv_analysis; quick_ltv_analysis(file_path='data/sample_orders.csv', feature_period_months=3, prediction_period_months=12, output_dir='./ltv_results')

Frequently Asked Questions about ltv-predictor

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

FAQPage Schema
How do I predict customer lifetime value from order data?

Predict customer lifetime value by computing RFM (Recency, Frequency, Monetary) features from raw order data, then training regression models—linear or random forest—to estimate LTV. This Skill automates the entire pipeline: load CSV order files, engineer RFM features, train and compare models with cross-validation, and generate batch predictions for customer segments.

What is RFM analysis and how does it help with LTV prediction?

RFM analysis segments customers by Recency (last purchase), Frequency (purchase count), and Monetary value (total spent). These three dimensions become features that predict future customer lifetime value, enabling data-driven lifecycle management and targeted retention strategies based on purchase behavior patterns.

Can I use this to generate reports after predicting LTV?

Yes. After training models and predicting LTV, this Skill exports automated reports in HTML, Markdown, and Excel formats. Reports include predictions, model comparisons, visualizations, and business metrics, reducing manual reporting time for retail and e-commerce contexts.

What data format and preprocessing does the LTV predictor require?

The LTV predictor accepts CSV order data and handles preprocessing internally: data cleaning, outlier handling, and feature scaling. It requires order-level records with transaction details to compute RFM features; openpyxl and pandas manage input validation and output formatting.

How do linear regression and random forest models compare for LTV prediction?

This Skill trains both linear regression and random forest models on RFM features and compares performance using cross-validation. Random forest typically captures non-linear relationships in customer behavior; linear regression is simpler and more interpretable. Choose based on accuracy, interpretability, and business needs.

What libraries and environment do I need to run the LTV predictor?

You need Python with pandas, numpy, scikit-learn, matplotlib, seaborn, openpyxl, and flask installed. The Skill runs as scripts in a Python environment; these dependencies handle data manipulation, model training, visualization, and reporting—no additional setup beyond a standard data science environment.