-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_code.m
More file actions
25 lines (20 loc) · 859 Bytes
/
Copy pathexample_code.m
File metadata and controls
25 lines (20 loc) · 859 Bytes
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
close all
clear
clc
load('sample_data') % load sample data
load('Actual_class') % load the actual class of the sample data
ind = crossvalind('Kfold',Actual_class,10); % generate indices to divide
% sample data into train and test data
% Select 1st set as test data and remaining sets as test data
num = 1;
test = (ind == num);
test_ind = find(test == 1);
train = ~test;
train_ind = find(train == 1);
Train_data = sample_data(:,:,train_ind);
Target_Train = Actual_class(train_ind);
Test_data = sample_data(:,:,test_ind);
Target_Test = Actual_class(test_ind);
% Researchers can provide their own data and parameters to the OPTICAL
% function. Here window size of 50 sample points with 20% overlap is used
predicted_class = OPTICAL(Train_data,Test_data,Target_Train, Target_Test, 50, 20);%original overlap is 20, window size is 50