用户流失预测

用户流失预测模型根据用户活动日志来预测哪些用户将要停止使用某个产品或网站(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',
...

你可能感兴趣的:(用户流失预测)