-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.m
56 lines (47 loc) · 1.54 KB
/
Main.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
52
53
54
55
56
% clean up
close all
clear all
clc
% load the data
bleDataset = load('Data/JinyuanMall_ble.txt');
wifiDataset = load('Data/JinyuanMall_wifi.txt');
label = wifiDataset(:,1:2);
bleFeature = bleDataset(:,3:7);
wifiFeature = wifiDataset(:,3:9);
DATA = [label bleFeature wifiFeature];
rowrank = randperm(size(DATA, 1));
DATA = DATA(rowrank, :);
TRAIN_DATA = DATA(1:4800,:);
TEST_DATA = DATA(4801:end,:);
% ------------------ start of FSRVFL --------------------------
Lamda1 = 0.6; %0.3
Lamda2 = 0.6; %0.3
nOuput = 2;
nFirstFeature = 5;
NN1 = 20;
NN2 = 20;
nHiddenNeurons = 1000;
ActivationFunction = 'sig';
fprintf('FSRVFLMO')
TrainingData = TRAIN_DATA;
TestingData = TEST_DATA;
nOutput = 2;
nFeatureA = 5;
nLabeledData = 1000;
LamdaA = 0.6;
LamdaB = 0.6;
LaplacianOptionsA.NN = 20;
LaplacianOptionsA.GraphDistanceFunction='euclidean';
LaplacianOptionsA.GraphWeights='binary';
LaplacianOptionsA.GraphNormalize=1;
LaplacianOptionsA.GraphWeightParam=1;
LaplacianOptionsB.NN = 20;
LaplacianOptionsB.GraphDistanceFunction='euclidean';
LaplacianOptionsB.GraphWeights='binary';
LaplacianOptionsB.GraphNormalize=1;
LaplacianOptionsB.GraphWeightParam=1;
nHiddenNeurons = 1000;
ActivationFunction = 'sig';
[TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy, EstimatedOutputs] = FSRVFL(TrainingData, TestingData, nOutput, nFeatureA, nLabeledData, LamdaA, LamdaB, LaplacianOptionsA, LaplacianOptionsB, nHiddenNeurons, ActivationFunction)
%plot(EstimatedOutputs(:,1), EstimatedOutputs(:,2))
[ErrorDis, Acc] = Accuracy(TestingData(:,1:2), EstimatedOutputs, 38.5)