## Synopsis

```
gitinsight --username [githubusername] (--nodaystats) #using the shipped bin
#or using the module
my $Insight= GitInsight->new(no_day_stats=>0);
$Insight->contrib_calendar("markov"); #specify here the github username
my $Result= $Insight->process;
$Result = $Insight->{result};
```

## Description

# NAME

GitInsight - Predict your github contributions using Bayesian inference and Markov chain

# SYNOPSIS

```
gitinsight --username [githubusername] (--nodaystats) #using the shipped bin
#or using the module
my $Insight= GitInsight->new(no_day_stats=>0);
$Insight->contrib_calendar("markov"); #specify here the github username
my $Result= $Insight->process;
$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 ] ]]
```

# DESCRIPTION

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).

# HOW DOES IT WORK?

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.

## THEORY

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.

# INSTALLATION

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
```

For the web interface also the following are required: ruby-sass ruby-compass

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, you can install all the dependencies with cpanm:

```
cpanm --installldeps .
```

# METHODS

## contrib_calendar($username)

Fetches the github contrib_calendar of the specified user

## process

Calculate the predictions and generate the CA

## start_day

Returns the first day of the contrib_calendar

## last_day

Returns the last day of the contrib calendar (prediction included)

## prediction_start_day

Returns the first day of the prediction (7 days of predictions)

# AUTHOR

mudler

# COPYRIGHT

Copyright 2014- mudler

# LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

## Comments

Please sign up to post a review.