And TRSegmentOrthThingy
This commit is contained in:
parent
705154513f
commit
e0d9a447df
1 changed files with 13 additions and 0 deletions
13
src/TR.jl
13
src/TR.jl
|
|
@ -121,7 +121,20 @@ TRObj = TRSVD(U, s, V, mX, regType, regParam1, regMat, n, p);
|
|||
return TRObj
|
||||
end
|
||||
|
||||
function TRSegmentOrth(X, segments)
|
||||
|
||||
n = size(X,1);
|
||||
n_segments = maximum(segments);
|
||||
|
||||
U = zeros(n,n);
|
||||
|
||||
for seg in 1:n_segments
|
||||
inds = vec(seg .== segments)
|
||||
U[inds, inds], _, _ = svd(X[inds,:], full=false);
|
||||
end
|
||||
|
||||
return U
|
||||
end
|
||||
|
||||
"""
|
||||
function TRVirCV(X, y, lambdas, regType="L2", regParam1=0, regParam2=1e-14)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue