سعيد
سعيد

Reputation: 1764

how to calculate estimated time accuracy

I'm developing a todo app , when the user creates a new project they input title and a ruff estimated time to measure how good they plan projects .on project finish user is redirected to projects stats route in which I'm calculating the accuracy of thier estimation :

    const diff_minutes=(dt2, dt1)=> 
    {
        var diff =(dt2.getTime() - dt1.getTime()) / 1000;
        diff /= 60;
        return Math.abs(Math.round(diff));
    }


    const started_at=project.started_at
    const finished_at=project.finished_at
    const estmated_time =project.estmated_time // minutes

    const project_duration_in_minutes =diff_minutes( started_at,finished_at);
    const accuracy =  -(project_duration_in_minutes  - estmated_time )/100 
   

so the idea is the lower project_duration_in_minutes is from the estmatedtime the better the accuracy is and vice versa . for example :

  const estmated_time = 10  
  const project_duration_in_minutes  = 15 
  const accuracy =  -(project_duration_in_minutes  - est  )/100 //accuracy = -50%
  
  const estmated_time = 10  
  const project_duration_in_minutes  = 5
  const accuracy =  -(project_duration_in_minutes  - est  )/100 //accuracy = 50%

this kind of does it but I would love to see a better approach .

Upvotes: 2

Views: 265

Answers (2)

Ben West
Ben West

Reputation: 4596

actual_time / estimated_time gives you the difference in time as a ratio. So estimated 10 minutes, took 5 minutes = 0.5x the estimated time. Multiply by 100 for a percent.

You seem to be looking for high numbers when the time was less than expected. estimated_time / actual_time gives you the difference in speed as a ratio. So estimated 10 minutes, took 5 minutes = 2x the estimated speed.

Upvotes: 2

Abhinav Mathur
Abhinav Mathur

Reputation: 8186

There's a few alternatives here:

  1. Add an abs method to your function, since accuracy doesn't need a positive/negative indicator in your case.
  2. In your current formula, if actual time exceeds the estimate by a big margin, you'll get undesirable results. Instead of using a linear function, you could also use an exponential one:
Accuracy = 100* e^-(abs(est-project_duration_in_minutes)/project_duration_in_minutes)

Upvotes: 1

Related Questions