3 ms·
Once you've switched to gradient descent (or anything that can solve for solutions to arbitrary cost functions) there is no difference. I'd have to work this o
by michaelochurch 13y ago
Once you've switched to gradient descent (or anything that can solve for solutions to arbitrary cost functions) there is no difference.
I'd have to work this out on paper. I think that's essentially right, but most of your CPU cost is going to be in evaluating that function (or, more accurately, its derivative) and not all functions are, in terms of computational cost, equal. I think the logistic model might take longer to train, but I'd have to work it out to be sure.
You're right that the code isn't much different.
So linear regression can perhaps be easier than logistic regression, but only when n is so small that you're solving your linear regression by inverting the matrix.
The matrix grows with the number of features, so if you have 1 billion observations but only 100 features (dimensions) you can do that.
- dannypgh 13y agoI doubt the CPU costs will be measurably different. I suggest watching: https://class.coursera.org/ml-003/lecture/36 https://class.coursera.org/ml-003/lecture/36 and you can jump to 7 minutes if you don't want to watch the whole thing. The only difference is instead of merely doing the matrix multiplication of your observation times your coefficients (the scalar product of θ and x) you have to take the output and use it as the input to the logistic function. The matrix multiplication will grow in complexity with the number of non-zero features (either non-zero coefficients in your model or non-zero features in your observation, presumably the latter) and the evaluation of the sigmoid function will be constant time, and on many architectures will be a very small number of instructions. If you're operating in very small numbers of dimensions what you're doing may still be interesting but I'm not sure it qualifies as "Big Data," regardless of the number of available observations. After all, if you're producing something with actual utility, you'll probably converge sooner rather than later...