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.
1010"""
1111struct MahalanobisKernel{T<: Real , A<: AbstractMatrix{T} } <: SimpleKernel
1212 P:: A
13- function MahalanobisKernel (P:: AbstractMatrix{T} ) where {T<: Real }
13+ function MahalanobisKernel (; P:: AbstractMatrix{T} ) where {T<: Real }
1414 LinearAlgebra. checksquare (P)
1515 new {T,typeof(P)} (P)
1616 end
Original file line number Diff line number Diff line change 55 v2 = rand (rng, 3 )
66
77 P = rand (rng, 3 , 3 )
8- k = MahalanobisKernel (P)
8+ k = MahalanobisKernel (P= P )
99
1010 @test kappa (k, x) == exp (- x)
1111 @test k (v1, v2) ≈ exp (- sqmahalanobis (v1, v2, P))
1212 @test kappa (ExponentialKernel (), x) == kappa (k, x)
1313 @test repr (k) == " Mahalanobis Kernel (size(P) = $(size (P)) )"
14- # test_ADs(P -> MahalanobisKernel(P), P)
14+ # test_ADs(P -> MahalanobisKernel(P=P ), P)
1515 @test_broken " Nothing passes (problem with Mahalanobis distance in Distances)"
1616end
You can’t perform that action at this time.
0 commit comments