function sheet11

fprintf('loading data...');
X = load('alpha_train_x.txt');
Y = load('alpha_train_y.txt');

[N, D] = size(X);

fprintf('%d data points with %d features.\n', N, D);

P = randperm(N);

XE = X(P(N/2:end), :);
YE = Y(P(N/2:end), :);
X = X(P(1:N/2), :);
Y = Y(P(1:N/2), :);

size(X)
size(Y)
size(XE)
size(YE)

fprintf('training...');
% find reasonable values below!
epochs = ?;
iters = ?;
C = ?;
eta = ?;
C = linsvm_sgd(C, eta, epochs, iters, X, Y, XE, YE);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% your solution below.
%
%

% Train a linear SVM with quadratic costs on the slack variables using
% stochastic gradient descent.
%
% Parameters:
%   - eta: base value for eta
%   - epochs: total number of runs through the data.
%   - iters: number of iterations per epoch
%   - X, Y: training data
%   - XE, YE: test data (only for computing the progress)
%
% Plot the test errors on training and test data for each epoch.
function linsvm_sgd(C, eta, epochs, iters, X, Y, XE, YE)
% ...
