File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ where the matrix P is the metric.
10
10
"""
11
11
struct MahalanobisKernel{T<: Real , A<: AbstractMatrix{T} } <: SimpleKernel
12
12
P:: A
13
- function MahalanobisKernel (P:: AbstractMatrix{T} ) where {T<: Real }
13
+ function MahalanobisKernel (; P:: AbstractMatrix{T} ) where {T<: Real }
14
14
LinearAlgebra. checksquare (P)
15
15
new {T,typeof(P)} (P)
16
16
end
Original file line number Diff line number Diff line change 5
5
v2 = rand (rng, 3 )
6
6
7
7
P = rand (rng, 3 , 3 )
8
- k = MahalanobisKernel (P)
8
+ k = MahalanobisKernel (P= P )
9
9
10
10
@test kappa (k, x) == exp (- x)
11
11
@test k (v1, v2) ≈ exp (- sqmahalanobis (v1, v2, P))
12
12
@test kappa (ExponentialKernel (), x) == kappa (k, x)
13
13
@test repr (k) == " Mahalanobis Kernel (size(P) = $(size (P)) )"
14
- # test_ADs(P -> MahalanobisKernel(P), P)
14
+ # test_ADs(P -> MahalanobisKernel(P=P ), P)
15
15
@test_broken " Nothing passes (problem with Mahalanobis distance in Distances)"
16
16
end
You can’t perform that action at this time.
0 commit comments