From c0b4d95f758527813a8366ed26bd86e513e6362c Mon Sep 17 00:00:00 2001 From: neingeist Date: Tue, 14 Oct 2014 10:14:29 +0200 Subject: [PATCH] Predict --- ex2/predict.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ex2/predict.m b/ex2/predict.m index 34a2905..62a12ea 100644 --- a/ex2/predict.m +++ b/ex2/predict.m @@ -1,7 +1,7 @@ function p = predict(theta, X) -%PREDICT Predict whether the label is 0 or 1 using learned logistic +%PREDICT Predict whether the label is 0 or 1 using learned logistic %regression parameters theta -% p = PREDICT(theta, X) computes the predictions for X using a +% p = PREDICT(theta, X) computes the predictions for X using a % threshold at 0.5 (i.e., if sigmoid(theta'*x) >= 0.5, predict 1) m = size(X, 1); % Number of training examples @@ -11,10 +11,11 @@ p = zeros(m, 1); % ====================== YOUR CODE HERE ====================== % Instructions: Complete the following code to make predictions using -% your learned logistic regression parameters. +% your learned logistic regression parameters. % You should set p to a vector of 0's and 1's % +p = sigmoid(X * theta) > 0.5;