forked from pdollar/toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcaApply.html
78 lines (60 loc) · 3.15 KB
/
pcaApply.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of pcaApply</title>
<meta name="keywords" content="pcaApply">
<meta name="description" content="Companion function to pca.">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html © 2003 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html classify -->
<h1>pcaApply
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Companion function to pca.</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout = pcaApply( X, U, mu, k ) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Companion function to pca.
Use pca.m to retrieve the principal components U and the mean mu from a
set of vectors x, then use pcaApply to get the first k coefficients of
x in the space spanned by the columns of U. See pca for general usage.
If x is large, pcaApply first splits and processes x in parts. This
allows pcaApply to work even for very large arrays.
This may prove useful:
siz=size(X); k=100; Uim=reshape(U(:,1:k),[siz(1:end-1) k ]);
USAGE
[ Yk, Xhat, avsq ] = pcaApply( X, U, mu, k )
INPUTS
X - data for which to get PCA coefficients
U - returned by pca.m
mu - returned by pca.m
k - number of principal coordinates to approximate X with
OUTPUTS
Yk - first k coordinates of X in column space of U
Xhat - approximation of X corresponding to Yk
avsq - measure of squared error normalized to fall between [0,1]
EXAMPLE
See also <a href="pca.html" class="code" title="function [U,mu,vars] = pca( X )">PCA</a>, <a href="pcaVisualize.html" class="code" title="function varargout=pcaVisualize( U, mu, vars, X, index, ks, fname, show )">PCAVISUALIZE</a>
Piotr's Computer Vision Matlab Toolbox Version 2.0
Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com]
Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>
<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> © 2003</address>
</body>
</html>