%% Compare Test Data to Historical Data
% Load training data.

load('pairwiseTrainTables.mat')

% The training data is a cell array of tables. Each table is a degradation feature profile for a component.
%
% Create and train a pairwise similarity model.

mdl = pairwiseSimilarityModel;
fit(mdl,pairwiseTrainTables,"Time","Condition")

%
% Load testing data.

load('pairwiseTestData.mat')

%
% Compare the degradation profile of the test data to the profiles of the historical data ensemble.

compare(mdl,pairwiseTestData)