csci5521/assignments/hwk02/Back_Project.m

23 lines
687 B
Mathematica
Raw Normal View History

2023-10-12 23:51:06 +00:00
% implements the Back Projection algorithm, returns nothing but displays
% the first 5 eigenfaces of the training data after being 'back-projected'
% using the first 10, 50, and 100 eigenvectors of the data.
function [] = Back_Project(training_data, test_data, n_components)
% stack data
2023-10-22 04:32:00 +00:00
data = vertcat(training_data, test_data);
2023-10-12 23:51:06 +00:00
% TODO: perform PCA
2023-10-22 04:32:00 +00:00
2023-10-12 23:51:06 +00:00
% for each number of principal components
for n = 1:length(n_components)
2023-10-22 04:32:00 +00:00
% TODO: perform the back projection algorithm using the first n_components(n) principal components
2023-10-12 23:51:06 +00:00
2023-10-22 04:32:00 +00:00
% TODO: plot first 5 images back projected using the first
% n_components(n) principal components
2023-10-12 23:51:06 +00:00
end
end % Function end