PHP code example of esplora / next-value-predictor

1. Go to this page and download the library: Download esplora/next-value-predictor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

esplora / next-value-predictor example snippets


$ composer 

use Esplora\Predictor\Predictor;

$predictor = new Predictor([1, 3, 1, 4, 2, 4, 3, 1, 4, 1, 4, 2, 1, 4, 5]);

$predictor->predict(); // 3.004

$predictor = new Predictor([1, 3, 1, 4, 2, 4, 3, 1, 4, 1, 4, 2, 1, 4, 5]);

$predictor->predict(0.0); // 5.0
$predictor->predict(0.5); // 1.789,

$predictor->probabilityGreaterThan(5); // 0.0
$predictor->probabilityGreaterThan(0); // 1.0