Matlab implementation of the VnC-Model which is described in the following paper:
Vote-and-Comment: Modeling the Coevolution of User Interactions in Social Voting Web Sites
Alceu Ferraz Costa, Agma Juci Machado Traina, Caetano Traina Jr., and Christos Faloutsos
IEEE International Conference on Data Mining (ICDM), 2016
First, we need to load some data to use in the examples below. Also we will include into Matlab path variable all the subfolders of the repository:
addpath(genpath('.'));
[ Ucell, Dcell, Ccell ] = load_data('imgur');To fit an up-vote time-series, we use the fit_vote_model function, passing
as input argument a handle to the v_and_c function and the time-series that
we want to fit (in this case, Ucell{1}):
params = fit_vote_model(@v_and_c, Ucell{1});Now we can use the plot_vote_model_fit to compare the fit to the data:
plot_vote_model_fit(@v_and_c, params, Ucell{1});The result should be similar to the following figure:
To fit the the up-vote vs. down-vote curve of a submission we can use the
fit_up_vs_downvote function.
The fit_up_vs_downvote function ensures that the parameters that control the
reaction times in VnC are the same for the up-vote and down-vote time-series
(see the Section IV-B of the paper).
[params_up, params_down] = fit_up_vs_downvote(Ucell{1}, Dcell{1});To plot the fitted up-vote vs. down-vote trajectory we use the function
plot_up_vs_downvote_fit:
plot_up_vs_downvote_fit(params_up, params_down, Ucell{1}, Dcell{1});To fit the the votes vs. comments curve of a submission we use the
fit_votes_vs_comments function:
[params_comm] = fit_votes_vs_comments(@comm_vnc, Ucell{1}, Dcell{1}, Ccell{1});And now we plot the resulting curve using the plot_votes_vs_comments_fit
function:
plot_votes_vs_comments_fit(@comm_vnc, params_comm, Ucell{1}, Dcell{1}, Ccell{1});To forecast a time-series we use the tail_forecast function. It takes as input
a training part of a complete time-series, the model that will be used for
forecasting and the desired length of the forecasted time-series.
In the example below, we use the first trainSize = 30 time-ticks of the
up-vote time-series Ucell{1} to train the VnC model:
trainSize = 30;
forecastSize = 100;
[ Uforecast ] = tail_forecast(Ucell{1}(1:trainSize), @v_and_c, forecastSize);To plot the result we use the plot_tail_forecast function:
plot_tail_forecast(@v_and_c, Ucell{1}, Uforecast, trainSize);You can find a small sample of the Reddit, Imgur and Digg data used in the
paper in the sample_data of this repository.
The complete Reddit and Imgur datasets are on OSF.
The Digg dataset can be found here.