% Create a synthetic dataset of positives and negatives
% Author: Aravindh Mahendran
% aravindh.mahendran@new.ox.ac.uk
X = randn(2, 100);
w_gt = [1/sqrt(2); 1/sqrt(2); 0];
X_augmented = [X; ones(1, 100)];
scores = w_gt' * X_augmented;

idx_positive = find(scores > 0);
idx_negative = find(scores <= 0);

X_positive = X(:, idx_positive);
X_negative = X(:, idx_negative);

plot(X_positive(1,:), X_positive(2,:), 'b+');
hold on;
plot(X_negative(1,:), X_negative(2,:), 'r0');
legend('Positive', 'Negative');
axis([-4,4,-4,4]);

save data.mat X_positive X_negative;