Why is there a discrepancy between the mathematical hypothesis formula and the actual implementation of it in linear regression?

32 Views Asked by At

I have taken a few machine learning classes and have always wondered why there are apparent differences between the formula shown and what is actually implemented.

In relation to the vectorized hypothesis formula, I see $h_{\theta}(x)={\theta}^Tx^{(i)}$ when being shown the outline and $h_{\theta}(x)=X{\theta}$ when shown implementation. I suspect this has something to do with either using $x$ as a column vector or as the full matrix of features, however, I would appreciate it if someone could explain to me why the same formula has two nonequal expressions.

Thanks.

1

There are 1 best solutions below

0
On

Notice that we have $$h_\theta(x) = \theta^Tx^{(i)}=x^{(i)T}\theta$$

$X$ is a matrix of which each row is a sample, hence they are consistent.