0
$\begingroup$

I have several independent time series (a small sample is in the end of the question) and I am trying to find the outliers using SVM. I have used this to find the outliers

X=[data(:,1),data(:,2)];
y = ones(size(X,1),1);
SVMModel = fitcsvm(X,y,'KernelScale','auto','Standardize',true,'OutlierFraction',0.05);

The above works well and finds the outliers but to use the above, I need to know the outlier fraction ahead which is not going to be the case for all the time series. I have also seen examples with the Kernel function such as:

X=[data(:,1),data(:,2)];
class=ones(size(X,1),1);
theclass(1:100)=-1
cl = fitcsvm(data3,theclass,'KernelFunction','rbf','BoxConstraint',1,'ClassNames',[-1,1]);

When I tried that example the program found no outliers so I am not sure if I did something wrong. I am basically trying to find a way to determine the outliers without any prior knowledge (so without manually labeling data) and without knowing how many outliers are there.

A small part of the data

time        event
10.0000    0.8506
11.0000    0.8780
12.0000    0.7927
13.0000    0.7275
14.0000    0.8059
15.0000    0.3441
16.0000    0.7443
17.0000    0.7917
18.0000    0.7387
19.0000    0.9527
20.0000    0.8982
21.0000    0.9068
22.0000    0.5752
23.0000    0.7700
24.0000    0.7799
25.0000    0.8126
26.0000    0.7997
27.0000    0.7737
28.0000    0.9004
29.0000    0.9168
30.0000    0.7236
31.0000    0.8091
32.0000    0.7225
33.0000    0.8168
34.0000    0.7976
35.0000    0.7799
36.0000    0.8722
37.0000    0.9292
38.0000    0.9953
39.0000    0.7565
40.0000    0.8073
41.0000    0.8184
42.0000    0.7921
43.0000    0.8572
44.0000    0.8083
45.0000    1.0000
46.0000    0.9821
47.0000    0.9052
48.0000    0.7435
49.0000    0.7953
50.0000    0.8361
51.0000    0.7251
52.0000    0.7659
53.0000    0.7763
54.0000    0.8939
55.0000    0.9150
56.0000    0.8992
57.0000    0.7290
58.0000    0.7504
59.0000    0.6991
60.0000    0.7798
61.0000    0.8892
62.0000    0.2000
63.0000    0.9289
64.0000    0.7382
65.0000    0.7079
66.0000    0.7640
67.0000    0.7367
68.0000    0.7369
69.0000    0.7887
70.0000    0.8571
71.0000    0.8963
72.0000    0.8541
73.0000    0.7565
74.0000    0.6965
75.0000    0.7552
76.0000    0.8599
77.0000    0.9264
78.0000    0.8804
79.0000    0.5429
80.0000    0.5868
81.0000    0.6549
82.0000    0.6218
83.0000    0.8530
84.0000    0.9024
85.0000    0.8801
86.0000    0.6216
87.0000    0.7208
88.0000    0.7040
89.0000    0.7334
90.0000    0.6387
91.0000    0.8382
92.0000    0.8831
93.0000    0.8732
94.0000    0.6429
95.0000    0.6532
96.0000    0.6701
97.0000    0.5922
98.0000    0.6401
99.0000    0.3808
100.0000    0.6834
101.0000    0.7791
102.0000    0.7778
103.0000    0.5992
104.0000    0.6293
105.0000    0.6533
106.0000    0.5779
107.0000    0.6127
108.0000    0.6225
109.0000    0.5588
110.0000    0.7918
111.0000    0.7639
112.0000    0.6035
113.0000    0.6297
114.0000    0.6301
115.0000    0.5786
116.0000    0.6022
117.0000    0.6411
118.0000    0.7046
119.0000    0.6929
120.0000    0.6511
121.0000    0.5782
122.0000    0.5336
123.0000    0.5836
124.0000    0.6059
125.0000    0.4844
126.0000    0.5603
127.0000    0.5876
128.0000    0.5810
129.0000    0.5928
130.0000    0.5012
131.0000    0.5244
132.0000    0.5582
133.0000    0.5287
134.0000    0.5679
135.0000    0.5836
136.0000    0.5946
137.0000    0.6027
138.0000    0.5643
139.0000    0.5108
140.0000    0.5568
141.0000    0.5681
142.0000    0.3740
143.0000    0.2845
144.0000    0.5903
145.0000    0.6439
146.0000    0.6248
147.0000    0.4808
148.0000    0.4284
149.0000    0.4959
150.0000    0.4781
151.0000    0.5295
152.0000    0.2644
153.0000    0.4864
154.0000    0.5279
155.0000    0.5108
156.0000    0.4468
157.0000    0.4948
158.0000    0.5140
159.0000    0.4056
160.0000    0.4852
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.