|
I have data that has approximately sigmoid shape, so I think that fitting some form of logistic function would be a good idea. But as much as I know, this is used only when dealing with discrete class labels, and I have continuous data. Basically, x(features) is a continuous 1-D vector, and y(labels) is a continuous 1-D vector as well. What would be the best approach? |
|
You can fit a generalized linear model using any loss function you want. For example, you can minimize ||sigmoid(w dot x) - y||², or maybe ||w dot x - inverse_sigmoid(y)||², where inverse_sigmoid is the inverse of the sigmoid function (that is, inverse_sigmoid(sigmoid(x)) = x for all x). The second objective function is certainly convex (I'm not sure about the first, I haven't checked either way), so putting it through any optimizer should give you reasonable results. You might also want to add regularization terms. How would I do this in matlab?
(Aug 01 '11 at 15:49)
Viktor Simjanoski
I don't know matlab, but for the second option above you can compute the inverse of the sigmoid inverse_sigmoid(x) = log(x/(1-x)) of y and then use any linear regression function from x to inverse_sigmoid(y). Of course, y should lie between 0 and 1, but if it doesn't you can always scale and add a constant so that it does.
(Aug 01 '11 at 15:55)
Alexandre Passos ♦
|