The VADER algorithm displays estimates of grades up to 4 classes of feelings https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L441 :
neg : Negativeneu : Neutralpos : Positivecompound : Connection (i.e. aggregated score)
Having skipped the code, the first instance of the connection is located at https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L421 , where it calculates:
compound = normalize(sum_s)
The normalize() function is defined as such in https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L107 :
def normalize(score, alpha=15): """ Normalize the score to be between -1 and 1 using an alpha that approximates the max expected value """ norm_score = score/math.sqrt((score*score) + alpha) return norm_score
So, there is an alpha hyperparameter.
As for sum_s , this is the sum of sentiment arguments passed to score_valence() function https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L413
And if we trace this sentiment argument, we will see that it is calculated by calling the polarity_scores() function in https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L217 :
def polarity_scores(self, text): """ Return a float for sentiment strength based on the input text. Positive values are positive valence, negative value are negative valence. """ sentitext = SentiText(text)
Looking at the polarity_scores function, it iterates through the entire SentiText vocabulary and checks using the sentiment_valence() function based on rules to assign a valence rating to the mood https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader .py # L243 , see Section 2.1.1 http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf
So, returning to a composite assessment, we see that:
compound evaluation - normalized evaluation of sum_s andsum_s is the sum of the valency calculated based on some heuristics and vocabulary of feelings (for example, the intensity of temptation) and- a normalized estimate is simply
sum_s divided by its square plus an alpha parameter that increases the denominator of the normalization function.
Is this a calculation from the vector [pos, neu, neg]?
Not really =)
If we look at the score_valence function https://github.com/nltk/nltk/blob/develop/nltk/sentiment/vader.py#L411 , we will see that the composite score is calculated using sum_s to pos, neg and neu are calculated with using _sift_sentiment_scores() , which computes the estimates of invidiual pos, neg and neu, using the original estimates from sentiment_valence() without a sum.
If we look at this mathematical math alpha , it seems that the normalization output is quite unstable (if you leave it unlimited), depending on the value of alpha :
alpha=0 :

alpha=15 :

alpha=50000 :

alpha=0.001 :

He becomes funky when he is negative:
alpha=-10 :

alpha=-1,000,000 :

alpha=-1,000,000,000 :
