PHPackages                             sbrbot/mlr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sbrbot/mlr

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sbrbot/mlr
==========

PHP library for calculating Multivariate Linear Regression

1.0.0(8y ago)071MITPHPPHP &gt;=7.0.0

Since Dec 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sbrbot/MLR)[ Packagist](https://packagist.org/packages/sbrbot/mlr)[ RSS](/packages/sbrbot-mlr/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Multivariate Linear Regression
==============================

[](#multivariate-linear-regression)

This is a simple **Multivariate Linear Regression** library implemented in PHP.

Using known regression formula: (XTX)-1XTY it calculates linear coefficients and prediction.

```
require 'MLR.php';

// x1,x2,x3
// input variables (matrix)
$X=[[1,3,3],
    [2,3,1],
    [2,4,2],
    [3,3,4]];

// target variable (vector)
$Y=  [[3],
      [2],
      [4],
      [3]];

// prediction for (matrix)
// x1,x2,x3
$Z=[[2,3,3]];

// instantiate and calculate coefficients
$MLR=new MLR($X,$Y);

// fetch coefficients (if needed)
$Coefficients=$MLR->getCoefficients();

// predict values for given input variable(s)
$Prediction=$MLR->getPrediction($Z);
```

As simple as that!

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3075d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b363e5dc7bd5c9bc6980b77970f695fd44a0a0543e9f9ae705497b10664f5b69?d=identicon)[sbrbot](/maintainers/sbrbot)

---

Top Contributors

[![sbrbot](https://avatars.githubusercontent.com/u/1915443?v=4)](https://github.com/sbrbot "sbrbot (1 commits)")

---

Tags

linear-regressionmathematicsmultivariablemultivariate-linear-regressionphpregressionstatistics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sbrbot-mlr/health.svg)

```
[![Health](https://phpackages.com/badges/sbrbot-mlr/health.svg)](https://phpackages.com/packages/sbrbot-mlr)
```

###  Alternatives

[hisune/echarts-php

A php wrapper for echarts javascript libraries

327201.9k5](/packages/hisune-echarts-php)[imliam/laravel-env-set-command

Set a .env file variable from the command line

118352.4k10](/packages/imliam-laravel-env-set-command)[bref/symfony-bridge

Makes Symfony work on AWS Lambda with Bref

491.7M5](/packages/bref-symfony-bridge)[andig/php-shunting-yard

Refactored repack of https://github.com/droptable/php-shunting-yard

26219.4k](/packages/andig-php-shunting-yard)[jackabox/nova-duplicate-field

A Laravel Nova field to duplicate records.

30111.5k](/packages/jackabox-nova-duplicate-field)[vdechenaux/brotli

Add brotli compress/uncompress functions to PHP

2468.3k1](/packages/vdechenaux-brotli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
