注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
收到一个code challenge立刻分享起来。. Χ
One way to analyze acquisition strategy and estimate marketing cost is to calculate the Lifetime Value (“LTV”) of a customer. Simply speaking, LTV is the projected revenue that customer will generate during their lifetime. A simple LTV can be calculated using the following equation: 52(a) x t. Where a is the average customer value per week (customer expenditures per visit (USD) x number of site visits per week) and t is the average customer lifespan. The average lifespan for Shutterfly is 10 years. Code RequirementsWrite a program that ingests event data and implements one analytic method, below. You are expected to write clean, well-documented and well-tested code. Be sure to think about performance - what the performance characteristic of the code is and how it could be improved in the future. You may use one of the following OO languages: Java, Python, Scala. Ingest(e, D)Given event e, update data D TopXSimpleLTVCustomers(x, D)Return the top x customers with the highest Simple Lifetime Value from data D. Please note that the timeframe for this calculation should come from D. That is, use the data that was ingested into D to calculate the LTV to frame the start and end dates of your LTV calculation. You should not be using external data (in particular "now") for this calculation. EventsPlease use the following sample events the Data Warehouse collects from Shutterfly’s public sites. All events have a key and event_time, but are received with no guaranteed order and with fluctuating frequency. See sample_input directory for a sample of each event. Customer- type *
- verb *
- Additional Data
- key(customer_id) *
- event_time *
- last_name
- adr_city
- adr_state
. .и
Site Visit- type *
- verb *
- Additional Data
- key(page_id) *
- event_time *
- customer_id *
- tags (array of name/value properties)
Image Upload- type *
- verb *
- Additional Data
- key(image_id) *
- event_time *
- customer_id *
- camera_make
- camera_model
Order- type *
- verb *
- Additional Data
- key(order_id) *
- event_time *
- customer_id *
- total_amount *
* represents required data Directory structureThis project has the following directories, and it is expected that your code will follow the same structure. - README.md- src (your source will live here)- input (input file you create as proof of functionality lives here)- output (output file with the result of TopXSimpleLTVCustomers(10, D). Include the calculated LTV.)- sample_input (one event of each type for visualization purposes)Reference
-baidu 1point3acres
|