1 2 3 4 5 6 7 8 9 10 11 12
// In statistics, one of the standard ways to calculate an estimate/estimation quality, // to be able to compare how good are different estimates. let inline averageSquareError estimated actual = Array.zip estimated actual |> Array.averageBy (fun (w,o) -> pown (o - w) 2) //let estimated = [|1.0; 2.0; 3.0; 4.0; 5.0|] //let actual = [|1.1; 2.2; 2.8; 4.0; 5.1|] //let err = averageSquareError estimated actual //val err : float = 0.02
You can clone a snippet to your computer for local editing. Learn more.