# Linear and logistic regression - Reply 1

**URL:** <https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359>\
**Category:** General\
**Created:** [March 11, 2023, 2:42pm UTC](https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359 "2023-03-11T14:42:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCR](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@JCR](https://swi-prolog.discourse.group/u/JCR)\
**Post date:** [March 11, 2023, 2:42pm UTC](https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359/1 "2023-03-11T14:42:11Z")

</div>

@friguzzi

Hi!

I find the logistic regression predicate very useful and consider integrating it in my code. Is there a particular license I should keep in mind?

Cheers/JCR

---

<div class="post-metadata">

**Author:** ![friguzzi](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/friguzzi/32/7045_2.png) [@friguzzi](https://swi-prolog.discourse.group/u/friguzzi)\
**Post date:** [April 2, 2023, 3:45pm UTC](https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359/3 "2023-04-02T15:45:42Z")

</div>

Hi JCR,  
sorry for the late reply, I missed your question.  
The code is under the MIT license

---

<div class="post-metadata">

**Author:** ![JCR](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@JCR](https://swi-prolog.discourse.group/u/JCR)\
**Post date:** [April 4, 2023, 9:48am UTC](https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359/4 "2023-04-04T09:48:59Z")

</div>

No problem 🙂 Thank you for the information.

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [April 17, 2023, 2:30pm UTC](https://swi-prolog.discourse.group/t/linear-and-logistic-regression-reply-1/6359/5 "2023-04-17T14:30:17Z")

</div>

FWIW, here are some methods that are, numerically, a bit more stable than (X’X)^-1

> **[Numerical methods for linear least squares](https://en.wikipedia.org/wiki/Numerical_methods_for_linear_least_squares)**
>
> Numerical methods for linear least squares entails the numerical analysis of linear least squares problems.
> A general approach to the least squares problem 
>   
>     
>       
>         
>           
> m
> i
> n
>         
>         
>         
>           
> ‖
>           
>         
>         
> y
>         
> −
> X
>         
> β
>         
>         
>           
>             
> ‖
>             
>           
>           
> 2
>           
>         
> ...
