data = load("admission.txt");
X = data(:, [1, 2]); 
y = data(:, 3);

pos = find(y == 1);
neg = find(y == 0);

plot(X(pos,1), X(pos,2), 'b+', 'LineWidth', 2, 
     X(neg,1), X(neg,2), 'ro', 'LineWidth', 2);
xlabel('Resultat examen 1');
ylabel('Resultat examen 2');
legend('Admis', 'Non-admis');


function g = sigmoid(z)
   g = zeros(size(z));
   g = 1 ./ (1 + e .^ (-z));
end


z = -10:0.5:10;
g = sigmoid(z);

plot(z,g)


