/
hmatrix-nipals.cabal
78 lines (72 loc) · 2.89 KB
/
hmatrix-nipals.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Name: hmatrix-nipals
Version: 0.2
Synopsis:
NIPALS method for Principal Components Analysis on large data-sets.
Description:
NIPALS -- Nonlinear Iterative Partial Least Squares
<http://en.wikipedia.org/wiki/NIPALS>, is a method for iteratively
finding the left singular vectors of a large matrix. In other words
it discovers the largest principal component
<http://en.wikipedia.org/wiki/Principal_component> of a set of
mean-centred samples, along with the score (the magnitude of the
principal component) for each sample, and the residual of each
sample that is orthogonal to the principal component. By repeating
the procedure on the residuals, the second principal component is
found, and so on.
.
The advantage of NIPALS over more traditional methods, like SVD, is
that it is memory efficient, and can complete early if only a small
number of principal components are needed. It is also simple to
implement correctly. Additionally, because it doesn't pre-condition
the sample matrix in any way, it can be implemented with only two
sequential passes per iteration through the sample data, which is
much more efficient than random accesses if the data-set is too
large to fit in memory.
.
NIPALS is not generally recommended because sample matrices where
the largest eigenvalues are close in magnitude will cause NIPALS to
converge very slowly. For sparse matrices, use Lanczos methods
<http://en.wikipedia.org/wiki/Lanczos_algorithm>, and for dense
matrices, random-projection methods
<http://amath.colorado.edu/faculty/martinss/Pubs/2009_HMT_random_review.pdf>
can be used. However, these methods are harder to implement in a
single pass. If you know of a good, single-pass, and
memory-efficient implementation of either of these methods, please
contact the author.
Homepage: http://github.com/alanfalloon/hmatrix-nipals
Bug-reports: https://github.com/alanfalloon/hmatrix-nipals/issues
License: LGPL-2.1
License-file: LICENSE
Author: Alan Falloon
Maintainer: alan.falloon@gmail.com
Copyright: Copyright (c) 2011 Alan Falloon
Stability: Experimental
Category: Math
Build-type: Simple
Cabal-version: >=1.6
Source-repository head
Type: git
Location: git://github.com/alanfalloon/hmatrix-nipals.git
Branch: master
Flag test
Description: Build unit-tests
Default: False
Library
Hs-source-dirs: src
Exposed-modules:
Numeric.LinearAlgebra.NIPALS
Build-depends:
base >= 3 && < 5,
hmatrix >= 0.11
Executable test
Main-is: tests.hs
Hs-source-dirs: src test
if flag(test)
Build-depends:
QuickCheck >= 2.4,
base >= 3 && < 5,
hmatrix >= 0.11,
test-framework >= 0.3,
test-framework-quickcheck2 >= 0.2.9
else
Buildable: False