mirror of
https://github.com/sjwhitworth/golearn.git
synced 2025-04-28 13:48:56 +08:00
Remove duplicate import paths
This commit is contained in:
parent
97f6212319
commit
d252e1174b
@ -7,7 +7,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
matrix "gonum.org/v1/gonum/mat"
|
||||
"github.com/sjwhitworth/golearn/base"
|
||||
"github.com/sjwhitworth/golearn/kdtree"
|
||||
"github.com/sjwhitworth/golearn/metrics/pairwise"
|
||||
@ -430,7 +429,7 @@ func NewKnnRegressor(distfunc string) *KNNRegressor {
|
||||
|
||||
func (KNN *KNNRegressor) Fit(values []float64, numbers []float64, rows int, cols int) {
|
||||
if rows != len(values) {
|
||||
panic(matrix.ErrShape)
|
||||
panic(mat.ErrShape)
|
||||
}
|
||||
|
||||
KNN.Data = mat.NewDense(rows, cols, numbers)
|
||||
|
@ -3,7 +3,6 @@ package pairwise
|
||||
import (
|
||||
"math"
|
||||
|
||||
matrix "gonum.org/v1/gonum/mat"
|
||||
"gonum.org/v1/gonum/mat"
|
||||
)
|
||||
|
||||
@ -17,7 +16,7 @@ func (c *Chebyshev) Distance(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
|
||||
r1, c1 := vectorX.Dims()
|
||||
r2, c2 := vectorY.Dims()
|
||||
if r1 != r2 || c1 != c2 {
|
||||
panic(matrix.ErrShape)
|
||||
panic(mat.ErrShape)
|
||||
}
|
||||
|
||||
max := float64(0)
|
||||
|
@ -3,7 +3,6 @@ package pairwise
|
||||
import (
|
||||
"math"
|
||||
|
||||
matrix "gonum.org/v1/gonum/mat"
|
||||
"gonum.org/v1/gonum/mat"
|
||||
)
|
||||
|
||||
@ -24,7 +23,7 @@ func (c *Cranberra) Distance(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
|
||||
r1, c1 := vectorX.Dims()
|
||||
r2, c2 := vectorY.Dims()
|
||||
if r1 != r2 || c1 != c2 {
|
||||
panic(matrix.ErrShape)
|
||||
panic(mat.ErrShape)
|
||||
}
|
||||
|
||||
sum := .0
|
||||
|
@ -3,7 +3,6 @@ package pairwise
|
||||
import (
|
||||
"math"
|
||||
|
||||
matrix "gonum.org/v1/gonum/mat"
|
||||
"gonum.org/v1/gonum/mat"
|
||||
)
|
||||
|
||||
@ -19,7 +18,7 @@ func (m *Manhattan) Distance(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
|
||||
r1, c1 := vectorX.Dims()
|
||||
r2, c2 := vectorY.Dims()
|
||||
if r1 != r2 || c1 != c2 {
|
||||
panic(matrix.ErrShape)
|
||||
panic(mat.ErrShape)
|
||||
}
|
||||
|
||||
result := .0
|
||||
|
Loading…
x
Reference in New Issue
Block a user