Skip to content

Commit

Permalink
Update snipals.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
mlesnoff committed Jan 5, 2025
1 parent 700e1dd commit 5911255
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/snipals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function snipals(X; kwargs...)
end
res = nipals(X; kwargs...)
t = res.u * res.sv
t0 = similar(t)
v = similar(res.v)
v0 = similar(v)
absv = copy(v)
Expand All @@ -21,7 +20,6 @@ function snipals(X; kwargs...)
nzeros = p - nvar # degree of sparsity
while cont
v0 .= copy(v)
t0 .= copy(t)
mul!(v, X', t)
## Sparsity
if nzeros > 0
Expand All @@ -35,11 +33,10 @@ function snipals(X; kwargs...)
## End
v ./= normv(v)
mul!(t, X, v)
difv = sum((v .- v0).^2)
dift = sum((t .- t0).^2)
dif = sum((v .- v0).^2)
iter = iter + 1
if (difv < par.tol) || (dift < par.tol) || (iter > par.maxit)
cont = false
if (dif < par.tol) || (iter > par.maxit)
cont = false
end
end
niter = iter - 1
Expand Down

3 comments on commit 5911255

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/122434

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" 591125550d670772c0a2170818de6de4afc3803a
git push origin v0.7.0

@mlesnoff
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Breaking changes

  • Breaking

    • dummy: To improve time computations, the output 'Y' is now a BitMatrix.
    • fweight: remaned to wdis.
    • iqr: renamed to iqrv.
    • mad: renamed to madv.
    • normw: renamed to normv.
    • fweightdis: renamed to wdis.
    • plotgrid: argument 'title_leg' renamed to 'leg_title'.
    • talworth: renamed to wtal.
    • wdist: renamed to winvs.
    • Sparse Pca/Pls regression & discrimination:
      • splskern: renamed to splsr.
      • Argument'meth' has changed.
  • New (not breaking)

    • fweight: Weight each row of a matrix.
    • sumv, meanv, stdv, varv: Vector operations.
    • frob2: Square of the Frobenius norm of a matrix.
    • spcr: Sparse PCR.
  • Other modifications (not breaking)

    • Code cleaning.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/122434

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" 591125550d670772c0a2170818de6de4afc3803a
git push origin v0.7.0

Please sign in to comment.