What is the problem?
Linear regression is one of the many techniques widely used in machine learning to predict the dependent variable value for a continuous data set. A one factor linear model consumes a list of pairs as training data, with one value in the pair being the feature and the other being the corresponding label. A linear model is fitted on the training data and user will be able to apply the model to other sets of features to generate predictions. I am building a regression model with Prolog that takes a list of pairs as training data, another list of values for prediction. The model will be calibrated and the coefficient and predictions will be produced and displayed on the console.
What is the something extra?
I will also compute the fit qualities such as the sum squared of errors and coefficient of determination. If time permits, I also want to add the functionality to plot the training data and fitted model to visualize the fit results.
What did we learn from doing this?
I learned a lot of list processing, doing arithmetic in prolog, and user I/O. Logic programming is not entirely suitable for matrix algebra because there isn't a rich linear algebra library available (perhaps there is one that I am not aware of) and Prolog is not particularly strong in terms of mathematical computation. But it was a good learning process because I have to be very familiar with every detail of the algorithm in order to implement them.
Project link: https://github.com/kanchine/cpsc312project1