Train and test a Logistic Regression model using Gradient Descent and Newton's Method.
- GNU Octave
- Binary classifier (can be adapted for multiclass)
- Uses the regularized cross-entropy error function
- From the UC Irvine Machine Learning Repository.
- Contained in
.dat
files in the/ionosphere
directory.
main.m
: contains demo of Gradient Descent and Newton's Method on Ionosphere dataset.gradient_descent.m
: trains logistic model using Batch Gradient Descent and returns two variables, w, the weight vector, and b the bias term.newton.m
: trains logistic model using Newton's Method, returning same variables as above.testLogisticRegression.m
: reports the accuracy of the logistic model.
sigmoid.m
: computes Sigmoid of given value.bgradient.m
: computes gradient with respect to the bias termwgradient.m
: computes gradient with respect to the weight vector
- Run
main
in Octave.