Files
QMUL_Machine_Learning/calculate_hypothesis.m
T
2016-10-19 11:01:34 +01:00

10 lines
324 B
Matlab

function hypothesis = calculate_hypothesis(X, theta, training_example)
%CALCULATE_HYPOTHESIS This calculates the hypothesis for a given X,
%theta and specified training example
x = X(training_example, 1:length(theta));
hypothesis = sum(x.*theta);
%hypothesis = theta(1)*x0+theta(2)*x1+theta(3)*x2;
end