get the estimates based on the last sample

@return float[]

@throws InsufficientSamplesException - if no estimate is currently available due to insufficient data
768748
public float[] getEstimates() throws InsufficientSamplesException {
        if(!isInitializing) {
            for (int i = 1; i <= m; i++) {
                e[i-1] = q[2*i+1];
            }
            return e;
        } else {
            throw new InsufficientSamplesException();
        }
    }
680321
@Override
  public final void sample()
  {
    synchronized (_lock) {
      long count = _count.get();
      long lastCount = _lastAvgCount;
      _lastAvgCount = count;

      long sum = _sum.get();
      double lastSum = _lastAvgSum;
      _lastAvgSum = sum;

      if (count == lastCount)
        _value = 0;
      else
        _value = _scale * (sum - lastSum) / (double) (count - lastCount);
    }
  }
684132
public long[] getSamples() {
    if (itemsSeen_ == 0) {
      return null;
    }
    final int numSamples = (int) Math.min(reservoirSize_, itemsSeen_);
    return java.util.Arrays.copyOf(data_, numSamples);
  }
338376
public function predict(Dataset $dataset) : array
    {
        if (empty($this->samples) or empty($this->labels)) {
            throw new RuntimeException('Estimator has not been trained.');
        }

        DatasetIsCompatibleWithEstimator::check($dataset, $this);

        $predictions = [];

        foreach ($dataset as $sample) {
            [$labels, $distances] = $this->nearest($sample);

            if ($this->weighted) {
                $weights = [];

                foreach ($distances as $i => $distance) {
                    $weights[] = 1. / (1. + $distance);
                }

                $outcome = Stats::weightedMean($labels, $weights);
            } else {
                $outcome = Stats::mean($labels);
            }

            $predictions[] = $outcome;
        }

        return $predictions;
    }
686568
protected function getRealTimeStatistics() {
        if (!$this->_realTimeStatistics) {
            $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList(
                $this->version,
                $this->solution['sid']
            );
        }

        return $this->_realTimeStatistics;
    }
985981
protected function getAvailableTotals()
    {
        $vatAmount = 0.0;
        // No order_tax_info => no tax (?) => vatamount = 0.
        if (!empty($this->source->order_tax_info)) {
            foreach ($this->source->order_tax_info as $taxInfo) {
                if (!empty($taxInfo->tax_amount)) {
                    $vatAmount += $taxInfo->tax_amount;
                }
            }
        }
        return array(
            Meta::InvoiceAmountInc => $this->source->order_full_price,
            Meta::InvoiceVatAmount => $vatAmount,
        );
    }
220479
protected function estimateSavings()
	{
		$this->savings = [];
		foreach ($this->getStringsFrequency() as $str => $cnt)
		{
			$len             = strlen($str);
			$originalCost    = $cnt * $len;
			$replacementCost = $cnt * 2;
			$overhead        = $len + 6;

			$this->savings[$str] = $originalCost - ($replacementCost + $overhead);
		}
	}
757332
public function getSpecialVariables()
    {
        $vars = [
            '_' => $this->returnValue,
        ];

        if (isset($this->lastException)) {
            $vars['_e'] = $this->lastException;
        }

        if (isset($this->lastStdout)) {
            $vars['__out'] = $this->lastStdout;
        }

        if (isset($this->boundObject)) {
            $vars['this'] = $this->boundObject;
        }

        return \array_merge($vars, $this->commandScopeVariables);
    }
416959
public function get_most_recent_prediction_range() {

        $ranges = $this->get_all_ranges();

        // Opposite order as we are interested in the last range that can be used for prediction.
        krsort($ranges);

        // We already provided the analysable to the time splitting method, there is no need to feed it back.
        foreach ($ranges as $rangeindex => $range) {
            if ($this->ready_to_predict($range)) {
                // We need to maintain the same indexes.
                return array($rangeindex => $range);
            }
        }

        return array();
    }
71440
public function getPreviousExceptions()
    {
        if ($this->previousExceptions === null) {
            $this->previousExceptions = [];

            $prev = $this->exception->getPrevious();
            while ($prev !== null) {
                $this->previousExceptions[] = $prev;
                $prev = $prev->getPrevious();
            }
        }

        return $this->previousExceptions;
    }
141043
public function getCoverage() : float
    {
        $processor = new Processor();
        $result    = $processor->run($this->phpUnit . ' --coverage-text|grep Classes|cut -d " " -f 4|cut -d "%" -f 1');
        $output    = $result->getStdOut();
        if (!$result->isSuccessful() || empty($output)) {
            throw new RuntimeException('Error while executing PHPUnit: ' . $result->getStdErr());
        }
        return (float) $output;
    }
709848
public function getMostUsedVatPercent()
    {
        $aPrices = $this->getPriceInfo();
        if (count($aPrices) == 0) {
            return;
        }

        return max(array_keys($aPrices, max($aPrices)));
    }
1165013
public function getMeasuredCronInterval()
    {
        $lastRuns = Mage::app()->loadCache(self::CACHE_KEY_SCHEDULER_LASTRUNS);
        $lastRuns = array_values(array_filter(explode(',', $lastRuns)));
        if (count($lastRuns) < 3) {
            // not enough data points
            return false;
        }
        $gaps = array();
        foreach ($lastRuns as $index => $run) {
            if ($index > 0) {
                $gaps[$index] = intval($lastRuns[$index]) - intval($lastRuns[$index-1]);
            }
        }
        return array(
            'average' => round((array_sum($gaps) / count($gaps)) / 60, 2),
            'max' => round(max($gaps) / 60, 2),
            'min' => round(min($gaps) / 60, 2),
            'count' => count($gaps),
            'last' => end($lastRuns)
        );
    }
241098
public function get(): array {

        // We join the datasets by time splitting method.
        $timesplittingresults = array();
        foreach ($this->resultsbytimesplitting as $timesplittingid => $results) {
            if (empty($timesplittingresults[$timesplittingid])) {
                $timesplittingresults[$timesplittingid] = [];
            }
            $timesplittingresults[$timesplittingid] += $results;
        }

        return $timesplittingresults;
    }
693851
public function any_prediction_obtained() {
        global $DB;
        return $DB->record_exists('analytics_predict_samples',
            array('modelid' => $this->model->id, 'timesplitting' => $this->model->timesplitting));
    }
425873
protected function getSamples() {
        if (!$this->_samples) {
            $this->_samples = new SampleList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_samples;
    }
674424
public function priors() : array
    {
        $priors = [];

        if (is_array($this->priors)) {
            $max = logsumexp($this->priors);

            foreach ($this->priors as $class => $probability) {
                $priors[$class] = exp($probability - $max);
            }
        }

        return $priors;
    }