Skip to content

Commit 88deef0

Browse files
committed
Refactor nystrom.jl
1 parent 0d0cc97 commit 88deef0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/approximations/nystrom.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function sampleindex(X::AbstractMatrix, r::Real; obsdim::Integer=defaultobs)
55
0 < r <= 1 || throw(ArgumentError("Sample rate `r` must be in range (0,1]"))
66
n = size(X, obsdim)
77
m = ceil(Int, n*r)
8-
S = StatsBase.sample(collect(1:n), m; replace=false, ordered=true)
8+
S = StatsBase.sample(1:n, m; replace=false, ordered=true)
99
return S
1010
end
1111

@@ -87,9 +87,7 @@ Returns a `NystromFact` struct which stores a Nystrom factorization satisfying:
8787
"""
8888
function nystrom(k::Kernel, X::AbstractMatrix, r::AbstractFloat; obsdim::Int=defaultobs)
8989
S = sampleindex(X, r; obsdim=obsdim)
90-
C, Cs = nystrom_sample(k, X, S; obsdim=obsdim)
91-
W = nystrom_pinv!(Cs)
92-
return NystromFact(W, C)
90+
return nystrom(k, X, S; obsdim=obsdim)
9391
end
9492

9593
"""

0 commit comments

Comments
 (0)