用户流失预测

用户流失预测模型根据用户活动日志来预测哪些用户将要停止使用某个产品或网站(The GraphLab Create Churn Prediction toolkit allows predicting which users will churn (stop using) a product or website given user activity logs.)下面是一个使用这个模块的例子

import graphlab as gl
import datetime
//Load a data set.
sf = gl.SFrame(... 'https://static.turi.com/datasets/churn-prediction/online_retail.csv')
//Convert InvoiceDate from string to datetime.
import dateutil
from dateutil import parser
sf['InvoiceDate'] = sf['InvoiceDate'].apply(parser.parse)
//Convert SFrame into TimeSeries.
time_series = gl.TimeSeries(sf, 'InvoiceDate')
//Create a train-test split.
train, valid = gl.churn_predictor.random_split(time_series,
... user_id='CustomerID', fraction=0.9)
Train a churn prediction model.
model = gl.churn_predictor.create(train, user_id='CustomerID',
...

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 暖男,像旭日阳光,能给人温暖感觉。 这个品种基本上被影视剧里的男二号包揽, 他们体贴顾家,更能理解和体恤女人的感情...
    notemper阿嘎西阅读 2,593评论 0 0
  • 无数的成功人士,都是在专注地、重复地做一件事情。 学习要主动、学习要重复、成功等于简单的事情重复去做、持续去做。 ...
    思念的诗阅读 1,274评论 1 2
  • 同事适逢婚嫁年龄,相亲了几次,终于遇到一个互相欣赏的对象,经过交往确定了关系。就在双方高高兴兴准备订婚时,家...
    镜子骑士阅读 2,720评论 0 0
  • (这是我写下的第9件事。写故事的我,不是个歌颂者。而只是愿意保留心底的善意,看见并相信人与人之间拥有的真、善、美,...
    vines小曦阅读 3,483评论 2 2

友情链接更多精彩内容