LinearAlgebra.SingularException Error while executing radial basis interpolation using Surrogates in julia?

Your training data contains only a single sampling point with multiple values. Replace with more sound data and your code works:

julia> train = Float64[
           1 2 3
           4 5 6
           7 8 9
       ]
3×3 Matrix{Float64}:
 1.0  2.0  3.0
 4.0  5.0  6.0
 7.0  8.0  9.0

julia> t(train, test)
(RadialBasis{Surrogates.var"#1#2", Int64, Vector{Tuple{Float64, Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Bool}(Surrogates.var"#1#2"(), 0, [(1.0, 2.0), (4.0, 5.0), (7.0, 8.0)], [3.0, 6.0, 9.0], [1.0, 2.0], [7.0, 8.0], [0.3535533905932738, 0.0, -0.3535533905932738, 6.0], 1.0, false), [3.0939521879919494, 3.0939521879919494, 3.5922131362964587, 3.5922131362964587, 3.5922131362964587, 3.5922131362964587, 3.5922131362964587, 3.5922131362964587])
2 Likes