Hi All, I'd like to use logistic regression to do classification in waffles. When I use neural network or decision tree to classfication, I can follow the code in the demos directory, but I can't find the code about logistic regression, what I found is the function calibrate(GMatrix& features, GMatrix& labels) in GLearner.h, my question is , What algorithm does the waffles use to do logistic regression(for example, Stochastic gradient descent, SGD)? where can I find the relative code?
any kind of help is appreciate, thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you use the GNeuralNet class, but you add no hidden layers before training, then the model will consist of a single layer of logistic units trained by stochastic gradient descent. I would call that logistic regression. Does that differ from what you are looking for in any specific ways?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2014-07-03
thanks for the help, Mike. I've found the SGD code.
In the do_neural_network() function, can I use the following codes to achieve the same function with logistic regression?
void do_neural_network(...)
{
GNeuralNet model;
model.setTopology(0); //add no hidden layers
model.setLearningRate(0.1);
model.setMomentum(0.1);
model.train(features, labels);
model.predict(test_features, predicted_labels);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That actually says to add one hidden layer containing zero nodes. (I'm not quite sure what that will do.) If you do not call setTopology at all, then there will be no hidden layers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All, I'd like to use logistic regression to do classification in waffles. When I use neural network or decision tree to classfication, I can follow the code in the demos directory, but I can't find the code about logistic regression, what I found is the function calibrate(GMatrix& features, GMatrix& labels) in GLearner.h, my question is , What algorithm does the waffles use to do logistic regression(for example, Stochastic gradient descent, SGD)? where can I find the relative code?
any kind of help is appreciate, thanks.
If you use the GNeuralNet class, but you add no hidden layers before training, then the model will consist of a single layer of logistic units trained by stochastic gradient descent. I would call that logistic regression. Does that differ from what you are looking for in any specific ways?
thanks for the help, Mike. I've found the SGD code.
In the do_neural_network() function, can I use the following codes to achieve the same function with logistic regression?
void do_neural_network(...)
{
GNeuralNet model;
model.setTopology(0); //add no hidden layers
model.setLearningRate(0.1);
model.setMomentum(0.1);
model.train(features, labels);
model.predict(test_features, predicted_labels);
}
Yes, except omit the line
model.setTopology(0);
That actually says to add one hidden layer containing zero nodes. (I'm not quite sure what that will do.) If you do not call setTopology at all, then there will be no hidden layers.