How is the productivity score calculated?

In Categorization, I can set a Productivity score for different categories, and I can see the Score in Activity and calculate the total score today. I set the score randomly now and found that it can give Top productive and Top distracting.
But I don’t understand how this score is calculated. I only know what impact setting positive and negative will have. I haven’t found a document that explains how the Productivity score is calculated.