Improve and generalize estimator interface.

This commit is contained in:
gmp
2025-05-09 16:44:01 -04:00
parent cc0ec72936
commit a20355bc17
2 changed files with 307 additions and 61 deletions
+10 -2
View File
@@ -232,13 +232,21 @@ func main() {
}
}
}
a, b := review.FitPowerLaw(weights, reps, date, 14.0)
//a, b := review.FitPowerLaw(weights, reps, date, 14.0)
est, err := review.Fit(weights, reps, date,
review.WithAllModels(),
review.WithHalfLife(14.0),
)
if err != nil {
fmt.Printf("Error estimating performance: %v\n", err)
os.Exit(1)
}
for i := 1; i<=10; i++ {
adj := 0.0
if isbw {
adj = ps[len(ps)-1].Bodyweight
}
fmt.Printf("%d: %0.0f\n", i, review.EstimateMaxWeight(a, b, float64(i)) - adj)
fmt.Printf("%d: %0.0f\n", i, est.EstimateMaxWeight(float64(i)) - adj)
}
case "predict":
if flag.NArg() != 3 {