src/PredictionBuilder.php
public function readFromArray(array $data) {
        $callback = 
        function ($v) {
            if ((!isset($v[0])) || (!isset($v[1]))) {
                throw new \InvalidArgumentException('Mismatch in the number of x and y in the dataset.');
            } else {
                $this->xVector[] = $v[0];
                $this->yVector[] = $v[1];
            }
        };    
        array_walk($data, $callback);
    }
public function readFromArray(array $data) {
        $callback = 
        function ($v) {
            if ((!isset($v[0])) || (!isset($v[1]))) {
                throw new \InvalidArgumentException('Mismatch in the number of x and y in the dataset.');
            } else {
                $this->xVector[] = $v[0];
                $this->yVector[] = $v[1];
            }
        };    
        array_walk($data, $callback);
    }
public function readFromArray ( array $ data ) { $ callback = function ( $ v ) { if ( ( ! isset ( $ v [ 0 ] ) ) || ( ! isset ( $ v [ 1 ] ) ) ) { throw new \ InvalidArgumentException ( 'Mismatch in the number of x and y in the dataset.' ) ; } else { $ this -> xVector [ ] = $ v [ 0 ] ; $ this -> yVector [ ] = $ v [ 1 ] ; } } ; array_walk ( $ data , $ callback ) ; }
Reads the data from a given array

@param array $data

@throws \InvalidArgumentException
Reads the data from a given array