GitInsight - Predict your github contributions using Bayesian inference and Markov chain
gitinsight --username [githubusername] (--nodaystats) (--accuracy) #using the shipped bin
#or using the module
my $Insight= GitInsight->new(no_day_stats => 0, username => "markov", accuracy=> 1);
my $Result= $Insight->process;
my $accuracy = $Insight->{accuracy};
$Result = $Insight->{result};
# $Result contains the next week predictions and is an arrayref of arrayrefs [ [ 'Sat', 1, '2014-07-1', [ 0 , '0.151515151515152', '0.0606060606060606', '0.0404040404040404', 0 ] ], .. [ 'DayofWeek', 'winner_label', 'day' , [ probability_label_0, probability_label_1, probability_label_2, probability_label_3, probability_label_4 ] ]]
GitInsight is module that allow you to predict your github contributions in the "calendar contribution" style of github (the table of contribution that you see on your profile page).
GitInsight generates a transation probrability matrix from your github contrib_calendar to compute the possibles states for the following days. Given that GitHub split the states thru 5 states (or here also called label), the probability can be inferenced by using Bayesian methods to update the beliefs of the possible state transition, while markov chain is used to predict the states. The output of the submitted data is then plotted using Cellular Automata.
We trace the transitions states in a matrix and increasing the count as far as we observe a transition (https://en.wikipedia.org/wiki/Transition_matrix), then we inference the probabilities using Bayesan method https://en.wikipedia.org/wiki/Bayesian_inference https://en.wikipedia.org/wiki/Examples_of_Markov_chains.
GitInsight requires the installation of gsl (GNU scientific library), gd(http://libgd.org/), PDL and PDL::Stats (to be installed after the gsl library set).
on Debian:
apt-get install gsl-bin libgs10-devt
apt-get install pdl libpdl-stats-perl libgd2-xpm-dev
It's reccomended to use cpanm to install all the required deps, install it thru your package manager or just do:
cpan App::cpanminus
After the installation of gsl, clone the repository and install all the dependencies with cpanm:
cpanm --installdeps .
Then install it as usual:
perl Build.PL
./Build
./Build test #ensure that the module works correctly
./Build install
required, it's the GitHub username used to calculate the prediction
you can enable/disable the cellular autmata output using this option (1/0)
setting this option to 1, will slightly change the prediction: it will be calculated a unique transition matrix instead one for each day
used to cut the days from the start (e.g. if you want to delete the first 20 days from the prediction, just set this to 20)
used to select a range where the prediction happens (e.g. if you want to calculate the prediction of a portion of your year of contribution)
here you can choose the file output name for ca.
Enable/disable accuracy calculation (1/0)
Enable/disable verbosity (1/0)
Fetches the github contrib_calendar of the specified user
Calculate the predictions and generate the CA
Returns the first day of the contrib_calendar
Returns the last day of the contrib calendar (prediction included)
Returns the first day of the prediction (7 days of predictions)
mudler mudler@dark-lab.net
Copyright 2014- mudler
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.