-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainRF.m
51 lines (38 loc) · 892 Bytes
/
mainRF.m
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
clear all;
load('./Data/all2/X.mat')
load('./Data/all2/Y.mat')
% convert Y into dB
Y = -10 * log(Y)/log(10);
figure;
histogram(Y)
% split
X = array2table(X);
Xtest = X(1:1e3,:);
Xtrain = X(1e3+1:end,:);
Ytest = Y(1:1e3,:);
Ytrain = Y(1e3+1:end,:);
tic;
for i = 1:5
y_train = Ytrain(:,i);
y_test = Ytest(:,i);
t = templateTree('NumVariablesToSample','all',...
'PredictorSelection','interaction-curvature','Surrogate','on');
rng(1); % For reproducibility
Mdl = fitrensemble(Xtrain,y_train,'Method','Bag','NumLearningCycles',200, ...
'Learners',t);
B = compact(Mdl);
Ypred(:,i) = predict(B, Xtest);
toc;
i
end
% plot
T = {'unMit','FFT2','D3S','Notch','FRFT'};
figure;
for i = 1:5
subplot(2,3,i)
scatter(Ytest(:,i), Ypred(:,i))
grid on
xlabel('ground BER (dB)')
ylabel('predicted BER (dB)')
title(T(i))
end