Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add productivity score for categories #258

Merged
merged 3 commits into from
May 15, 2023
Merged

feat: add productivity score for categories #258

merged 3 commits into from
May 15, 2023

Conversation

ErikBjare
Copy link
Member

@ErikBjare ErikBjare commented Feb 22, 2021

Rebased and salvaged #162

Shouldn't require any changes to backend code.

Tasks

  • Review what would make the best UX from previous discussions
  • How long you need to engage in a 1 point activity to get 1 point? (an hour?)
  • Add computation of score for period
    • totalScore = 0
      for event in events:
        totalScore += event.duration * get_score(event.category, allCategories)
      return totalScore / (60 * 60)  # from score-seconds to score-hours
  • Add visualization (just a number of the total score today?)
  • Make sure score is inherited correctly
  • What should scores be for the default categories?

@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Patch coverage has no change and project coverage change: -0.32 ⚠️

Comparison is base (af12a54) 24.53% compared to head (ff9ecab) 24.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
- Coverage   24.53%   24.22%   -0.32%     
==========================================
  Files          27       27              
  Lines        1520     1540      +20     
  Branches      248      251       +3     
==========================================
  Hits          373      373              
- Misses       1122     1142      +20     
  Partials       25       25              
Impacted Files Coverage Δ
src/main.js 0.00% <0.00%> (ø)
src/stores/activity.ts 30.24% <0.00%> (-0.78%) ⬇️
src/stores/categories.ts 50.00% <0.00%> (-5.56%) ⬇️
src/util/classes.ts 81.18% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@johan-bjareholt
Copy link
Member

How long you need to engage in a 1 point activity to get 1 point? (an hour?)

I never thought of it in that way at all.

Since you can do productive things outside of using your computer, to me it's more important to give a score of how productive you are on average rather than a sum of all your productive time.
So rather than to just say a number "Todays productivity score was 800", I had always imagined a scale from -1 to 1 which could in text say "Very productive" if it's for example above 0.7 or something.

@nicolae-stroncea
Copy link
Member

@johan-bjareholt I think the current way is essentially identical to your way, except that the final value is unbounded. The current formula essentially returns a score-weighted average, where the scores can be both negative and positive depending on what the scores the user sets, so user more productive -> total score increases, user unproductive -> total score decreases.

If we want to bound the value, we can pass it through a tanh(total_score) function, which will map the values to [-1,1].

image

@ErikBjare
Copy link
Member Author

I added a really quick-n-dirty visualization in the latest commit:

image

@ErikBjare ErikBjare force-pushed the dev/score branch 2 times, most recently from 90206ae to fae2a38 Compare May 15, 2023 12:08
@ErikBjare
Copy link
Member Author

Finally merging this. The remaining tasks will have to wait for another day.

@ErikBjare ErikBjare merged commit f4e0793 into master May 15, 2023
@ErikBjare ErikBjare deleted the dev/score branch May 15, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants