mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-26 13:49:14 +08:00
Use AlmostEqual for numerical comparison.
This commit is contained in:
parent
b4abf54c07
commit
1e21802d2e
@ -26,8 +26,8 @@ func TestPolyKernel(t *testing.T) {
|
||||
Convey("When calculating distance", func() {
|
||||
result := polyKernel.Distance(vectorX, vectorY)
|
||||
|
||||
Convey("The result should be 31.622776601683793", func() {
|
||||
So(result, ShouldEqual, 31.622776601683793)
|
||||
Convey("The result should alomost equal 31.622776601683793", func() {
|
||||
So(result, ShouldAlmostEqual, 31.622776601683793)
|
||||
})
|
||||
|
||||
})
|
||||
|
@ -18,8 +18,8 @@ func TestRBFKernel(t *testing.T) {
|
||||
Convey("When doing inner product", func() {
|
||||
result := rbfKernel.InnerProduct(vectorX, vectorY)
|
||||
|
||||
Convey("The result should be 0.4065696597405991", func() {
|
||||
So(result, ShouldEqual, 0.4065696597405991)
|
||||
Convey("The result should almost equal 0.4065696597405991", func() {
|
||||
So(result, ShouldAlmostEqual, 0.4065696597405991)
|
||||
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user