mirror of
https://github.com/gonum/gonum.git
synced 2025-10-18 13:10:47 +08:00
stat: reduce rendered precision of LinearRegression example
This commit is contained in:
@@ -34,12 +34,12 @@ func ExampleLinearRegression() {
|
||||
alpha, beta := stat.LinearRegression(xs, ys, weights, origin)
|
||||
r2 := stat.RSquared(xs, ys, weights, alpha, beta)
|
||||
|
||||
fmt.Printf("Estimated slope is: %v\n", alpha)
|
||||
fmt.Printf("Estimated offset is: %v\n", beta)
|
||||
fmt.Printf("R^2: %v\n", r2)
|
||||
fmt.Printf("Estimated slope is: %.6f\n", alpha)
|
||||
fmt.Printf("Estimated offset is: %.6f\n", beta)
|
||||
fmt.Printf("R^2: %.6f\n", r2)
|
||||
|
||||
// Output:
|
||||
// Estimated slope is: 0.988572424633503
|
||||
// Estimated offset is: 3.0001541344029676
|
||||
// R^2: 0.9999991095061128
|
||||
// Estimated slope is: 0.988572
|
||||
// Estimated offset is: 3.000154
|
||||
// R^2: 0.999999
|
||||
}
|
||||
|
Reference in New Issue
Block a user