📄 primalgeneralfeaturestest.m
字号:
%A script to test some properties of primalGeneralFeatures
tol = 10^-6;
numExamples =10;
numFeatures = 5;
numLabels = 2;
X = rand(numExamples, numFeatures);
Y = rand(numExamples, numLabels);
T = 5;
featureDirection = 'maxCovariance';
[newTrainX, newTestX, u, p] = primalGeneralFeatures(X, Y, X, T, featureDirection);
%First, check that the training features are orthgonal
if norm(newTrainX'*newTrainX - eye(T).*diag(sum(newTrainX.^2, 1))) > tol
error('Training features are not orthogonal');
end
%Check X = TP'
if norm(newTrainX*p' - X) > tol
error('Full rank TP does not return original features');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -