Did you know ... | Search Documentation: |
![]() | Packs (add-ons) for SWI-Prolog |
Title: | Logistic regression using Iteratively reweighted least squares (IRLS) |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 1.0 |
SHA1 sum: | 9ff460f73c7bb9299eeddd31cc8ef0e3bdac7ab2 |
Author: | Fabrizio Riguzzi <fabrizio.riguzzi@unife.it> |
Requires: | cplint |
matrix |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
1.0 | 9ff460f73c7bb9299eeddd31cc8ef0e3bdac7ab2 | 1 | https://github.com/friguzzi/logistic_regression.git |
Logistic regression in SWI-Prolog using Iteratively Reweighted Least Squares (IRLS).
This program performs logistic regression using IRLS. See Logistic regression on Wikipedia and Murphy, Kevin P. (2012). Machine Learning – A Probabilistic Perspective. The MIT Press.
It also includes the predicate generate_data(N, Variance, Coeff, X, Y)
that generates an N-row dataset with predictor variables in matrix X
and predicted variable in list Y.
The predicted variable is computed with the formula:
Y = (Coeff dotprod X + Noise > 0 -> 1 ; 0)
where Variance is the variance of Noise.
The predicate example_log_r(N, Coeff)
is used to test the algorithm for logistic regression and dataset generation:
it generates an N-row dataset with 5 as the noise variance and coefficients [1,2,3]
.
Then it performs 10 iterations of logistic regression.
Coeff is the output of regression and should be a list of three numbers close to [1,2,3]
.
The higher N is, the closer to [1,2,3]
Coeff should be.
Requirements:
matrix
and cplint
Pack contains 4 files holding a total of 9.0K bytes.