Attachment 'sheet10.m'
Download 1 function sheet10
2
3 X = textread('splice-train-data.txt', '%s');
4 Y = load('splice-train-label.txt');
5 XE = textread('splice-test-data.txt', '%s');
6 YE = load('splice-test-label.txt');
7
8 tic
9 fprintf('Writing training features for k = 1\n');
10 write_wdk_features('wdk1-train.txt', 1, X, Y);
11 fprintf('Writing test features for k = 1\n');
12 write_wdk_features('wdk1-test.txt', 1, XE, YE);
13 toc
14
15 tic
16 fprintf('Writing training features for k = 2\n');
17 write_wdk_features('wdk2-train.txt', 2, X, Y);
18 fprintf('Writing test features for k = 2\n');
19 write_wdk_features('wdk2-test.txt', 2, XE, YE);
20 toc
21
22 tic
23 fprintf('Writing training features for k = 3\n');
24 write_wdk_features('wdk3-train.txt', 3, X, Y);
25 fprintf('Writing test features for k = 3\n');
26 write_wdk_features('wdk3-test.txt', 3, XE, YE);
27 toc
28
29 function beta = beta(K, k)
30 beta = 2 * (K - k + 1) / K / (K + 1);
31
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 %
34 % Your solution below
35 %
36
37 % 1. write out weighted degree kernel features
38 % out into file FN up to degree K. (You should accept values of K = 1, 2,
39 % 3
40 function write_wdk_features(FN, K, X, Y)
41 % ...
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.